diff options
Diffstat (limited to 'src/lib/libcrypto/man/SHA1.3')
| -rw-r--r-- | src/lib/libcrypto/man/SHA1.3 | 102 |
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 | ||
| 34 | SHA-1 (Secure Hash Algorithm) is a cryptographic hash function with a | ||
| 35 | 160 bit output. | ||
| 36 | .Pp | ||
| 37 | .Fn SHA1 | ||
| 38 | computes the SHA-1 message digest of the | ||
| 39 | .Fa n | ||
| 40 | bytes at | ||
| 41 | .Fa d | ||
| 42 | and places it in | ||
| 43 | .Fa md , | ||
| 44 | which must have space for | ||
| 45 | .Dv SHA_DIGEST_LENGTH | ||
| 46 | == 20 bytes of output. | ||
| 47 | If | ||
| 48 | .Fa md | ||
| 49 | is | ||
| 50 | .Dv NULL , | ||
| 51 | the digest is placed in a static array. | ||
| 52 | .Pp | ||
| 53 | The following functions may be used if the message is not completely | ||
| 54 | stored in memory: | ||
| 55 | .Pp | ||
| 56 | .Fn SHA1_Init | ||
| 57 | initializes a | ||
| 58 | .Vt SHA_CTX | ||
| 59 | structure. | ||
| 60 | .Pp | ||
| 61 | .Fn SHA1_Update | ||
| 62 | can 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 | ||
| 66 | places the message digest in | ||
| 67 | .Fa md , | ||
| 68 | which must have space for | ||
| 69 | .Dv SHA_DIGEST_LENGTH | ||
| 70 | == 20 bytes of output, and erases the | ||
| 71 | .Vt SHA_CTX . | ||
| 72 | .Pp | ||
| 73 | Applications should use the higher level functions | ||
| 74 | .Xr EVP_DigestInit 3 | ||
| 75 | etc. instead of calling the hash functions directly. | ||
| 76 | .Pp | ||
| 77 | The predecessor of SHA-1, SHA, is also implemented, but it should be | ||
| 78 | used only when backward compatibility is required. | ||
| 79 | .Sh RETURN VALUES | ||
| 80 | .Fn SHA1 | ||
| 81 | returns a pointer to the hash value. | ||
| 82 | .Pp | ||
| 83 | .Fn SHA1_Init , | ||
| 84 | .Fn SHA1_Update , | ||
| 85 | and | ||
| 86 | .Fn SHA1_Final | ||
| 87 | return 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 | ||
| 93 | SHA: US Federal Information Processing Standard FIPS PUB 180 (Secure | ||
| 94 | Hash Standard), SHA-1: US Federal Information Processing Standard FIPS | ||
| 95 | PUB 180-1 (Secure Hash Standard), ANSI X9.30 | ||
| 96 | .Sh HISTORY | ||
| 97 | .Fn SHA1 , | ||
| 98 | .Fn SHA1_Init , | ||
| 99 | .Fn SHA1_Update , | ||
| 100 | and | ||
| 101 | .Fn SHA1_Final | ||
| 102 | are available in all versions of SSLeay and OpenSSL. | ||
