Annotation of src/include/sha1.h, Revision 1.10
1.10 ! millert 1: /* $OpenBSD: sha1.h,v 1.9 1999/02/03 03:13:18 angelos Exp $ */
1.5 millert 2:
3: /*
4: * SHA-1 in C
5: * By Steve Reid <steve@edmweb.com>
6: * 100% Public Domain
7: */
1.1 millert 8:
1.2 millert 9: #ifndef _SHA1_H
10: #define _SHA1_H
11:
1.1 millert 12: typedef struct {
1.5 millert 13: u_int32_t state[5];
14: u_int32_t count[2];
15: u_char buffer[64];
16: } SHA1_CTX;
17:
1.10 ! millert 18: void SHA1Transform(u_int32_t state[5], const u_char buffer[64]);
! 19: void SHA1Init(SHA1_CTX *context);
! 20: void SHA1Update(SHA1_CTX *context, const u_char *data, u_int len);
! 21: void SHA1Final(u_char digest[20], SHA1_CTX *context);
! 22: char *SHA1End(SHA1_CTX *, char *);
! 23: char *SHA1File(char *, char *);
! 24: char *SHA1Data(const u_char *, size_t, char *);
1.9 angelos 25:
26: #define SHA1_DIGESTSIZE 20
27: #define SHA1_BLOCKSIZE 64
28: #define HTONDIGEST(x) { \
29: x[0] = htonl(x[0]); \
30: x[1] = htonl(x[1]); \
31: x[2] = htonl(x[2]); \
32: x[3] = htonl(x[3]); \
33: x[4] = htonl(x[4]); }
34:
35: #define NTOHDIGEST(x) { \
36: x[0] = ntohl(x[0]); \
37: x[1] = ntohl(x[1]); \
38: x[2] = ntohl(x[2]); \
39: x[3] = ntohl(x[3]); \
40: x[4] = ntohl(x[4]); }
1.2 millert 41:
42: #endif /* _SHA1_H */