1 /* $MirOS: src/include/suma.h,v 1.2 2013/10/31 20:06:09 tg Exp $ */
2 
3 #ifndef _SUMA_H
4 #define _SUMA_H
5 
6 #define SUMA_DIGEST_LENGTH		4
7 #define SUMA_DIGEST_STRING_LENGTH	(SUMA_DIGEST_LENGTH * 2 + 1)
8 
9 typedef uint32_t SUMA_CTX;
10 
11 #define SUMA_DIGEST_UPPERCASE
12 
13 #include <sys/cdefs.h>
14 
15 __BEGIN_DECLS
16 void SUMAInit(SUMA_CTX *);
17 void SUMAPad(SUMA_CTX *);
18 void SUMAUpdate(SUMA_CTX *, const uint8_t *, size_t)
19 	__attribute__((__bounded__(__string__, 2, 3)));
20 void SUMAFinal(uint8_t *, SUMA_CTX *)
21 	__attribute__((__bounded__(__minbytes__, 1, SUMA_DIGEST_LENGTH)));
22 char *SUMAEnd(SUMA_CTX *, char *)
23 	__attribute__((__bounded__(__minbytes__, 2, SUMA_DIGEST_STRING_LENGTH)));
24 char *SUMAFile(const char *, char *)
25 	__attribute__((__bounded__(__minbytes__, 2, SUMA_DIGEST_STRING_LENGTH)));
26 char *SUMAFileChunk(const char *, char *, off_t, off_t)
27 	__attribute__((__bounded__(__minbytes__, 2, SUMA_DIGEST_STRING_LENGTH)));
28 char *SUMAData(const uint8_t *, size_t, char *)
29 	__attribute__((__bounded__(__string__, 1, 2)))
30 	__attribute__((__bounded__(__minbytes__, 3, SUMA_DIGEST_STRING_LENGTH)));
31 __END_DECLS
32 
33 #endif
34