bglibs: sha1.h Source File

bglibs

sha1.h
1 /*
2 SHA-1 in C
3
4 By Steve Reid <steve@edmweb.com>, with small changes to make it
5 fit by Bruce Guenter <bruce@untroubled.org>
6
7 */
8
9 #ifndef _SHA1_H
10 # define _SHA1_H
11
12 #include "sysdeps.h"
13
14 #define SHA1_DIGEST_LENGTH 20
15 #define SHA1_BLOCK_LENGTH 64
16
17 typedef struct {
18 uint32 state[5];
19 uint64 bytes;
20 unsigned char buffer[SHA1_BLOCK_LENGTH];
21 } SHA1_CTX;
22
23 void SHA1Transform(uint32 state[5], const unsigned char buffer[SHA1_BLOCK_LENGTH]);
24 void SHA1Init(SHA1_CTX* context);
25 void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32 len);
26 void SHA1Final(SHA1_CTX* context, unsigned char digest[SHA1_DIGEST_LENGTH]);
27
28 # define SHA1_Transform SHA1Transform
29 # define SHA1_Init SHA1Init
30 # define SHA1_Update SHA1Update
31 # define SHA1_Final SHA1Final
32
33 #endif
SHA1_CTX
Definition: sha1.h:17