forked from ArgosyLabs/hmac_blake2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
hmac_blake2s.h
36 lines (28 loc) · 993 Bytes
/
hmac_blake2s.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_BLAKE2S_H
#define HMAC_BLAKE2S_H
#include <blake2.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef uint8_t hmac_blake2s_t[BLAKE2S_OUTBYTES];
typedef struct {
uint64_t pad[BLAKE2S_BLOCKBYTES/sizeof(uint64_t)];
blake2s_state state;
} hmac_blake2s_state;
void hmac_blake2s_init(hmac_blake2s_state *state, const uint8_t *key, size_t key_size);
void hmac_blake2s_update(hmac_blake2s_state *state, const uint8_t *message, size_t message_size);
void hmac_blake2s_final(hmac_blake2s_state *state, hmac_blake2s_t hmac);
void hmac_blake2s(hmac_blake2s_t hmac,
const uint8_t *key, size_t key_size,
const uint8_t *message, size_t message_size);
#ifdef __cplusplus
}
#endif
#endif//HMAC_BLAKE2S_H