]>
Commit | Line | Data |
---|---|---|
893267ed | 1 | #include "sha2.h" |
99b7462a | 2 | #include "sha1.h" |
e0294183 | 3 | #include "md5.h" |
893267ed CP |
4 | |
5 | typedef struct { | |
6 | SHA256_CTX outer, inner; | |
7 | } hmacsha256; | |
8 | ||
99b7462a CP |
9 | typedef struct { |
10 | SHA1_CTX outer, inner; | |
11 | } hmacsha1; | |
12 | ||
e0294183 CP |
13 | typedef struct { |
14 | MD5Context outer, inner; | |
15 | } hmacmd5; | |
16 | ||
893267ed CP |
17 | void hmacsha256_final(hmacsha256 *c, unsigned char *digest); |
18 | void hmacsha256_update(hmacsha256 *c, unsigned char *message, int messagelen); | |
19 | void hmacsha256_init(hmacsha256 *c, unsigned char *key, int keylen); | |
20 | ||
99b7462a CP |
21 | void hmacsha1_final(hmacsha1 *c, unsigned char *digest); |
22 | void hmacsha1_update(hmacsha1 *c, unsigned char *message, int messagelen); | |
23 | void hmacsha1_init(hmacsha1 *c, unsigned char *key, int keylen); | |
24 | ||
e0294183 CP |
25 | void hmacmd5_final(hmacmd5 *c, unsigned char *digest); |
26 | void hmacmd5_update(hmacmd5 *c, unsigned char *message, int messagelen); | |
27 | void hmacmd5_init(hmacmd5 *c, unsigned char *key, int keylen); | |
28 | ||
99b7462a | 29 | char *hmac_printhex(unsigned char *data, char *out, size_t len); |
0bd91417 CP |
30 | |
31 | int hmac_strcmp(char *a, char *b); |