Radcli library 1.4.0
A simple radius library
Loading...
Searching...
No Matches
nettle-hmac.c
1
29#include <string.h> /* memset() */
30#include "rc-hmac.h"
31
32void hmac_md5_with_nettle(uint8_t *data, size_t data_len,
33 uint8_t *key, size_t key_len,
34 uint8_t digest[MD5_DIGEST_SIZE])
35{
36 struct hmac_md5_ctx md5;
37 memset(digest, 0, MD5_DIGEST_SIZE);
38 hmac_md5_set_key(&md5, key_len, key);
39 hmac_md5_update(&md5, data_len, data);
40 hmac_md5_digest(&md5, MD5_DIGEST_SIZE, digest);
41}
42