]> jfr.im git - irc/quakenet/newserv.git/blob - lib/hmac.h
A4STATS: remove E style escapes and switch to createtable for indices
[irc/quakenet/newserv.git] / lib / hmac.h
1 #include "sha2.h"
2 #include "sha1.h"
3 #include "md5.h"
4
5 typedef struct {
6 SHA256_CTX outer, inner;
7 } hmacsha256;
8
9 typedef struct {
10 SHA1_CTX outer, inner;
11 } hmacsha1;
12
13 typedef struct {
14 MD5Context outer, inner;
15 } hmacmd5;
16
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
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
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
29 char *hmac_printhex(unsigned char *data, char *out, size_t len);
30
31 int hmac_strcmp(const char *a, const char *b);