1 #ifndef _SHA512_H
2 #define _SHA512_H
3 
4 #define SHA384_SUM_LEN          48
5 #define SHA384_DER_LEN          19
6 #define SHA512_SUM_LEN          64
7 #define SHA512_DER_LEN          19
8 #define SHA512_BLOCK_SIZE       128
9 
10 #define CHUNKSZ_SHA384	(16 * 1024)
11 #define CHUNKSZ_SHA512	(16 * 1024)
12 
13 typedef struct {
14 	uint64_t state[SHA512_SUM_LEN / 8];
15 	uint64_t count[2];
16 	uint8_t buf[SHA512_BLOCK_SIZE];
17 } sha512_context;
18 
19 extern const uint8_t sha512_der_prefix[];
20 
21 void sha512_starts(sha512_context * ctx);
22 void sha512_update(sha512_context *ctx, const uint8_t *input, uint32_t length);
23 void sha512_finish(sha512_context * ctx, uint8_t digest[SHA512_SUM_LEN]);
24 
25 void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
26 		unsigned char *output, unsigned int chunk_sz);
27 
28 extern const uint8_t sha384_der_prefix[];
29 
30 void sha384_starts(sha512_context * ctx);
31 void sha384_update(sha512_context *ctx, const uint8_t *input, uint32_t length);
32 void sha384_finish(sha512_context * ctx, uint8_t digest[SHA384_SUM_LEN]);
33 
34 void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
35 		unsigned char *output, unsigned int chunk_sz);
36 
37 
38 #endif /* _SHA512_H */
39