libdrizzle Developer Documentation

sha1.h
Go to the documentation of this file.
1
6#ifndef _SHA1_H
7#define _SHA1_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
20#define SHA1_BLOCK_LENGTH 64
21#define SHA1_DIGEST_LENGTH 20
22#define SHA1_DIGEST_STRING_LENGTH (SHA1_DIGEST_LENGTH * 2 + 1)
23
24typedef struct {
25 uint32_t state[5];
26 uint64_t count;
27 uint8_t buffer[SHA1_BLOCK_LENGTH];
28} SHA1_CTX;
29
30void SHA1Init(SHA1_CTX *);
31void SHA1Pad(SHA1_CTX *);
32void SHA1Transform(uint32_t [5], const uint8_t [SHA1_BLOCK_LENGTH]);
33void SHA1Update(SHA1_CTX *, const uint8_t *, size_t);
34void SHA1Final(uint8_t [SHA1_DIGEST_LENGTH], SHA1_CTX *);
35
38#ifdef __cplusplus
39}
40#endif
41
42#endif /* _SHA1_H */
#define SHA1_BLOCK_LENGTH
Definition sha1.h:20
#define SHA1_DIGEST_LENGTH
Definition sha1.h:21
void SHA1Init(SHA1_CTX *)
Definition sha1.c:116
void SHA1Transform(uint32_t[5], const uint8_t[SHA1_BLOCK_LENGTH])
Definition sha1.c:59
void SHA1Final(uint8_t[SHA1_DIGEST_LENGTH], SHA1_CTX *)
Definition sha1.c:172
void SHA1Update(SHA1_CTX *, const uint8_t *, size_t)
Definition sha1.c:133
void SHA1Pad(SHA1_CTX *)
Definition sha1.c:156
uint64_t count
Definition sha1.h:26