1sha(3)                              OpenSSL                             sha(3)
2
3
4

NAME

6       SHA1, SHA1_Init, SHA1_Update, SHA1_Final - Secure Hash Algorithm
7

SYNOPSIS

9        #include <openssl/sha.h>
10
11        unsigned char *SHA1(const unsigned char *d, unsigned long n,
12                         unsigned char *md);
13
14        int SHA1_Init(SHA_CTX *c);
15        int SHA1_Update(SHA_CTX *c, const void *data,
16                         unsigned long len);
17        int SHA1_Final(unsigned char *md, SHA_CTX *c);
18

DESCRIPTION

20       SHA-1 (Secure Hash Algorithm) is a cryptographic hash function with a
21       160 bit output.
22
23       SHA1() computes the SHA-1 message digest of the n bytes at d and places
24       it in md (which must have space for SHA_DIGEST_LENGTH == 20 bytes of
25       output). If md is NULL, the digest is placed in a static array.
26
27       The following functions may be used if the message is not completely
28       stored in memory:
29
30       SHA1_Init() initializes a SHA_CTX structure.
31
32       SHA1_Update() can be called repeatedly with chunks of the message to be
33       hashed (len bytes at data).
34
35       SHA1_Final() places the message digest in md, which must have space for
36       SHA_DIGEST_LENGTH == 20 bytes of output, and erases the SHA_CTX.
37
38       Applications should use the higher level functions EVP_DigestInit(3)
39       etc. instead of calling the hash functions directly.
40
41       The predecessor of SHA-1, SHA, is also implemented, but it should be
42       used only when backward compatibility is required.
43

RETURN VALUES

45       SHA1() returns a pointer to the hash value.
46
47       SHA1_Init(), SHA1_Update() and SHA1_Final() return 1 for success, 0
48       otherwise.
49

CONFORMING TO

51       SHA: US Federal Information Processing Standard FIPS PUB 180 (Secure
52       Hash Standard), SHA-1: US Federal Information Processing Standard FIPS
53       PUB 180-1 (Secure Hash Standard), ANSI X9.30
54

SEE ALSO

56       ripemd(3), hmac(3), EVP_DigestInit(3)
57

HISTORY

59       SHA1(), SHA1_Init(), SHA1_Update() and SHA1_Final() are available in
60       all versions of SSLeay and OpenSSL.
61
62
63
641.0.1e                            2013-02-11                            sha(3)
Impressum