-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathhmac_drbg_tests.h
59 lines (52 loc) · 1.62 KB
/
hmac_drbg_tests.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright (C) 2022 - This file is part of libdrbg project
*
* Author: Ryad BENADJILA <[email protected]>
* Contributor: Arnaud EBALARD <[email protected]>
*
* This software is licensed under a dual BSD and GPL v2 license.
* See LICENSE file at the root folder of the project.
*/
#ifndef __HMAC_DRBG_TESTS_H__
#define __HMAC_DRBG_TESTS_H__
#ifdef WITH_HMAC_DRBG
#include "hmac_drbg.h"
typedef enum {
HMAC_INSTANTIATE = 0,
HMAC_RESEED_EXPLICIT = 1,
HMAC_RESEED_PR = 2,
HMAC_GENERATE = 3
} hmac_dbrg_self_test_op;
typedef struct {
hmac_dbrg_self_test_op op;
const char *EntropyInput;
uint32_t EntropyInputLen;
const char *Nonce;
uint32_t NonceLen;
const char *PersonalizationString;
uint32_t PersonalizationStringLen;
const char *AdditionalInput;
uint32_t AdditionalInputLen;
const char *EntropyInputPR;
uint32_t EntropyInputPRLen;
const char *EntropyInputReseed;
uint32_t EntropyInputReseedLen;
const char *AdditionalInputReseed;
uint32_t AdditionalInputReseedLen;
/* Expected out */
const char *V;
const char *K;
uint32_t outlen;
const char *out;
} hmac_dbrg_self_test_expected;
typedef struct {
const char *name;
hash_alg_type hash;
bool prediction_resistance;
unsigned int num_gen;
const hmac_dbrg_self_test_expected *Expected;
} hmac_dbrg_self_test;
#include <stdio.h>
int do_hmac_dbrg_self_tests(const hmac_dbrg_self_test *all_tests[], unsigned int num_tests);
#endif
#endif /* __HMAC_DRBG_TESTS_H__ */