ltsha*.c: exit with error when *_Final fails
[otpcli.git] / lt / lt512.h
blob5a268e66235c398010942123cfe74c7a3ecb9905
1 /* License: public domain -or- http://www.wtfpl.net/txt/copying/ */
3 #ifndef LT512_H
4 #define LT512_H
6 #include <stddef.h>
7 #include <stdint.h>
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
13 #define SHA512_DIGEST_LENGTH 64
15 typedef struct SHA512_CTX {
16 uint64_t length;
17 uint64_t state[8], curlen;
18 unsigned char buf[128];
19 /*const void *data; */
20 } SHA512_CTX;
22 /* return value is non-zero/non-NULL on success */
23 extern int SHA512_Init(SHA512_CTX *c);
24 extern int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
25 extern int SHA512_Final(unsigned char *md, SHA512_CTX *c);
26 extern unsigned char *SHA512(const void *data, size_t len, unsigned char *md);
28 #ifdef __cplusplus
30 #endif
32 #endif /* LT512_H */