]> git.saurik.com Git - ldid.git/blame_incremental - sha1.h
Technically, I should have these two header files.
[ldid.git] / sha1.h
... / ...
CommitLineData
1/*\r
2 * sha1.h\r
3 *\r
4 * Description:\r
5 * This is the header file for code which implements the Secure\r
6 * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published\r
7 * April 17, 1995.\r
8 *\r
9 * Many of the variable names in this code, especially the\r
10 * single character names, were used because those were the names\r
11 * used in the publication.\r
12 *\r
13 * Please read the file sha1.c for more information.\r
14 *\r
15 */\r
16\r
17#ifndef _SHA1_H_\r
18#define _SHA1_H_\r
19\r
20#include <stdint.h>\r
21\r
22#ifndef _SHA_enum_\r
23#define _SHA_enum_\r
24enum\r
25{\r
26 shaSuccess = 0,\r
27 shaNull, /* Null pointer parameter */\r
28 shaInputTooLong, /* input data too long */\r
29 shaStateError /* called Input after Result */\r
30};\r
31#endif\r
32#define SHA1HashSize 20\r
33\r
34/*\r
35 * This structure will hold context information for the SHA-1\r
36 * hashing operation\r
37 */\r
38typedef struct SHA1Context\r
39{\r
40 uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */\r
41\r
42 uint32_t Length_Low; /* Message length in bits */\r
43 uint32_t Length_High; /* Message length in bits */\r
44\r
45 /* Index into message block array */\r
46 int_least16_t Message_Block_Index;\r
47 uint8_t Message_Block[64]; /* 512-bit message blocks */\r
48\r
49 int Computed; /* Is the digest computed? */\r
50 int Corrupted; /* Is the message digest corrupted? */\r
51} SHA1Context;\r
52\r
53/*\r
54 * Function Prototypes\r
55 */\r
56\r
57int SHA1Reset( SHA1Context *);\r
58int SHA1Input( SHA1Context *,\r
59 const uint8_t *,\r
60 unsigned int);\r
61int SHA1Result( SHA1Context *,\r
62 uint8_t Message_Digest[SHA1HashSize]);\r
63\r
64#endif\r