source: project/release/5/sha1/trunk/sha1.h @ 37641

Last change on this file since 37641 was 37641, checked in by Kon Lovett, 4 months ago

update len is not size_t but uint32, test not unsafe

File size: 541 bytes
Line 
1/*
2 * SHA-1 in C
3 * By Steve Reid <steve@edmweb.com>
4 * 100% Public Domain
5 */
6
7#define SHA1_BLOCK_LENGTH       64
8#define SHA1_DIGEST_LENGTH      20
9
10typedef struct {
11        uint32_t state[5];
12        uint32_t count[2];
13        uint8_t buffer[SHA1_BLOCK_LENGTH];
14} SHA1_CTX;
15
16static void     SHA1Transform(uint32_t state[5], const uint8_t buffer[SHA1_BLOCK_LENGTH]);
17static void     SHA1Init(SHA1_CTX *context);
18static void     SHA1Update(SHA1_CTX *context, const uint8_t *data, uint32_t len);
19static void     SHA1Final(SHA1_CTX *context, uint8_t digest[SHA1_DIGEST_LENGTH]);
Note: See TracBrowser for help on using the repository browser.