]> jfr.im git - irc/quakenet/newserv.git/blame - lib/hmac.h
BUILD: add require-all build mode
[irc/quakenet/newserv.git] / lib / hmac.h
CommitLineData
893267ed 1#include "sha2.h"
99b7462a 2#include "sha1.h"
e0294183 3#include "md5.h"
893267ed
CP
4
5typedef struct {
6 SHA256_CTX outer, inner;
7} hmacsha256;
8
99b7462a
CP
9typedef struct {
10 SHA1_CTX outer, inner;
11} hmacsha1;
12
e0294183
CP
13typedef struct {
14 MD5Context outer, inner;
15} hmacmd5;
16
893267ed
CP
17void hmacsha256_final(hmacsha256 *c, unsigned char *digest);
18void hmacsha256_update(hmacsha256 *c, unsigned char *message, int messagelen);
19void hmacsha256_init(hmacsha256 *c, unsigned char *key, int keylen);
20
99b7462a
CP
21void hmacsha1_final(hmacsha1 *c, unsigned char *digest);
22void hmacsha1_update(hmacsha1 *c, unsigned char *message, int messagelen);
23void hmacsha1_init(hmacsha1 *c, unsigned char *key, int keylen);
24
e0294183
CP
25void hmacmd5_final(hmacmd5 *c, unsigned char *digest);
26void hmacmd5_update(hmacmd5 *c, unsigned char *message, int messagelen);
27void hmacmd5_init(hmacmd5 *c, unsigned char *key, int keylen);
28
99b7462a 29char *hmac_printhex(unsigned char *data, char *out, size_t len);
0bd91417 30
acf8ed68 31int hmac_strcmp(const char *a, const char *b);