xref: /freebsd/crypto/libecc/src/tests/bign_test_vectors.h (revision f0865ec9906d5a18fa2a3b61381f22ce16e606ad)
1*f0865ec9SKyle Evans /*
2*f0865ec9SKyle Evans  *  Copyright (C) 2022 - This file is part of libecc project
3*f0865ec9SKyle Evans  *
4*f0865ec9SKyle Evans  *  Authors:
5*f0865ec9SKyle Evans  *      Arnaud EBALARD <arnaud.ebalard@ssi.gouv.fr>
6*f0865ec9SKyle Evans  *      Ryad BENADJILA <ryadbenadjila@gmail.com>
7*f0865ec9SKyle Evans  *
8*f0865ec9SKyle Evans  *  This software is licensed under a dual BSD and GPL v2 license.
9*f0865ec9SKyle Evans  *  See LICENSE file at the root folder of the project.
10*f0865ec9SKyle Evans  */
11*f0865ec9SKyle Evans #ifndef __BIGN_TEST_VECTORS_H__
12*f0865ec9SKyle Evans #define __BIGN_TEST_VECTORS_H__
13*f0865ec9SKyle Evans 
14*f0865ec9SKyle Evans #if defined(WITH_HASH_BELT_HASH) && defined(WITH_CURVE_BIGN256V1)
15*f0865ec9SKyle Evans /************************************************/
16*f0865ec9SKyle Evans static const u8 bign_1_test_vectors_priv_key[] = {
17*f0865ec9SKyle Evans 	0x69, 0xe2, 0x73, 0xc2, 0x5f, 0x23, 0x79, 0x0c, 0x9e, 0x42, 0x32, 0x07, 0xed, 0x1f, 0x28, 0x34, 0x18, 0xf2, 0x74, 0x9c, 0x32, 0xf0, 0x33, 0x45, 0x67, 0x39, 0x73, 0x4b, 0xb8, 0xb5, 0x66, 0x1f,
18*f0865ec9SKyle Evans  };
19*f0865ec9SKyle Evans static const u8 bign_1_test_vectors_expected_sig[] = {
20*f0865ec9SKyle Evans 	0xE3, 0x6B, 0x7F, 0x03, 0x77, 0xAE, 0x4C, 0x52, 0x40, 0x27, 0xC3, 0x87, 0xFA, 0xDF, 0x1B, 0x20, 0xCE, 0x72, 0xF1, 0x53, 0x0B, 0x71, 0xF2, 0xB5, 0xFD, 0x3A, 0x8C, 0x58, 0x4F, 0xE2, 0xE1, 0xAE, 0xD2, 0x00, 0x82, 0xE3, 0x0C, 0x8A, 0xF6, 0x50, 0x11, 0xF4, 0xFB, 0x54, 0x64, 0x9D, 0xFD, 0x3D,
21*f0865ec9SKyle Evans  };
bign_1_nn_random_belt_hash_test_vector(nn_t out,nn_src_t q)22*f0865ec9SKyle Evans static int bign_1_nn_random_belt_hash_test_vector(nn_t out, nn_src_t q)
23*f0865ec9SKyle Evans {
24*f0865ec9SKyle Evans         int ret, cmp;
25*f0865ec9SKyle Evans 
26*f0865ec9SKyle Evans         /*
27*f0865ec9SKyle Evans          * Fixed ephemeral private key for bign signature
28*f0865ec9SKyle Evans          * test vectors from STB 34.101.45-2013
29*f0865ec9SKyle Evans          */
30*f0865ec9SKyle Evans         const u8 k_buf[] = {
31*f0865ec9SKyle Evans 		0xd2, 0xb7, 0x08, 0xa3, 0x7a, 0xa7, 0x33, 0x5c, 0xe1, 0x1c, 0x46, 0x3c, 0x48, 0xec, 0xd6, 0x3e, 0x2c, 0x74, 0xfa, 0xe0, 0xe7, 0x3d, 0xf2, 0x21, 0xad, 0x11, 0x58, 0xcd, 0xb2, 0x74, 0x0e, 0x4c,
32*f0865ec9SKyle Evans         };
33*f0865ec9SKyle Evans 
34*f0865ec9SKyle Evans         ret = nn_init_from_buf(out, k_buf, sizeof(k_buf)); EG(ret, err);
35*f0865ec9SKyle Evans         ret = nn_cmp(out, q, &cmp); EG(ret, err);
36*f0865ec9SKyle Evans 
37*f0865ec9SKyle Evans         ret = (cmp >= 0) ? -1 : 0;
38*f0865ec9SKyle Evans 
39*f0865ec9SKyle Evans err:
40*f0865ec9SKyle Evans         return ret;
41*f0865ec9SKyle Evans }
42*f0865ec9SKyle Evans static const u8 bign_1_test_vectors_adata[] = {
43*f0865ec9SKyle Evans 	0x00, 0x0b, 0x00, 0x00,
44*f0865ec9SKyle Evans 	0x06, 0x09, 0x2A, 0x70, 0x00, 0x02, 0x00, 0x22, 0x65, 0x1F, 0x51,
45*f0865ec9SKyle Evans };
46*f0865ec9SKyle Evans 
47*f0865ec9SKyle Evans static const ec_test_case bign_1_test_case = {
48*f0865ec9SKyle Evans         .name = "BIGN-BELT-HASH/bign256v1 1",
49*f0865ec9SKyle Evans         .ec_str_p = &bign256v1_str_params,
50*f0865ec9SKyle Evans         .priv_key = bign_1_test_vectors_priv_key,
51*f0865ec9SKyle Evans         .priv_key_len = sizeof(bign_1_test_vectors_priv_key),
52*f0865ec9SKyle Evans         .nn_random = bign_1_nn_random_belt_hash_test_vector,
53*f0865ec9SKyle Evans         .hash_type = BELT_HASH,
54*f0865ec9SKyle Evans         .msg = "\xB1\x94\xBA\xC8\x0A\x08\xF5\x3B\x36\x6D\x00\x8E\x58",
55*f0865ec9SKyle Evans         .msglen = 13,
56*f0865ec9SKyle Evans         .sig_type = BIGN,
57*f0865ec9SKyle Evans         .exp_sig = bign_1_test_vectors_expected_sig,
58*f0865ec9SKyle Evans         .exp_siglen = sizeof(bign_1_test_vectors_expected_sig),
59*f0865ec9SKyle Evans 	.adata = bign_1_test_vectors_adata,
60*f0865ec9SKyle Evans 	.adata_len = sizeof(bign_1_test_vectors_adata)
61*f0865ec9SKyle Evans };
62*f0865ec9SKyle Evans 
63*f0865ec9SKyle Evans /********************************************************************/
64*f0865ec9SKyle Evans static const u8 bign_2_test_vectors_priv_key[] = {
65*f0865ec9SKyle Evans 	0x69, 0xe2, 0x73, 0xc2, 0x5f, 0x23, 0x79, 0x0c, 0x9e, 0x42, 0x32, 0x07, 0xed, 0x1f, 0x28, 0x34, 0x18, 0xf2, 0x74, 0x9c, 0x32, 0xf0, 0x33, 0x45, 0x67, 0x39, 0x73, 0x4b, 0xb8, 0xb5, 0x66, 0x1f,
66*f0865ec9SKyle Evans  };
67*f0865ec9SKyle Evans static const u8 bign_2_test_vectors_expected_sig[] = {
68*f0865ec9SKyle Evans 	0x47, 0xA6, 0x3C, 0x8B, 0x9C, 0x93, 0x6E, 0x94, 0xB5, 0xFA, 0xB3, 0xD9, 0xCB, 0xD7, 0x83, 0x66,
69*f0865ec9SKyle Evans 	0x29, 0x0F, 0x32, 0x10, 0xE1, 0x63, 0xEE, 0xC8, 0xDB, 0x4E, 0x92, 0x1E, 0x84, 0x79, 0xD4, 0x13, 0x8F, 0x11, 0x2C, 0xC2, 0x3E, 0x6D, 0xCE, 0x65, 0xEC, 0x5F, 0xF2, 0x1D, 0xF4, 0x23, 0x1C, 0x28,
70*f0865ec9SKyle Evans  };
bign_2_nn_random_belt_hash_test_vector(nn_t out,nn_src_t q)71*f0865ec9SKyle Evans static int bign_2_nn_random_belt_hash_test_vector(nn_t out, nn_src_t q)
72*f0865ec9SKyle Evans {
73*f0865ec9SKyle Evans         int ret, cmp;
74*f0865ec9SKyle Evans 
75*f0865ec9SKyle Evans         /*
76*f0865ec9SKyle Evans          * Fixed ephemeral private key for bign signature
77*f0865ec9SKyle Evans          * test vectors from STB 34.101.45-2013
78*f0865ec9SKyle Evans 	 * NOTE: the ephemeral private key has been recomputed using the private key as
79*f0865ec9SKyle Evans 	 * it is not explicitly provided by the example.
80*f0865ec9SKyle Evans          */
81*f0865ec9SKyle Evans         const u8 k_buf[] = {
82*f0865ec9SKyle Evans 		0xec, 0xe9, 0xbc, 0x3b, 0xd9, 0x90, 0x03, 0x0f, 0x4f, 0x28, 0x39, 0x0d, 0xdd, 0x51, 0x22, 0x57, 0x15, 0x44, 0x7f, 0x63, 0x9f, 0x40, 0x19, 0x6f, 0xe4, 0x39, 0x08, 0xbe, 0x98, 0x82, 0x4e, 0x0a,
83*f0865ec9SKyle Evans         };
84*f0865ec9SKyle Evans 
85*f0865ec9SKyle Evans         ret = nn_init_from_buf(out, k_buf, sizeof(k_buf)); EG(ret, err);
86*f0865ec9SKyle Evans         ret = nn_cmp(out, q, &cmp); EG(ret, err);
87*f0865ec9SKyle Evans 
88*f0865ec9SKyle Evans         ret = (cmp >= 0) ? -1 : 0;
89*f0865ec9SKyle Evans 
90*f0865ec9SKyle Evans err:
91*f0865ec9SKyle Evans         return ret;
92*f0865ec9SKyle Evans }
93*f0865ec9SKyle Evans static const u8 bign_2_test_vectors_adata[] = {
94*f0865ec9SKyle Evans 	0x00, 0x0b, 0x00, 0x00,
95*f0865ec9SKyle Evans 	0x06, 0x09, 0x2A, 0x70, 0x00, 0x02, 0x00, 0x22, 0x65, 0x1F, 0x51,
96*f0865ec9SKyle Evans };
97*f0865ec9SKyle Evans 
98*f0865ec9SKyle Evans static const ec_test_case bign_2_test_case = {
99*f0865ec9SKyle Evans         .name = "BIGN-BELT-HASH/bign256v1 2",
100*f0865ec9SKyle Evans         .ec_str_p = &bign256v1_str_params,
101*f0865ec9SKyle Evans         .priv_key = bign_2_test_vectors_priv_key,
102*f0865ec9SKyle Evans         .priv_key_len = sizeof(bign_2_test_vectors_priv_key),
103*f0865ec9SKyle Evans         .nn_random = bign_2_nn_random_belt_hash_test_vector,
104*f0865ec9SKyle Evans         .hash_type = BELT_HASH,
105*f0865ec9SKyle Evans         .msg = "\xB1\x94\xBA\xC8\x0A\x08\xF5\x3B\x36\x6D\x00\x8E\x58\x4A\x5D\xE4\x85\x04\xFA\x9D\x1B\xB6\xC7\xAC\x25\x2E\x72\xC2\x02\xFD\xCE\x0D\x5B\xE3\xD6\x12\x17\xB9\x61\x81\xFE\x67\x86\xAD\x71\x6B\x89\x0B",
106*f0865ec9SKyle Evans         .msglen = 48,
107*f0865ec9SKyle Evans         .sig_type = BIGN,
108*f0865ec9SKyle Evans         .exp_sig = bign_2_test_vectors_expected_sig,
109*f0865ec9SKyle Evans         .exp_siglen = sizeof(bign_2_test_vectors_expected_sig),
110*f0865ec9SKyle Evans 	.adata = bign_2_test_vectors_adata,
111*f0865ec9SKyle Evans 	.adata_len = sizeof(bign_2_test_vectors_adata)
112*f0865ec9SKyle Evans };
113*f0865ec9SKyle Evans 
114*f0865ec9SKyle Evans /************************************************/
115*f0865ec9SKyle Evans static const u8 bign_3_test_vectors_priv_key[] = {
116*f0865ec9SKyle Evans 	0x69, 0xe2, 0x73, 0xc2, 0x5f, 0x23, 0x79, 0x0c, 0x9e, 0x42, 0x32, 0x07, 0xed, 0x1f, 0x28, 0x34, 0x18, 0xf2, 0x74, 0x9c, 0x32, 0xf0, 0x33, 0x45, 0x67, 0x39, 0x73, 0x4b, 0xb8, 0xb5, 0x66, 0x1f,
117*f0865ec9SKyle Evans  };
118*f0865ec9SKyle Evans static const u8 bign_3_test_vectors_expected_sig[] = {
119*f0865ec9SKyle Evans 	0x19, 0xD3, 0x2B, 0x7E, 0x01, 0xE2, 0x5B, 0xAE, 0x4A, 0x70, 0xEB, 0x6B, 0xCA, 0x42, 0x60, 0x2C,
120*f0865ec9SKyle Evans 	0xCA, 0x6A, 0x13, 0x94, 0x44, 0x51, 0xBC, 0xC5, 0xD4, 0xC5, 0x4C, 0xFD, 0x87, 0x37, 0x61, 0x9C, 0x32, 0x8B, 0x8A, 0x58, 0xFB, 0x9C, 0x68, 0xFD, 0x17, 0xD5, 0x69, 0xF7, 0xD0, 0x64, 0x95, 0xFB,
121*f0865ec9SKyle Evans  };
bign_3_nn_random_belt_hash_test_vector(nn_t out,nn_src_t q)122*f0865ec9SKyle Evans static int bign_3_nn_random_belt_hash_test_vector(nn_t out, nn_src_t q)
123*f0865ec9SKyle Evans {
124*f0865ec9SKyle Evans         int ret, cmp;
125*f0865ec9SKyle Evans 
126*f0865ec9SKyle Evans         /*
127*f0865ec9SKyle Evans          * Fixed ephemeral private key for bign signature
128*f0865ec9SKyle Evans          */
129*f0865ec9SKyle Evans         const u8 k_buf[] = {
130*f0865ec9SKyle Evans 		0x1e, 0x11, 0x97, 0xae, 0x17, 0xe4, 0x5c, 0xa4, 0xa1, 0xb6, 0xfa, 0x53, 0x95, 0x8c, 0xfd, 0x40, 0x64, 0x58, 0x04, 0x40, 0x1a, 0x47, 0xf2, 0xe1, 0xc4, 0xbb, 0x1d, 0x41, 0xd8, 0x14, 0x96, 0x82,
131*f0865ec9SKyle Evans         };
132*f0865ec9SKyle Evans 
133*f0865ec9SKyle Evans         ret = nn_init_from_buf(out, k_buf, sizeof(k_buf)); EG(ret, err);
134*f0865ec9SKyle Evans         ret = nn_cmp(out, q, &cmp); EG(ret, err);
135*f0865ec9SKyle Evans 
136*f0865ec9SKyle Evans         ret = (cmp >= 0) ? -1 : 0;
137*f0865ec9SKyle Evans 
138*f0865ec9SKyle Evans err:
139*f0865ec9SKyle Evans         return ret;
140*f0865ec9SKyle Evans }
141*f0865ec9SKyle Evans static const u8 bign_3_test_vectors_adata[] = {
142*f0865ec9SKyle Evans 	0x00, 0x0b, 0x00, 0x00,
143*f0865ec9SKyle Evans 	0x06, 0x09, 0x2A, 0x70, 0x00, 0x02, 0x00, 0x22, 0x65, 0x1F, 0x51,
144*f0865ec9SKyle Evans };
145*f0865ec9SKyle Evans 
146*f0865ec9SKyle Evans static const ec_test_case bign_3_test_case = {
147*f0865ec9SKyle Evans         .name = "BIGN-BELT-HASH/bign256v1 3",
148*f0865ec9SKyle Evans         .ec_str_p = &bign256v1_str_params,
149*f0865ec9SKyle Evans         .priv_key = bign_3_test_vectors_priv_key,
150*f0865ec9SKyle Evans         .priv_key_len = sizeof(bign_3_test_vectors_priv_key),
151*f0865ec9SKyle Evans         .nn_random = bign_3_nn_random_belt_hash_test_vector,
152*f0865ec9SKyle Evans         .hash_type = BELT_HASH,
153*f0865ec9SKyle Evans         .msg = "\xB1\x94\xBA\xC8\x0A\x08\xF5\x3B\x36\x6D\x00\x8E\x58",
154*f0865ec9SKyle Evans         .msglen = 13,
155*f0865ec9SKyle Evans         .sig_type = BIGN,
156*f0865ec9SKyle Evans         .exp_sig = bign_3_test_vectors_expected_sig,
157*f0865ec9SKyle Evans         .exp_siglen = sizeof(bign_3_test_vectors_expected_sig),
158*f0865ec9SKyle Evans 	.adata = bign_3_test_vectors_adata,
159*f0865ec9SKyle Evans 	.adata_len = sizeof(bign_3_test_vectors_adata)
160*f0865ec9SKyle Evans };
161*f0865ec9SKyle Evans 
162*f0865ec9SKyle Evans /********************************************************************/
163*f0865ec9SKyle Evans static const u8 bign_4_test_vectors_priv_key[] = {
164*f0865ec9SKyle Evans 	0x69, 0xe2, 0x73, 0xc2, 0x5f, 0x23, 0x79, 0x0c, 0x9e, 0x42, 0x32, 0x07, 0xed, 0x1f, 0x28, 0x34, 0x18, 0xf2, 0x74, 0x9c, 0x32, 0xf0, 0x33, 0x45, 0x67, 0x39, 0x73, 0x4b, 0xb8, 0xb5, 0x66, 0x1f,
165*f0865ec9SKyle Evans  };
166*f0865ec9SKyle Evans static const u8 bign_4_test_vectors_expected_sig[] = {
167*f0865ec9SKyle Evans 	0x47, 0xA6, 0x3C, 0x8B, 0x9C, 0x93, 0x6E, 0x94, 0xB5, 0xFA, 0xB3, 0xD9, 0xCB, 0xD7, 0x83, 0x66,
168*f0865ec9SKyle Evans 	0x29, 0x0F, 0x32, 0x10, 0xE1, 0x63, 0xEE, 0xC8, 0xDB, 0x4E, 0x92, 0x1E, 0x84, 0x79, 0xD4, 0x13, 0x8F, 0x11, 0x2C, 0xC2, 0x3E, 0x6D, 0xCE, 0x65, 0xEC, 0x5F, 0xF2, 0x1D, 0xF4, 0x23, 0x1C, 0x28,
169*f0865ec9SKyle Evans  };
bign_4_nn_random_belt_hash_test_vector(nn_t out,nn_src_t q)170*f0865ec9SKyle Evans static int bign_4_nn_random_belt_hash_test_vector(nn_t out, nn_src_t q)
171*f0865ec9SKyle Evans {
172*f0865ec9SKyle Evans         int ret, cmp;
173*f0865ec9SKyle Evans 
174*f0865ec9SKyle Evans         /*
175*f0865ec9SKyle Evans          * Fixed ephemeral private key for bign signature
176*f0865ec9SKyle Evans          * test vectors from STB 34.101.45-2013
177*f0865ec9SKyle Evans 	 * NOTE: the ephemeral private key has been recomputed using the private key as
178*f0865ec9SKyle Evans 	 * it is not explicitly provided by the example.
179*f0865ec9SKyle Evans          */
180*f0865ec9SKyle Evans         const u8 k_buf[] = {
181*f0865ec9SKyle Evans 		0xec, 0xe9, 0xbc, 0x3b, 0xd9, 0x90, 0x03, 0x0f, 0x4f, 0x28, 0x39, 0x0d, 0xdd, 0x51, 0x22, 0x57, 0x15, 0x44, 0x7f, 0x63, 0x9f, 0x40, 0x19, 0x6f, 0xe4, 0x39, 0x08, 0xbe, 0x98, 0x82, 0x4e, 0x0a,
182*f0865ec9SKyle Evans         };
183*f0865ec9SKyle Evans 
184*f0865ec9SKyle Evans         ret = nn_init_from_buf(out, k_buf, sizeof(k_buf)); EG(ret, err);
185*f0865ec9SKyle Evans         ret = nn_cmp(out, q, &cmp); EG(ret, err);
186*f0865ec9SKyle Evans 
187*f0865ec9SKyle Evans         ret = (cmp >= 0) ? -1 : 0;
188*f0865ec9SKyle Evans 
189*f0865ec9SKyle Evans err:
190*f0865ec9SKyle Evans         return ret;
191*f0865ec9SKyle Evans }
192*f0865ec9SKyle Evans static const u8 bign_4_test_vectors_adata[] = {
193*f0865ec9SKyle Evans 	0x00, 0x0b, 0x00, 0x00,
194*f0865ec9SKyle Evans 	0x06, 0x09, 0x2A, 0x70, 0x00, 0x02, 0x00, 0x22, 0x65, 0x1F, 0x51,
195*f0865ec9SKyle Evans };
196*f0865ec9SKyle Evans 
197*f0865ec9SKyle Evans static const ec_test_case bign_4_test_case = {
198*f0865ec9SKyle Evans         .name = "BIGN-BELT-HASH/bign256v1 4",
199*f0865ec9SKyle Evans         .ec_str_p = &bign256v1_str_params,
200*f0865ec9SKyle Evans         .priv_key = bign_4_test_vectors_priv_key,
201*f0865ec9SKyle Evans         .priv_key_len = sizeof(bign_4_test_vectors_priv_key),
202*f0865ec9SKyle Evans         .nn_random = bign_4_nn_random_belt_hash_test_vector,
203*f0865ec9SKyle Evans         .hash_type = BELT_HASH,
204*f0865ec9SKyle Evans         .msg = "\xB1\x94\xBA\xC8\x0A\x08\xF5\x3B\x36\x6D\x00\x8E\x58\x4A\x5D\xE4\x85\x04\xFA\x9D\x1B\xB6\xC7\xAC\x25\x2E\x72\xC2\x02\xFD\xCE\x0D\x5B\xE3\xD6\x12\x17\xB9\x61\x81\xFE\x67\x86\xAD\x71\x6B\x89\x0B",
205*f0865ec9SKyle Evans         .msglen = 48,
206*f0865ec9SKyle Evans         .sig_type = BIGN,
207*f0865ec9SKyle Evans         .exp_sig = bign_4_test_vectors_expected_sig,
208*f0865ec9SKyle Evans         .exp_siglen = sizeof(bign_4_test_vectors_expected_sig),
209*f0865ec9SKyle Evans 	.adata = bign_4_test_vectors_adata,
210*f0865ec9SKyle Evans 	.adata_len = sizeof(bign_4_test_vectors_adata)
211*f0865ec9SKyle Evans };
212*f0865ec9SKyle Evans #endif
213*f0865ec9SKyle Evans 
214*f0865ec9SKyle Evans #if defined(WITH_HASH_BASH384) && defined(WITH_CURVE_BIGN384V1)
215*f0865ec9SKyle Evans /********************************************************************/
216*f0865ec9SKyle Evans static const u8 bign_5_test_vectors_priv_key[] = {
217*f0865ec9SKyle Evans 	0x0e, 0xb5, 0x93, 0x2d, 0x23, 0x1a, 0xe1, 0x37, 0x61, 0x41, 0x80, 0xec, 0x3b, 0xbe, 0x08, 0x0f, 0x93, 0xba, 0x80, 0x27, 0x8f, 0x05, 0xd8, 0x2f, 0x87, 0x6a, 0xf9, 0xf9, 0xea, 0x0a, 0xf1, 0x9e, 0x6c, 0xa1, 0x6f, 0x21, 0x6c, 0x38, 0x21, 0xdc, 0x72, 0x23, 0x3c, 0x7b, 0xbf, 0x1d, 0xc2, 0x84,
218*f0865ec9SKyle Evans  };
219*f0865ec9SKyle Evans static const u8 bign_5_test_vectors_expected_sig[] = {
220*f0865ec9SKyle Evans 	0xA7, 0xFC, 0x9D, 0x62,  0xB6, 0x85, 0x9E, 0xBB,  0x0A, 0x98, 0xAA, 0xE3,  0x6B, 0xE4, 0x79, 0x69,
221*f0865ec9SKyle Evans 	0xC3, 0x62, 0xB6, 0x66,  0x95, 0x75, 0x0D, 0xDD,  0x2C, 0xA1, 0x75, 0x32,  0x18, 0x26, 0xD4, 0xBC,
222*f0865ec9SKyle Evans 	0x8F, 0x78, 0xEB, 0xF5,  0x55, 0xA8, 0x71, 0x21,  0x3F, 0xEC, 0x6B, 0x50,  0xA6, 0x3D, 0x30, 0xC5,
223*f0865ec9SKyle Evans 	0x89, 0x73, 0x3B, 0x0A,  0x56, 0xF6, 0xC0, 0xC2,  0xBC, 0x03, 0xA3, 0x53,  0x29, 0x69, 0xCD, 0xF0,
224*f0865ec9SKyle Evans 	0x11, 0xDC, 0x28, 0xD4,  0x84, 0x4E, 0x79, 0xEC,
225*f0865ec9SKyle Evans  };
bign_5_nn_random_belt_hash_test_vector(nn_t out,nn_src_t q)226*f0865ec9SKyle Evans static int bign_5_nn_random_belt_hash_test_vector(nn_t out, nn_src_t q)
227*f0865ec9SKyle Evans {
228*f0865ec9SKyle Evans         int ret, cmp;
229*f0865ec9SKyle Evans 
230*f0865ec9SKyle Evans         /*
231*f0865ec9SKyle Evans          * Fixed ephemeral private key for bign signature
232*f0865ec9SKyle Evans          */
233*f0865ec9SKyle Evans         const u8 k_buf[] = {
234*f0865ec9SKyle Evans 		0x15, 0xf4, 0x26, 0x4c, 0xa3, 0x51, 0x9a, 0xa6, 0x0a, 0xd8, 0xae, 0x14, 0x79, 0x31, 0x73,
235*f0865ec9SKyle Evans 		0x19, 0x80, 0xa8, 0xe1, 0xc3, 0x61, 0x0d, 0xa5, 0xdd, 0xa3, 0x17, 0xea, 0x54, 0xca, 0x73,
236*f0865ec9SKyle Evans 		0x3a, 0xa1, 0xe7, 0x1d, 0x1a, 0x5b, 0x0a, 0xc1, 0xae, 0x49, 0xbc, 0xd0, 0x90, 0x02, 0xc1,
237*f0865ec9SKyle Evans 		0x9d, 0x3c, 0x19,
238*f0865ec9SKyle Evans         };
239*f0865ec9SKyle Evans 
240*f0865ec9SKyle Evans         ret = nn_init_from_buf(out, k_buf, sizeof(k_buf)); EG(ret, err);
241*f0865ec9SKyle Evans         ret = nn_cmp(out, q, &cmp); EG(ret, err);
242*f0865ec9SKyle Evans 
243*f0865ec9SKyle Evans         ret = (cmp >= 0) ? -1 : 0;
244*f0865ec9SKyle Evans 
245*f0865ec9SKyle Evans err:
246*f0865ec9SKyle Evans         return ret;
247*f0865ec9SKyle Evans }
248*f0865ec9SKyle Evans static const u8 bign_5_test_vectors_adata[] = {
249*f0865ec9SKyle Evans 	0x00, 0x0b, 0x00, 0x00,
250*f0865ec9SKyle Evans 	0x06, 0x09, 0x2A, 0x70, 0x00, 0x02, 0x00, 0x22, 0x65, 0x4d, 0x0c,
251*f0865ec9SKyle Evans };
252*f0865ec9SKyle Evans 
253*f0865ec9SKyle Evans static const ec_test_case bign_5_test_case = {
254*f0865ec9SKyle Evans         .name = "BIGN-BASH384/bign384v1 5",
255*f0865ec9SKyle Evans         .ec_str_p = &bign384v1_str_params,
256*f0865ec9SKyle Evans         .priv_key = bign_5_test_vectors_priv_key,
257*f0865ec9SKyle Evans         .priv_key_len = sizeof(bign_5_test_vectors_priv_key),
258*f0865ec9SKyle Evans         .nn_random = bign_5_nn_random_belt_hash_test_vector,
259*f0865ec9SKyle Evans         .hash_type = BASH384,
260*f0865ec9SKyle Evans         .msg = "\xb1\x94\xba\xc8\x0a\x08\xf5\x3b\x36\x6d\x00\x8e\x58\x4a\x5d\xe4\x85\x04\xfa\x9d\x1b\xb6\xc7\xac\x25\x2e\x72\xc2\x02\xfd\xce\x0d\x5b\xe3\xd6\x12\x17\xb9\x61\x81\xfe\x67\x86\xad\x71\x6b\x89\x0b\x5c\xb0\xc0\xff\x33\xc3\x56\xb8\x35\xc4\x05\xae\xd8\xe0\x7f\x99\xe1\x2b\xdc\x1a\xe2\x82\x57\xec\x70\x3f\xcc\xf0\x95\xee\x8d\xf1\xc1\xab\x76\x38\x9f\xe6\x78\xca\xf7\xc6\xf8\x60\xd5\xbb\x9c",
261*f0865ec9SKyle Evans         .msglen = 95,
262*f0865ec9SKyle Evans         .sig_type = BIGN,
263*f0865ec9SKyle Evans         .exp_sig = bign_5_test_vectors_expected_sig,
264*f0865ec9SKyle Evans         .exp_siglen = sizeof(bign_5_test_vectors_expected_sig),
265*f0865ec9SKyle Evans 	.adata = bign_5_test_vectors_adata,
266*f0865ec9SKyle Evans 	.adata_len = sizeof(bign_5_test_vectors_adata)
267*f0865ec9SKyle Evans };
268*f0865ec9SKyle Evans /********************************************************************/
269*f0865ec9SKyle Evans static const u8 bign_6_test_vectors_priv_key[] = {
270*f0865ec9SKyle Evans 	0x0e, 0xb5, 0x93, 0x2d, 0x23, 0x1a, 0xe1, 0x37, 0x61, 0x41, 0x80, 0xec, 0x3b, 0xbe, 0x08, 0x0f, 0x93, 0xba, 0x80, 0x27, 0x8f, 0x05, 0xd8, 0x2f, 0x87, 0x6a, 0xf9, 0xf9, 0xea, 0x0a, 0xf1, 0x9e, 0x6c, 0xa1, 0x6f, 0x21, 0x6c, 0x38, 0x21, 0xdc, 0x72, 0x23, 0x3c, 0x7b, 0xbf, 0x1d, 0xc2, 0x84,
271*f0865ec9SKyle Evans  };
272*f0865ec9SKyle Evans static const u8 bign_6_test_vectors_expected_sig[] = {
273*f0865ec9SKyle Evans 	0x51, 0xD1, 0x1A, 0xBB,  0x63, 0x92, 0xD9, 0x04,  0x06, 0x85, 0xC4, 0xCC,  0x3A, 0x87, 0x55, 0x3B,
274*f0865ec9SKyle Evans 	0xAF, 0x47, 0x44, 0x81,  0x19, 0x86, 0x02, 0xFC,  0xF1, 0x80, 0xDD, 0x0E,  0x0F, 0x00, 0x76, 0xB7,
275*f0865ec9SKyle Evans 	0x5A, 0x9B, 0x87, 0x52,  0x69, 0x56, 0x09, 0x30,  0x80, 0xDA, 0x21, 0xAC,  0xFE, 0x73, 0xA7, 0x0E,
276*f0865ec9SKyle Evans 	0xEF, 0x4E, 0x5C, 0xEA,  0xE8, 0xC0, 0x7C, 0xDB,  0xA5, 0x26, 0xCF, 0xA3,  0xF6, 0xC5, 0x0D, 0xFD,
277*f0865ec9SKyle Evans 	0x4E, 0x8E, 0x88, 0x17,  0xC1, 0xAE, 0x62, 0x4B,
278*f0865ec9SKyle Evans  };
bign_6_nn_random_belt_hash_test_vector(nn_t out,nn_src_t q)279*f0865ec9SKyle Evans static int bign_6_nn_random_belt_hash_test_vector(nn_t out, nn_src_t q)
280*f0865ec9SKyle Evans {
281*f0865ec9SKyle Evans         int ret, cmp;
282*f0865ec9SKyle Evans 
283*f0865ec9SKyle Evans         /*
284*f0865ec9SKyle Evans          * Fixed ephemeral private key for bign signature
285*f0865ec9SKyle Evans          */
286*f0865ec9SKyle Evans         const u8 k_buf[] = {
287*f0865ec9SKyle Evans 		0x15, 0xf4, 0x26, 0x4c, 0xa3, 0x51, 0x9a, 0xa6, 0x0a, 0xd8, 0xae, 0x14, 0x79, 0x31, 0x73,
288*f0865ec9SKyle Evans 		0x19, 0x80, 0xa8, 0xe1, 0xc3, 0x61, 0x0d, 0xa5, 0xdd, 0xa3, 0x17, 0xea, 0x54, 0xca, 0x73,
289*f0865ec9SKyle Evans 		0x3a, 0xa1, 0xe7, 0x1d, 0x1a, 0x5b, 0x0a, 0xc1, 0xae, 0x49, 0xbc, 0xd0, 0x90, 0x02, 0xc1,
290*f0865ec9SKyle Evans 		0x9d, 0x3c, 0x19,
291*f0865ec9SKyle Evans 
292*f0865ec9SKyle Evans         };
293*f0865ec9SKyle Evans 
294*f0865ec9SKyle Evans         ret = nn_init_from_buf(out, k_buf, sizeof(k_buf)); EG(ret, err);
295*f0865ec9SKyle Evans         ret = nn_cmp(out, q, &cmp); EG(ret, err);
296*f0865ec9SKyle Evans 
297*f0865ec9SKyle Evans         ret = (cmp >= 0) ? -1 : 0;
298*f0865ec9SKyle Evans 
299*f0865ec9SKyle Evans err:
300*f0865ec9SKyle Evans         return ret;
301*f0865ec9SKyle Evans }
302*f0865ec9SKyle Evans static const u8 bign_6_test_vectors_adata[] = {
303*f0865ec9SKyle Evans 	0x00, 0x0b, 0x00, 0x00,
304*f0865ec9SKyle Evans 	0x06, 0x09, 0x2A, 0x70, 0x00, 0x02, 0x00, 0x22, 0x65, 0x4d, 0x0c,
305*f0865ec9SKyle Evans };
306*f0865ec9SKyle Evans 
307*f0865ec9SKyle Evans static const ec_test_case bign_6_test_case = {
308*f0865ec9SKyle Evans         .name = "BIGN-BASH384/bign384v1 6",
309*f0865ec9SKyle Evans         .ec_str_p = &bign384v1_str_params,
310*f0865ec9SKyle Evans         .priv_key = bign_6_test_vectors_priv_key,
311*f0865ec9SKyle Evans         .priv_key_len = sizeof(bign_6_test_vectors_priv_key),
312*f0865ec9SKyle Evans         .nn_random = bign_6_nn_random_belt_hash_test_vector,
313*f0865ec9SKyle Evans         .hash_type = BASH384,
314*f0865ec9SKyle Evans         .msg = "\xb1\x94\xba\xc8\x0a\x08\xf5\x3b\x36\x6d\x00\x8e\x58\x4a\x5d\xe4\x85\x04\xfa\x9d\x1b\xb6\xc7\xac\x25\x2e\x72\xc2\x02\xfd\xce\x0d\x5b\xe3\xd6\x12\x17\xb9\x61\x81\xfe\x67\x86\xad\x71\x6b\x89\x0b\x5c\xb0\xc0\xff\x33\xc3\x56\xb8\x35\xc4\x05\xae\xd8\xe0\x7f\x99\xe1\x2b\xdc\x1a\xe2\x82\x57\xec\x70\x3f\xcc\xf0\x95\xee\x8d\xf1\xc1\xab\x76\x38\x9f\xe6\x78\xca\xf7\xc6\xf8\x60\xd5\xbb\x9c\x4f",
315*f0865ec9SKyle Evans         .msglen = 96,
316*f0865ec9SKyle Evans         .sig_type = BIGN,
317*f0865ec9SKyle Evans         .exp_sig = bign_6_test_vectors_expected_sig,
318*f0865ec9SKyle Evans         .exp_siglen = sizeof(bign_6_test_vectors_expected_sig),
319*f0865ec9SKyle Evans 	.adata = bign_6_test_vectors_adata,
320*f0865ec9SKyle Evans 	.adata_len = sizeof(bign_6_test_vectors_adata)
321*f0865ec9SKyle Evans };
322*f0865ec9SKyle Evans 
323*f0865ec9SKyle Evans #endif
324*f0865ec9SKyle Evans 
325*f0865ec9SKyle Evans 
326*f0865ec9SKyle Evans #if defined(WITH_HASH_BASH512) && defined(WITH_CURVE_BIGN512V1)
327*f0865ec9SKyle Evans /********************************************************************/
328*f0865ec9SKyle Evans static const u8 bign_7_test_vectors_priv_key[] = {
329*f0865ec9SKyle Evans 	0xb8, 0xb9, 0x4a, 0xd2, 0xe5, 0x05, 0x02, 0xc5, 0x21, 0xe8, 0x8f, 0x1b, 0xcf, 0x97, 0x0b, 0x1b, 0x47, 0x78, 0x02, 0x31, 0x5b, 0xfe, 0x1f, 0x71, 0xd8, 0x55, 0x71, 0xa2, 0xd1, 0xc1, 0x90, 0x60, 0xba, 0xa2, 0xf1, 0xe0, 0x7d, 0x73, 0xd5, 0x2f, 0x37, 0x31, 0x0b, 0x04, 0x02, 0x3a, 0xbf, 0x33, 0x63, 0xb5, 0xf2, 0x95, 0x2a, 0x62, 0x17, 0xa4, 0x8a, 0x56, 0xf4, 0x3e, 0x35, 0x96, 0xc0, 0xbe,
330*f0865ec9SKyle Evans  };
331*f0865ec9SKyle Evans static const u8 bign_7_test_vectors_expected_sig[] = {
332*f0865ec9SKyle Evans 	0xF9, 0x22, 0xD7, 0x01, 0x48, 0xC5, 0x5A, 0xD5, 0x47, 0xEB, 0x0A, 0x19, 0x30, 0xE5, 0x2C, 0xC5, 0x52, 0xD9, 0x28, 0xDC, 0x76, 0xE4, 0x03, 0x0C, 0x9E, 0xE5, 0x7D, 0xE8,
333*f0865ec9SKyle Evans 	0xDE, 0xD1, 0xB5, 0xF9, 0x5D, 0x4E, 0x33, 0xF4, 0x7C, 0xD3, 0x61, 0xDA, 0xCB, 0x1F, 0x26, 0xB2, 0x01, 0x32, 0xE4, 0x5D, 0x49, 0x88, 0xFB, 0x86, 0xAF, 0x1B, 0x54, 0x65,
334*f0865ec9SKyle Evans 	0x8F, 0xE2, 0xFE, 0x97, 0x11, 0x61, 0x77, 0xF5, 0xD3, 0x11, 0x7C, 0xE0, 0x63, 0x2D, 0xDF, 0xAA, 0x8E, 0xDE, 0x10, 0xDA, 0x7D, 0xF8, 0x35, 0xD2, 0x72, 0x5E, 0x2B, 0x83, 0x4C, 0xA9, 0x6C, 0x8C, 0x06, 0x1B, 0xC8, 0x31, 0xDF, 0xA5, 0xB3, 0x16,
335*f0865ec9SKyle Evans  };
bign_7_nn_random_belt_hash_test_vector(nn_t out,nn_src_t q)336*f0865ec9SKyle Evans static int bign_7_nn_random_belt_hash_test_vector(nn_t out, nn_src_t q)
337*f0865ec9SKyle Evans {
338*f0865ec9SKyle Evans         int ret, cmp;
339*f0865ec9SKyle Evans 
340*f0865ec9SKyle Evans         /*
341*f0865ec9SKyle Evans          * Fixed ephemeral private key for bign signature
342*f0865ec9SKyle Evans          */
343*f0865ec9SKyle Evans         const u8 k_buf[] = {
344*f0865ec9SKyle Evans 		0x62, 0x64, 0x5d, 0x68, 0xca, 0x6f, 0xb3, 0x52, 0x10, 0xf6, 0xdb, 0x92, 0xe2,
345*f0865ec9SKyle Evans 		0xe7, 0x86, 0xee, 0x34, 0x65, 0xdd, 0xc9, 0x62, 0xbe, 0x99, 0x70, 0xfe, 0x1c,
346*f0865ec9SKyle Evans 		0x12, 0xe6, 0xe7, 0xca, 0x95, 0xe9, 0x1a, 0xe0, 0x7b, 0x65, 0x9a, 0x8b, 0x7c,
347*f0865ec9SKyle Evans 		0x03, 0xf9, 0xb7, 0x2e, 0x64, 0x1f, 0xef, 0xdc, 0x5b, 0x7a, 0xb6, 0xcd, 0x8c,
348*f0865ec9SKyle Evans 		0x03, 0x95, 0xe3, 0x80, 0xb9, 0x2c, 0x2f, 0xfd, 0x19, 0xe7, 0x83, 0x2c,
349*f0865ec9SKyle Evans         };
350*f0865ec9SKyle Evans 
351*f0865ec9SKyle Evans         ret = nn_init_from_buf(out, k_buf, sizeof(k_buf)); EG(ret, err);
352*f0865ec9SKyle Evans         ret = nn_cmp(out, q, &cmp); EG(ret, err);
353*f0865ec9SKyle Evans 
354*f0865ec9SKyle Evans         ret = (cmp >= 0) ? -1 : 0;
355*f0865ec9SKyle Evans 
356*f0865ec9SKyle Evans err:
357*f0865ec9SKyle Evans         return ret;
358*f0865ec9SKyle Evans }
359*f0865ec9SKyle Evans static const u8 bign_7_test_vectors_adata[] = {
360*f0865ec9SKyle Evans 	0x00, 0x0b, 0x00, 0x00,
361*f0865ec9SKyle Evans 	0x06, 0x09, 0x2A, 0x70, 0x00, 0x02, 0x00, 0x22, 0x65, 0x4d, 0x0d,
362*f0865ec9SKyle Evans };
363*f0865ec9SKyle Evans 
364*f0865ec9SKyle Evans static const ec_test_case bign_7_test_case = {
365*f0865ec9SKyle Evans         .name = "BIGN-BASH512/bign512v1 7",
366*f0865ec9SKyle Evans         .ec_str_p = &bign512v1_str_params,
367*f0865ec9SKyle Evans         .priv_key = bign_7_test_vectors_priv_key,
368*f0865ec9SKyle Evans         .priv_key_len = sizeof(bign_7_test_vectors_priv_key),
369*f0865ec9SKyle Evans         .nn_random = bign_7_nn_random_belt_hash_test_vector,
370*f0865ec9SKyle Evans         .hash_type = BASH512,
371*f0865ec9SKyle Evans         .msg = "\xb1\x94\xba\xc8\x0a\x08\xf5\x3b\x36\x6d\x00\x8e\x58\x4a\x5d\xe4\x85\x04\xfa\x9d\x1b\xb6\xc7\xac\x25\x2e\x72\xc2\x02\xfd\xce\x0d\x5b\xe3\xd6\x12\x17\xb9\x61\x81\xfe\x67\x86\xad\x71\x6b\x89\x0b\x5c\xb0\xc0\xff\x33\xc3\x56\xb8\x35\xc4\x05\xae\xd8\xe0\x7f",
372*f0865ec9SKyle Evans         .msglen = 63,
373*f0865ec9SKyle Evans         .sig_type = BIGN,
374*f0865ec9SKyle Evans         .exp_sig = bign_7_test_vectors_expected_sig,
375*f0865ec9SKyle Evans         .exp_siglen = sizeof(bign_7_test_vectors_expected_sig),
376*f0865ec9SKyle Evans 	.adata = bign_7_test_vectors_adata,
377*f0865ec9SKyle Evans 	.adata_len = sizeof(bign_7_test_vectors_adata)
378*f0865ec9SKyle Evans };
379*f0865ec9SKyle Evans 
380*f0865ec9SKyle Evans /********************************************************************/
381*f0865ec9SKyle Evans static const u8 bign_8_test_vectors_priv_key[] = {
382*f0865ec9SKyle Evans 	0xb8, 0xb9, 0x4a, 0xd2, 0xe5, 0x05, 0x02, 0xc5, 0x21, 0xe8, 0x8f, 0x1b, 0xcf, 0x97, 0x0b, 0x1b, 0x47, 0x78, 0x02, 0x31, 0x5b, 0xfe, 0x1f, 0x71, 0xd8, 0x55, 0x71, 0xa2, 0xd1, 0xc1, 0x90, 0x60, 0xba, 0xa2, 0xf1, 0xe0, 0x7d, 0x73, 0xd5, 0x2f, 0x37, 0x31, 0x0b, 0x04, 0x02, 0x3a, 0xbf, 0x33, 0x63, 0xb5, 0xf2, 0x95, 0x2a, 0x62, 0x17, 0xa4, 0x8a, 0x56, 0xf4, 0x3e, 0x35, 0x96, 0xc0, 0xbe,
383*f0865ec9SKyle Evans  };
384*f0865ec9SKyle Evans static const u8 bign_8_test_vectors_expected_sig[] = {
385*f0865ec9SKyle Evans 	0x4B, 0x47, 0x8B, 0x2B,  0x28, 0x79, 0x5A, 0x43,  0x8C, 0x3F, 0x4A, 0x70,  0xD7, 0xF3, 0x02, 0xD3,
386*f0865ec9SKyle Evans 	0xD1, 0xB6, 0x15, 0xE9,  0x85, 0xCE, 0x22, 0xDA,  0x71, 0x22, 0xAE, 0x1E,  0xAB, 0x0D, 0xD9, 0x87,
387*f0865ec9SKyle Evans 	0x92, 0x39, 0x94, 0x96,  0x8A, 0x24, 0xBF, 0x15,  0xC2, 0xE6, 0x59, 0xB4,  0x54, 0x6F, 0x83, 0xCF,
388*f0865ec9SKyle Evans 	0x16, 0x49, 0x33, 0x38,  0x79, 0xD4, 0x79, 0x54,  0xC4, 0xAB, 0x7E, 0x41,  0x04, 0x6E, 0xB3, 0xD9,
389*f0865ec9SKyle Evans 	0x27, 0x87, 0xF7, 0x85,  0xC9, 0x12, 0x30, 0xCD,  0x7E, 0x65, 0xE4, 0x55,  0x26, 0xD4, 0x56, 0x50,
390*f0865ec9SKyle Evans 	0x92, 0x1D, 0x77, 0x2D,  0xD4, 0x2B, 0xD3, 0x52,  0x2C, 0xF7, 0xBD, 0x5F,  0x7D, 0x79, 0xAB, 0x65,
391*f0865ec9SKyle Evans  };
bign_8_nn_random_belt_hash_test_vector(nn_t out,nn_src_t q)392*f0865ec9SKyle Evans static int bign_8_nn_random_belt_hash_test_vector(nn_t out, nn_src_t q)
393*f0865ec9SKyle Evans {
394*f0865ec9SKyle Evans         int ret, cmp;
395*f0865ec9SKyle Evans 
396*f0865ec9SKyle Evans         /*
397*f0865ec9SKyle Evans          * Fixed ephemeral private key for bign signature
398*f0865ec9SKyle Evans          */
399*f0865ec9SKyle Evans         const u8 k_buf[] = {
400*f0865ec9SKyle Evans 		0x62, 0x64, 0x5d, 0x68, 0xca, 0x6f, 0xb3, 0x52, 0x10, 0xf6, 0xdb, 0x92, 0xe2,
401*f0865ec9SKyle Evans 		0xe7, 0x86, 0xee, 0x34, 0x65, 0xdd, 0xc9, 0x62, 0xbe, 0x99, 0x70, 0xfe, 0x1c,
402*f0865ec9SKyle Evans 		0x12, 0xe6, 0xe7, 0xca, 0x95, 0xe9, 0x1a, 0xe0, 0x7b, 0x65, 0x9a, 0x8b, 0x7c,
403*f0865ec9SKyle Evans 		0x03, 0xf9, 0xb7, 0x2e, 0x64, 0x1f, 0xef, 0xdc, 0x5b, 0x7a, 0xb6, 0xcd, 0x8c,
404*f0865ec9SKyle Evans 		0x03, 0x95, 0xe3, 0x80, 0xb9, 0x2c, 0x2f, 0xfd, 0x19, 0xe7, 0x83, 0x2c,
405*f0865ec9SKyle Evans         };
406*f0865ec9SKyle Evans 
407*f0865ec9SKyle Evans         ret = nn_init_from_buf(out, k_buf, sizeof(k_buf)); EG(ret, err);
408*f0865ec9SKyle Evans         ret = nn_cmp(out, q, &cmp); EG(ret, err);
409*f0865ec9SKyle Evans 
410*f0865ec9SKyle Evans         ret = (cmp >= 0) ? -1 : 0;
411*f0865ec9SKyle Evans 
412*f0865ec9SKyle Evans err:
413*f0865ec9SKyle Evans         return ret;
414*f0865ec9SKyle Evans }
415*f0865ec9SKyle Evans static const u8 bign_8_test_vectors_adata[] = {
416*f0865ec9SKyle Evans 	0x00, 0x0b, 0x00, 0x00,
417*f0865ec9SKyle Evans 	0x06, 0x09, 0x2A, 0x70, 0x00, 0x02, 0x00, 0x22, 0x65, 0x4d, 0x0d,
418*f0865ec9SKyle Evans };
419*f0865ec9SKyle Evans 
420*f0865ec9SKyle Evans static const ec_test_case bign_8_test_case = {
421*f0865ec9SKyle Evans         .name = "BIGN-BASH512/bign512v1 8",
422*f0865ec9SKyle Evans         .ec_str_p = &bign512v1_str_params,
423*f0865ec9SKyle Evans         .priv_key = bign_8_test_vectors_priv_key,
424*f0865ec9SKyle Evans         .priv_key_len = sizeof(bign_8_test_vectors_priv_key),
425*f0865ec9SKyle Evans         .nn_random = bign_8_nn_random_belt_hash_test_vector,
426*f0865ec9SKyle Evans         .hash_type = BASH512,
427*f0865ec9SKyle Evans         .msg = "\xb1\x94\xba\xc8\x0a\x08\xf5\x3b\x36\x6d\x00\x8e\x58\x4a\x5d\xe4\x85\x04\xfa\x9d\x1b\xb6\xc7\xac\x25\x2e\x72\xc2\x02\xfd\xce\x0d\x5b\xe3\xd6\x12\x17\xb9\x61\x81\xfe\x67\x86\xad\x71\x6b\x89\x0b\x5c\xb0\xc0\xff\x33\xc3\x56\xb8\x35\xc4\x05\xae\xd8\xe0\x7f\x99",
428*f0865ec9SKyle Evans         .msglen = 64,
429*f0865ec9SKyle Evans         .sig_type = BIGN,
430*f0865ec9SKyle Evans         .exp_sig = bign_8_test_vectors_expected_sig,
431*f0865ec9SKyle Evans         .exp_siglen = sizeof(bign_8_test_vectors_expected_sig),
432*f0865ec9SKyle Evans 	.adata = bign_8_test_vectors_adata,
433*f0865ec9SKyle Evans 	.adata_len = sizeof(bign_8_test_vectors_adata)
434*f0865ec9SKyle Evans };
435*f0865ec9SKyle Evans #endif
436*f0865ec9SKyle Evans 
437*f0865ec9SKyle Evans /************************************************/
438*f0865ec9SKyle Evans #define BIGN_ALL_TESTS() \
439*f0865ec9SKyle Evans         &bign_1_test_case, \
440*f0865ec9SKyle Evans         &bign_2_test_case, \
441*f0865ec9SKyle Evans         &bign_3_test_case, \
442*f0865ec9SKyle Evans 	&bign_4_test_case, \
443*f0865ec9SKyle Evans 	&bign_5_test_case, \
444*f0865ec9SKyle Evans 	&bign_6_test_case, \
445*f0865ec9SKyle Evans 	&bign_7_test_case, \
446*f0865ec9SKyle Evans 	&bign_8_test_case,
447*f0865ec9SKyle Evans 
448*f0865ec9SKyle Evans #endif /* __BIGN_TEST_VECTORS_H__ */
449