diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2019-07-11 21:43:15 +0300 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2019-09-15 10:09:16 +0200 |
commit | 8a0a625358153724f9e3b8b9c73f4b2d1e8730c6 (patch) | |
tree | 11fa8c8a3328c000b68a3f356da9301396e8b80a /hmac.h | |
parent | ee2c0aa8dcdf40901a727c6a44dfa02c8c0039b0 (diff) | |
download | nettle-8a0a625358153724f9e3b8b9c73f4b2d1e8730c6.tar.gz |
Add HMAC functions for GOSTHASH94 and GOSTHASH94CP
GOST hash functions can be used to generate MAC using HMAC algorithm.
Add functions implementing HMAC with GOSTHASH94/GOSTHASH94CP.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'hmac.h')
-rw-r--r-- | hmac.h | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -36,6 +36,7 @@ #include "nettle-meta.h" +#include "gosthash94.h" #include "md5.h" #include "ripemd160.h" #include "sha1.h" @@ -68,6 +69,12 @@ extern "C" { #define hmac_sha512_set_key nettle_hmac_sha512_set_key #define hmac_sha512_update nettle_hmac_sha512_update #define hmac_sha512_digest nettle_hmac_sha512_digest +#define hmac_gosthash94_set_key nettle_hmac_gosthash94_set_key +#define hmac_gosthash94_update nettle_hmac_gosthash94_update +#define hmac_gosthash94_digest nettle_hmac_gosthash94_digest +#define hmac_gosthash94cp_set_key nettle_hmac_gosthash94cp_set_key +#define hmac_gosthash94cp_update nettle_hmac_gosthash94cp_update +#define hmac_gosthash94cp_digest nettle_hmac_gosthash94cp_digest void hmac_set_key(void *outer, void *inner, void *state, @@ -203,6 +210,36 @@ void hmac_sha384_digest(struct hmac_sha512_ctx *ctx, size_t length, uint8_t *digest); +/* hmac-gosthash94 */ +struct hmac_gosthash94_ctx HMAC_CTX(struct gosthash94_ctx); + +void +hmac_gosthash94_set_key(struct hmac_gosthash94_ctx *ctx, + size_t key_length, const uint8_t *key); + +void +hmac_gosthash94_update(struct hmac_gosthash94_ctx *ctx, + size_t length, const uint8_t *data); + + void +hmac_gosthash94_digest(struct hmac_gosthash94_ctx *ctx, + size_t length, uint8_t *digest); + +struct hmac_gosthash94cp_ctx HMAC_CTX(struct gosthash94cp_ctx); + +void +hmac_gosthash94cp_set_key(struct hmac_gosthash94cp_ctx *ctx, + size_t key_length, const uint8_t *key); + +void +hmac_gosthash94cp_update(struct hmac_gosthash94cp_ctx *ctx, + size_t length, const uint8_t *data); + +void +hmac_gosthash94cp_digest(struct hmac_gosthash94cp_ctx *ctx, + size_t length, uint8_t *digest); + + #ifdef __cplusplus } #endif |