Secure memory fixes
[openssl.git] / include / openssl / whrlpool.h
1 #ifndef HEADER_WHRLPOOL_H
2 # define HEADER_WHRLPOOL_H
3
4 #include <openssl/opensslconf.h>
5
6 # ifndef OPENSSL_NO_WHIRLPOOL
7 # include <openssl/e_os2.h>
8 # include <stddef.h>
9 # ifdef __cplusplus
10 extern "C" {
11 # endif
12
13 # define WHIRLPOOL_DIGEST_LENGTH (512/8)
14 # define WHIRLPOOL_BBLOCK        512
15 # define WHIRLPOOL_COUNTER       (256/8)
16
17 typedef struct {
18     union {
19         unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
20         /* double q is here to ensure 64-bit alignment */
21         double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
22     } H;
23     unsigned char data[WHIRLPOOL_BBLOCK / 8];
24     unsigned int bitoff;
25     size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
26 } WHIRLPOOL_CTX;
27
28 int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
29 int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes);
30 void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits);
31 int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
32 unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md);
33
34 # ifdef __cplusplus
35 }
36 # endif
37 # endif
38
39 #endif