-
Notifications
You must be signed in to change notification settings - Fork 2
/
sb_hmac_sha256.h
39 lines (31 loc) · 1.09 KB
/
sb_hmac_sha256.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
37
38
39
/*
* sb_hmac_sha256.h: public API for HMAC-SHA-256
*
* This file is part of Sweet B, a safe, compact, embeddable elliptic curve
* cryptography library.
*
* Sweet B is provided under the terms of the included LICENSE file. All
* other rights are reserved.
*
* Copyright 2017 Wearable Inc.
*
*/
#ifndef SB_HMAC_SHA256_H
#define SB_HMAC_SHA256_H
#include "sb_sha256.h"
typedef struct sb_hmac_sha256_state_t {
sb_sha256_state_t sha;
sb_byte_t key[SB_SHA256_BLOCK_SIZE];
} sb_hmac_sha256_state_t;
extern void sb_hmac_sha256_init(sb_hmac_sha256_state_t hmac[static restrict 1],
const sb_byte_t* restrict key,
size_t keylen);
extern void sb_hmac_sha256_reinit(sb_hmac_sha256_state_t hmac[static 1]);
extern void
sb_hmac_sha256_update(sb_hmac_sha256_state_t hmac[static restrict 1],
const sb_byte_t* restrict input,
size_t len);
extern void
sb_hmac_sha256_finish(sb_hmac_sha256_state_t hmac[static restrict 1],
sb_byte_t output[static restrict SB_SHA256_SIZE]);
#endif