5 * This is the header file for code which implements the Secure
6 * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
9 * Many of the variable names in this code, especially the
10 * single character names, were used because those were the names
11 * used in the publication.
13 * Please read the file sha1.c for more information.
22 * If you do not have the ISO standard stdint.h header file, then you
23 * must typdef the following:
25 * uint32_t unsigned 32 bit integer
26 * uint8_t unsigned 8 bit integer (i.e., unsigned char)
27 * int_least16_t integer of >= 16 bits
35 shaNull, /* Null pointer parameter */
36 shaInputTooLong, /* input data too long */
37 shaStateError /* called Input after Result */
40 #define SHA1HashSize 20
43 * This structure will hold context information for the SHA-1
46 typedef struct SHA1Context {
47 uint32_t Intermediate_Hash[SHA1HashSize / 4]; /* Message Digest */
49 uint32_t Length_Low; /* Message length in bits */
50 uint32_t Length_High; /* Message length in bits */
52 /* Index into message block array */
53 int_least16_t Message_Block_Index;
54 uint8_t Message_Block[64]; /* 512-bit message blocks */
56 int Computed; /* Is the digest computed? */
57 int Corrupted; /* Is the message digest corrupted? */
64 int SHA1Reset(SHA1Context *);
65 int SHA1Input(SHA1Context *, const uint8_t *, unsigned int);
66 int SHA1Result(SHA1Context *, uint8_t Message_Digest[SHA1HashSize]);