summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/SHA1.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-05 13:36:33 +0000
committerschwarze <>2016-11-05 13:36:33 +0000
commit71b431bd059aaefaa67b54a34adfaadc4014902c (patch)
tree7bf60aef63735e9638d12b0d8302b14d9860466e /src/lib/libcrypto/man/SHA1.3
parent5074288f0801a2b426584402e81b5953f706a44f (diff)
downloadopenbsd-71b431bd059aaefaa67b54a34adfaadc4014902c.tar.gz
openbsd-71b431bd059aaefaa67b54a34adfaadc4014902c.tar.bz2
openbsd-71b431bd059aaefaa67b54a34adfaadc4014902c.zip
convert the remaining manual pages from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/man/SHA1.3')
-rw-r--r--src/lib/libcrypto/man/SHA1.3102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/SHA1.3 b/src/lib/libcrypto/man/SHA1.3
new file mode 100644
index 0000000000..c873a8cbb7
--- /dev/null
+++ b/src/lib/libcrypto/man/SHA1.3
@@ -0,0 +1,102 @@
1.Dd $Mdocdate: November 5 2016 $
2.Dt SHA1 3
3.Os
4.Sh NAME
5.Nm SHA1 ,
6.Nm SHA1_Init ,
7.Nm SHA1_Update ,
8.Nm SHA1_Final
9.Nd Secure Hash Algorithm
10.Sh SYNOPSIS
11.In openssl/sha.h
12.Ft unsigned char *
13.Fo SHA1
14.Fa "const unsigned char *d"
15.Fa "unsigned long n"
16.Fa "unsigned char *md"
17.Fc
18.Ft int
19.Fo SHA1_Init
20.Fa "SHA_CTX *c"
21.Fc
22.Ft int
23.Fo SHA1_Update
24.Fa "SHA_CTX *c"
25.Fa "const void *data"
26.Fa "unsigned long len"
27.Fc
28.Ft int
29.Fo SHA1_Final
30.Fa "unsigned char *md"
31.Fa "SHA_CTX *c"
32.Fc
33.Sh DESCRIPTION
34SHA-1 (Secure Hash Algorithm) is a cryptographic hash function with a
35160 bit output.
36.Pp
37.Fn SHA1
38computes the SHA-1 message digest of the
39.Fa n
40bytes at
41.Fa d
42and places it in
43.Fa md ,
44which must have space for
45.Dv SHA_DIGEST_LENGTH
46== 20 bytes of output.
47If
48.Fa md
49is
50.Dv NULL ,
51the digest is placed in a static array.
52.Pp
53The following functions may be used if the message is not completely
54stored in memory:
55.Pp
56.Fn SHA1_Init
57initializes a
58.Vt SHA_CTX
59structure.
60.Pp
61.Fn SHA1_Update
62can be called repeatedly with chunks of the message to be hashed
63.Pq Fa len No bytes at Fa data .
64.Pp
65.Fn SHA1_Final
66places the message digest in
67.Fa md ,
68which must have space for
69.Dv SHA_DIGEST_LENGTH
70== 20 bytes of output, and erases the
71.Vt SHA_CTX .
72.Pp
73Applications should use the higher level functions
74.Xr EVP_DigestInit 3
75etc. instead of calling the hash functions directly.
76.Pp
77The predecessor of SHA-1, SHA, is also implemented, but it should be
78used only when backward compatibility is required.
79.Sh RETURN VALUES
80.Fn SHA1
81returns a pointer to the hash value.
82.Pp
83.Fn SHA1_Init ,
84.Fn SHA1_Update ,
85and
86.Fn SHA1_Final
87return 1 for success or 0 otherwise.
88.Sh SEE ALSO
89.Xr EVP_DigestInit 3 ,
90.Xr HMAC 3 ,
91.Xr RIPEMD160 3
92.Sh STANDARDS
93SHA: US Federal Information Processing Standard FIPS PUB 180 (Secure
94Hash Standard), SHA-1: US Federal Information Processing Standard FIPS
95PUB 180-1 (Secure Hash Standard), ANSI X9.30
96.Sh HISTORY
97.Fn SHA1 ,
98.Fn SHA1_Init ,
99.Fn SHA1_Update ,
100and
101.Fn SHA1_Final
102are available in all versions of SSLeay and OpenSSL.