s/qmail 4.3.20
Next generation secure email transport
Loading...
Searching...
No Matches
sha1.h
Go to the documentation of this file.
1#ifndef SHA1_H
2#define SHA1_H
3
4/*
5 SHA-1 in C
6 By Steve Reid <steve@edmweb.com>
7 100% Public Domain
8
9 adopted for s/qmail (feh)
10 */
11
12#include <stdint.h>
13/* SHA1 implementation */
14
15#define SHA1_BLOCKSIZE 64
16#define SHA1_DIGESTSIZE 20
17
18typedef struct
19{
20 uint32_t state[5];
21 uint32_t count[2];
22 uint8_t buffer[SHA1_BLOCKSIZE];
23} sha1_ctx;
24
25void sha1_init(sha1_ctx *context);
26void sha1_update(sha1_ctx *context, const uint8_t *data, uint32_t len);
27void sha1_final(uint8_t hash[SHA1_DIGESTSIZE], sha1_ctx *context);
28void sha1_transform(uint32_t state[5], const uint8_t buffer[SHA1_BLOCKSIZE]);
29void sha1_hash(char *hash, const char *data, uint32_t len);
30
31#endif /* SHA1_H */
stralloc data
Definition: fastforward.c:118
stralloc hash
Definition: qmail-dksign.c:234
#define SHA1_BLOCKSIZE
Definition: sha1.h:15
void sha1_hash(char *hash, const char *data, uint32_t len)
Definition: sha1.c:177
void sha1_final(uint8_t hash[SHA1_DIGESTSIZE], sha1_ctx *context)
Definition: sha1.c:146
void sha1_init(sha1_ctx *context)
Definition: sha1.c:111
void sha1_transform(uint32_t state[5], const uint8_t buffer[SHA1_BLOCKSIZE])
Definition: sha1.c:47
#define SHA1_DIGESTSIZE
Definition: sha1.h:16
void sha1_update(sha1_ctx *context, const uint8_t *data, uint32_t len)
Definition: sha1.c:124
Definition: sha1.h:19