forked from ArgosyLabs/hmac_blake2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
hmac_blake2b.h
36 lines (28 loc) · 993 Bytes
/
hmac_blake2b.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* Author: Derrick Pallas, Argosy Labs
* https://github.com/ArgosyLabs/hmac-blake2
*
* The contents of this file is free and unencumbered software released into the
* public domain. For more information, please refer to <http://unlicense.org/>
*/
#ifndef HMAC_BLAKE2B_H
#define HMAC_BLAKE2B_H
#include <blake2.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef uint8_t hmac_blake2b_t[BLAKE2B_OUTBYTES];
typedef struct {
uint64_t pad[BLAKE2B_BLOCKBYTES/sizeof(uint64_t)];
blake2b_state state;
} hmac_blake2b_state;
void hmac_blake2b_init(hmac_blake2b_state *state, const uint8_t *key, size_t key_size);
void hmac_blake2b_update(hmac_blake2b_state *state, const uint8_t *message, size_t message_size);
void hmac_blake2b_final(hmac_blake2b_state *state, hmac_blake2b_t hmac);
void hmac_blake2b(hmac_blake2b_t hmac,
const uint8_t *key, size_t key_size,
const uint8_t *message, size_t message_size);
#ifdef __cplusplus
}
#endif
#endif//HMAC_BLAKE2B_H