blob: 5efe2b132df19d2147cfc3871f2e5d954f90db02 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#ifndef HMAC_H
2#define HMAC_H
3
4typedef struct Hash_param {
5 void *hash_state;
6 int (*init)(void *hash_state);
7 int (*process)(void *hash_state, const unsigned char *in, unsigned int inlen);
8 int (*done)(void *hash_state, unsigned char *out);
9 unsigned int hashsize;
10 unsigned int blocksize;
11} hash_param;
12
13typedef struct Hmac_state {
14 hash_param *hash;
15 unsigned char *key;
16} hmac_state;
17
18int hmac_init(hmac_state *hmac, hash_param *hash, const unsigned char *key,
19 unsigned long keylen);
20int hmac_process(hmac_state *hmac, const unsigned char *in,
21 unsigned long inlen);
22int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen);
23
24#endif /* HMAC_H */