hmac_sha256/hmac_sha256.h

30 lines
710 B
C
Raw Normal View History

2019-05-20 03:43:18 +00:00
/*
hmac_sha256.h
Originally written by https://github.com/h5p9sl
*/
#ifndef _HMAC_SHA256_H_
#define _HMAC_SHA256_H_
2019-07-05 02:27:00 +00:00
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
2019-05-20 03:43:18 +00:00
#include <stdint.h>
void hmac_sha256(
// [in]: The key and it's length. Should be at least 32 bytes long for optimal security.
const uint8_t* key, const unsigned keylen,
// [in]: The data to hash along with the key.
const uint8_t* data, const unsigned datalen,
// [out]: The output hash. Should be 32 bytes long, but if it's less than 32 bytes, the function will truncate the resulting hash.
uint8_t* out, const unsigned outlen
);
2019-07-05 02:27:00 +00:00
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // _HMAC_SHA256_H_
2019-05-20 03:43:18 +00:00