LP-89 - Port OP_15.05.01 fixes. Release notes:
[librepilot.git] / flight / libraries / inc / sha1.h
blobfbf18b137daf63d28c4d115e6f233619c4e06c0f
1 /* $NetBSD: sha1.h,v 1.14 2009/11/06 20:31:19 joerg Exp $ */
3 /*
4 * SHA-1 in C
5 * By Steve Reid <steve@edmweb.com>
6 * 100% Public Domain
7 */
9 #ifndef _SYS_SHA1_H_
10 #define _SYS_SHA1_H_
12 #include <sys/cdefs.h>
13 #include <sys/types.h>
15 #define SHA1_DIGEST_LENGTH 20
16 #define SHA1_DIGEST_STRING_LENGTH 41
18 typedef struct {
19 uint32_t state[5];
20 uint32_t count[2];
21 uint8_t buffer[64];
22 } SHA1_CTX;
24 __BEGIN_DECLS
25 void SHA1Transform(uint32_t[5], const uint8_t[64]);
26 void SHA1Init(SHA1_CTX *);
27 void SHA1Update(SHA1_CTX *, const uint8_t *, unsigned int);
28 void SHA1Final(uint8_t[SHA1_DIGEST_LENGTH], SHA1_CTX *);
29 #ifndef _KERNEL
30 char *SHA1End(SHA1_CTX *, char *);
31 char *SHA1FileChunk(const char *, char *, off_t, off_t);
32 char *SHA1File(const char *, char *);
33 char *SHA1Data(const uint8_t *, size_t, char *);
34 #endif /* _KERNEL */
35 __END_DECLS
37 #endif /* _SYS_SHA1_H_ */