diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-15 17:10:10 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-15 17:10:10 +0200 |
commit | c0e5d9280dd156631bd398463dbb6a65aff37d19 (patch) | |
tree | 6883a55241a95fa9a2314b8d6189d2aa492e888f /c/sha1/sha1.h | |
parent | a97a4077ddc33f2abd53a37540158d4448adf915 (diff) |
Implement SHA-1
Diffstat (limited to 'c/sha1/sha1.h')
-rw-r--r-- | c/sha1/sha1.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/c/sha1/sha1.h b/c/sha1/sha1.h new file mode 100644 index 0000000..a01d116 --- /dev/null +++ b/c/sha1/sha1.h @@ -0,0 +1,21 @@ +#ifndef SHA1_SHA1_H +#define SHA1_SHA1_H + +#include <stddef.h> +#include <stdint.h> + +#define SHA1DGSTSZ 20 +#define SHA1BLKSZ 64 + +typedef struct { + uint32_t dgst[5]; + uint64_t msgsz; + uint8_t buf[64]; + size_t bufsz; +} sha1_t; + +void sha1init(sha1_t *); +int sha1hash(sha1_t *, const uint8_t *, size_t); +void sha1end(sha1_t *, uint8_t[SHA1DGSTSZ]); + +#endif /* !SHA1_SHA1_H */ |