]> git.ipfire.org Git - thirdparty/util-linux.git/blob - include/sha1.h
include: add DragonFlyBSD GPT partition types
[thirdparty/util-linux.git] / include / sha1.h
1 /*
2 * No copyright is claimed. This code is in the public domain; do with
3 * it what you wish.
4 */
5 #ifndef UTIL_LINUX_SHA1_H
6 #define UTIL_LINUX_SHA1_H
7
8 /*
9 SHA-1 in C
10 By Steve Reid <steve@edmweb.com>
11 100% Public Domain
12 */
13
14 #include "stdint.h"
15
16 #define UL_SHA1LENGTH 20
17
18 typedef struct
19 {
20 uint32_t state[5];
21 uint32_t count[2];
22 unsigned char buffer[64];
23 } UL_SHA1_CTX;
24
25 void ul_SHA1Transform(uint32_t state[5], const unsigned char buffer[64]);
26 void ul_SHA1Init(UL_SHA1_CTX *context);
27 void ul_SHA1Update(UL_SHA1_CTX *context, const unsigned char *data, uint32_t len);
28 void ul_SHA1Final(unsigned char digest[UL_SHA1LENGTH], UL_SHA1_CTX *context);
29 void ul_SHA1(char *hash_out, const char *str, unsigned len);
30
31 #endif /* UTIL_LINUX_SHA1_H */