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

Last change on this file since 37643 was 37643, checked in by kon, 7 weeks ago

use size_t for len (note out of step w/ -prim doc 4 now)

File size: 539 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, size_t len);
19static void     SHA1Final(SHA1_CTX *context, uint8_t digest[SHA1_DIGEST_LENGTH]);
Note: See TracBrowser for help on using the repository browser.