xref: /freebsd/crypto/openssl/providers/fips/self_test_data.inc (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery/*
2*b077aed3SPierre Pronchery * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
3*b077aed3SPierre Pronchery *
4*b077aed3SPierre Pronchery * Licensed under the Apache License 2.0 (the "License").  You may not use
5*b077aed3SPierre Pronchery * this file except in compliance with the License.  You can obtain a copy
6*b077aed3SPierre Pronchery * in the file LICENSE in the source distribution or at
7*b077aed3SPierre Pronchery * https://www.openssl.org/source/license.html
8*b077aed3SPierre Pronchery */
9*b077aed3SPierre Pronchery
10*b077aed3SPierre Pronchery/* Macros to build Self test data */
11*b077aed3SPierre Pronchery#define ITM(x) ((void *)&x), sizeof(x)
12*b077aed3SPierre Pronchery#define ITM_STR(x) ((void *)&x), (sizeof(x) - 1)
13*b077aed3SPierre Pronchery
14*b077aed3SPierre Pronchery#define ST_KAT_PARAM_END() { "", 0, NULL, 0 }
15*b077aed3SPierre Pronchery#define ST_KAT_PARAM_BIGNUM(name, data)                                        \
16*b077aed3SPierre Pronchery    { name, OSSL_PARAM_UNSIGNED_INTEGER, ITM(data) }
17*b077aed3SPierre Pronchery#define ST_KAT_PARAM_OCTET(name, data)                                         \
18*b077aed3SPierre Pronchery    { name, OSSL_PARAM_OCTET_STRING, ITM(data) }
19*b077aed3SPierre Pronchery#define ST_KAT_PARAM_UTF8STRING(name, data)                                    \
20*b077aed3SPierre Pronchery    { name, OSSL_PARAM_UTF8_STRING, ITM_STR(data) }
21*b077aed3SPierre Pronchery#define ST_KAT_PARAM_UTF8CHAR(name, data)                                      \
22*b077aed3SPierre Pronchery    { name, OSSL_PARAM_UTF8_STRING, ITM(data) }
23*b077aed3SPierre Pronchery#define ST_KAT_PARAM_INT(name, i)                                              \
24*b077aed3SPierre Pronchery    { name, OSSL_PARAM_INTEGER, ITM(i) }
25*b077aed3SPierre Pronchery
26*b077aed3SPierre Pronchery/* used to store raw parameters for keys and algorithms */
27*b077aed3SPierre Proncherytypedef struct st_kat_param_st {
28*b077aed3SPierre Pronchery    const char *name;  /* an OSSL_PARAM name */
29*b077aed3SPierre Pronchery    size_t type;       /* the type associated with the data */
30*b077aed3SPierre Pronchery    const void *data;  /* unsigned char [], or char [] depending on the type */
31*b077aed3SPierre Pronchery    size_t data_len;   /* the length of the data */
32*b077aed3SPierre Pronchery} ST_KAT_PARAM;
33*b077aed3SPierre Pronchery
34*b077aed3SPierre Proncherytypedef struct st_kat_st {
35*b077aed3SPierre Pronchery    const char *desc;
36*b077aed3SPierre Pronchery    const char *algorithm;
37*b077aed3SPierre Pronchery    const unsigned char *pt;
38*b077aed3SPierre Pronchery    size_t pt_len;
39*b077aed3SPierre Pronchery    const unsigned char *expected;
40*b077aed3SPierre Pronchery    size_t expected_len;
41*b077aed3SPierre Pronchery} ST_KAT;
42*b077aed3SPierre Pronchery
43*b077aed3SPierre Pronchery#define CIPHER_MODE_ENCRYPT 1
44*b077aed3SPierre Pronchery#define CIPHER_MODE_DECRYPT 2
45*b077aed3SPierre Pronchery#define CIPHER_MODE_ALL     (CIPHER_MODE_ENCRYPT | CIPHER_MODE_DECRYPT)
46*b077aed3SPierre Pronchery
47*b077aed3SPierre Proncherytypedef ST_KAT ST_KAT_DIGEST;
48*b077aed3SPierre Proncherytypedef struct st_kat_cipher_st {
49*b077aed3SPierre Pronchery    ST_KAT base;
50*b077aed3SPierre Pronchery    int mode;
51*b077aed3SPierre Pronchery    const unsigned char *key;
52*b077aed3SPierre Pronchery    size_t key_len;
53*b077aed3SPierre Pronchery    const unsigned char *iv;
54*b077aed3SPierre Pronchery    size_t iv_len;
55*b077aed3SPierre Pronchery    const unsigned char *aad;
56*b077aed3SPierre Pronchery    size_t aad_len;
57*b077aed3SPierre Pronchery    const unsigned char *tag;
58*b077aed3SPierre Pronchery    size_t tag_len;
59*b077aed3SPierre Pronchery} ST_KAT_CIPHER;
60*b077aed3SPierre Pronchery
61*b077aed3SPierre Proncherytypedef struct st_kat_kdf_st {
62*b077aed3SPierre Pronchery    const char *desc;
63*b077aed3SPierre Pronchery    const char *algorithm;
64*b077aed3SPierre Pronchery    const ST_KAT_PARAM *params;
65*b077aed3SPierre Pronchery    const unsigned char *expected;
66*b077aed3SPierre Pronchery    size_t expected_len;
67*b077aed3SPierre Pronchery} ST_KAT_KDF;
68*b077aed3SPierre Pronchery
69*b077aed3SPierre Proncherytypedef struct st_kat_drbg_st {
70*b077aed3SPierre Pronchery    const char *desc;
71*b077aed3SPierre Pronchery    const char *algorithm;
72*b077aed3SPierre Pronchery    const char *param_name;
73*b077aed3SPierre Pronchery    char *param_value;
74*b077aed3SPierre Pronchery    const unsigned char *entropyin;
75*b077aed3SPierre Pronchery    size_t entropyinlen;
76*b077aed3SPierre Pronchery    const unsigned char *nonce;
77*b077aed3SPierre Pronchery    size_t noncelen;
78*b077aed3SPierre Pronchery    const unsigned char *persstr;
79*b077aed3SPierre Pronchery    size_t persstrlen;
80*b077aed3SPierre Pronchery    const unsigned char *entropyinpr1;
81*b077aed3SPierre Pronchery    size_t entropyinpr1len;
82*b077aed3SPierre Pronchery    const unsigned char *entropyinpr2;
83*b077aed3SPierre Pronchery    size_t entropyinpr2len;
84*b077aed3SPierre Pronchery    const unsigned char *entropyaddin1;
85*b077aed3SPierre Pronchery    size_t entropyaddin1len;
86*b077aed3SPierre Pronchery    const unsigned char *entropyaddin2;
87*b077aed3SPierre Pronchery    size_t entropyaddin2len;
88*b077aed3SPierre Pronchery    const unsigned char *expected;
89*b077aed3SPierre Pronchery    size_t expectedlen;
90*b077aed3SPierre Pronchery} ST_KAT_DRBG;
91*b077aed3SPierre Pronchery
92*b077aed3SPierre Proncherytypedef struct st_kat_kas_st {
93*b077aed3SPierre Pronchery    const char *desc;
94*b077aed3SPierre Pronchery    const char *algorithm;
95*b077aed3SPierre Pronchery
96*b077aed3SPierre Pronchery    const ST_KAT_PARAM *key_group;
97*b077aed3SPierre Pronchery    const ST_KAT_PARAM *key_host_data;
98*b077aed3SPierre Pronchery    const ST_KAT_PARAM *key_peer_data;
99*b077aed3SPierre Pronchery
100*b077aed3SPierre Pronchery    const unsigned char *expected;
101*b077aed3SPierre Pronchery    size_t expected_len;
102*b077aed3SPierre Pronchery} ST_KAT_KAS;
103*b077aed3SPierre Pronchery
104*b077aed3SPierre Proncherytypedef struct st_kat_sign_st {
105*b077aed3SPierre Pronchery    const char *desc;
106*b077aed3SPierre Pronchery    const char *algorithm;
107*b077aed3SPierre Pronchery    const char *mdalgorithm;
108*b077aed3SPierre Pronchery    const ST_KAT_PARAM *key;
109*b077aed3SPierre Pronchery    const unsigned char *sig_expected; /* Set to NULL if this value changes */
110*b077aed3SPierre Pronchery    size_t sig_expected_len;
111*b077aed3SPierre Pronchery} ST_KAT_SIGN;
112*b077aed3SPierre Pronchery
113*b077aed3SPierre Proncherytypedef struct st_kat_asym_cipher_st {
114*b077aed3SPierre Pronchery    const char *desc;
115*b077aed3SPierre Pronchery    const char *algorithm;
116*b077aed3SPierre Pronchery    int encrypt;
117*b077aed3SPierre Pronchery    const ST_KAT_PARAM *key;
118*b077aed3SPierre Pronchery    const ST_KAT_PARAM *postinit;
119*b077aed3SPierre Pronchery    const unsigned char *in;
120*b077aed3SPierre Pronchery    size_t in_len;
121*b077aed3SPierre Pronchery    const unsigned char *expected;
122*b077aed3SPierre Pronchery    size_t expected_len;
123*b077aed3SPierre Pronchery} ST_KAT_ASYM_CIPHER;
124*b077aed3SPierre Pronchery
125*b077aed3SPierre Pronchery/*- DIGEST TEST DATA */
126*b077aed3SPierre Proncherystatic const unsigned char sha1_pt[] = "abc";
127*b077aed3SPierre Proncherystatic const unsigned char sha1_digest[] = {
128*b077aed3SPierre Pronchery    0xA9, 0x99, 0x3E, 0x36, 0x47, 0x06, 0x81, 0x6A, 0xBA, 0x3E, 0x25, 0x71,
129*b077aed3SPierre Pronchery    0x78, 0x50, 0xC2, 0x6C, 0x9C, 0xD0, 0xD8, 0x9D
130*b077aed3SPierre Pronchery};
131*b077aed3SPierre Pronchery
132*b077aed3SPierre Proncherystatic const unsigned char sha512_pt[] = "abc";
133*b077aed3SPierre Proncherystatic const unsigned char sha512_digest[] = {
134*b077aed3SPierre Pronchery    0xDD, 0xAF, 0x35, 0xA1, 0x93, 0x61, 0x7A, 0xBA, 0xCC, 0x41, 0x73, 0x49,
135*b077aed3SPierre Pronchery    0xAE, 0x20, 0x41, 0x31, 0x12, 0xE6, 0xFA, 0x4E, 0x89, 0xA9, 0x7E, 0xA2,
136*b077aed3SPierre Pronchery    0x0A, 0x9E, 0xEE, 0xE6, 0x4B, 0x55, 0xD3, 0x9A, 0x21, 0x92, 0x99, 0x2A,
137*b077aed3SPierre Pronchery    0x27, 0x4F, 0xC1, 0xA8, 0x36, 0xBA, 0x3C, 0x23, 0xA3, 0xFE, 0xEB, 0xBD,
138*b077aed3SPierre Pronchery    0x45, 0x4D, 0x44, 0x23, 0x64, 0x3C, 0xE8, 0x0E, 0x2A, 0x9A, 0xC9, 0x4F,
139*b077aed3SPierre Pronchery    0xA5, 0x4C, 0xA4, 0x9F
140*b077aed3SPierre Pronchery};
141*b077aed3SPierre Proncherystatic const unsigned char sha3_256_pt[] = { 0xe7, 0x37, 0x21, 0x05 };
142*b077aed3SPierre Proncherystatic const unsigned char sha3_256_digest[] = {
143*b077aed3SPierre Pronchery    0x3a, 0x42, 0xb6, 0x8a, 0xb0, 0x79, 0xf2, 0x8c, 0x4c, 0xa3, 0xc7, 0x52,
144*b077aed3SPierre Pronchery    0x29, 0x6f, 0x27, 0x90, 0x06, 0xc4, 0xfe, 0x78, 0xb1, 0xeb, 0x79, 0xd9,
145*b077aed3SPierre Pronchery    0x89, 0x77, 0x7f, 0x05, 0x1e, 0x40, 0x46, 0xae
146*b077aed3SPierre Pronchery};
147*b077aed3SPierre Pronchery
148*b077aed3SPierre Proncherystatic const ST_KAT_DIGEST st_kat_digest_tests[] =
149*b077aed3SPierre Pronchery{
150*b077aed3SPierre Pronchery    {
151*b077aed3SPierre Pronchery         OSSL_SELF_TEST_DESC_MD_SHA1,
152*b077aed3SPierre Pronchery         "SHA1",
153*b077aed3SPierre Pronchery         ITM_STR(sha1_pt),
154*b077aed3SPierre Pronchery         ITM(sha1_digest),
155*b077aed3SPierre Pronchery    },
156*b077aed3SPierre Pronchery    {
157*b077aed3SPierre Pronchery         OSSL_SELF_TEST_DESC_MD_SHA2,
158*b077aed3SPierre Pronchery         "SHA512",
159*b077aed3SPierre Pronchery         ITM_STR(sha512_pt),
160*b077aed3SPierre Pronchery         ITM(sha512_digest),
161*b077aed3SPierre Pronchery    },
162*b077aed3SPierre Pronchery    {
163*b077aed3SPierre Pronchery         OSSL_SELF_TEST_DESC_MD_SHA3,
164*b077aed3SPierre Pronchery         "SHA3-256",
165*b077aed3SPierre Pronchery         ITM(sha3_256_pt),
166*b077aed3SPierre Pronchery         ITM(sha3_256_digest),
167*b077aed3SPierre Pronchery    },
168*b077aed3SPierre Pronchery};
169*b077aed3SPierre Pronchery
170*b077aed3SPierre Pronchery
171*b077aed3SPierre Pronchery/*- CIPHER TEST DATA */
172*b077aed3SPierre Pronchery
173*b077aed3SPierre Pronchery/* DES3 test data */
174*b077aed3SPierre Proncherystatic const unsigned char des_ede3_cbc_pt[] = {
175*b077aed3SPierre Pronchery    0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96,
176*b077aed3SPierre Pronchery    0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A,
177*b077aed3SPierre Pronchery    0xAE, 0x2D, 0x8A, 0x57, 0x1E, 0x03, 0xAC, 0x9C,
178*b077aed3SPierre Pronchery    0x9E, 0xB7, 0x6F, 0xAC, 0x45, 0xAF, 0x8E, 0x51
179*b077aed3SPierre Pronchery};
180*b077aed3SPierre Proncherystatic const unsigned char des_ede3_cbc_key[] = {
181*b077aed3SPierre Pronchery    0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
182*b077aed3SPierre Pronchery    0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01,
183*b077aed3SPierre Pronchery    0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23
184*b077aed3SPierre Pronchery};
185*b077aed3SPierre Proncherystatic const unsigned char des_ede3_cbc_iv[] = {
186*b077aed3SPierre Pronchery    0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B, 0x17
187*b077aed3SPierre Pronchery};
188*b077aed3SPierre Proncherystatic const unsigned char des_ede3_cbc_ct[] = {
189*b077aed3SPierre Pronchery    0x20, 0x79, 0xC3, 0xD5, 0x3A, 0xA7, 0x63, 0xE1,
190*b077aed3SPierre Pronchery    0x93, 0xB7, 0x9E, 0x25, 0x69, 0xAB, 0x52, 0x62,
191*b077aed3SPierre Pronchery    0x51, 0x65, 0x70, 0x48, 0x1F, 0x25, 0xB5, 0x0F,
192*b077aed3SPierre Pronchery    0x73, 0xC0, 0xBD, 0xA8, 0x5C, 0x8E, 0x0D, 0xA7
193*b077aed3SPierre Pronchery};
194*b077aed3SPierre Pronchery
195*b077aed3SPierre Pronchery/* AES-256 GCM test data */
196*b077aed3SPierre Proncherystatic const unsigned char aes_256_gcm_key[] = {
197*b077aed3SPierre Pronchery    0x92, 0xe1, 0x1d, 0xcd, 0xaa, 0x86, 0x6f, 0x5c,
198*b077aed3SPierre Pronchery    0xe7, 0x90, 0xfd, 0x24, 0x50, 0x1f, 0x92, 0x50,
199*b077aed3SPierre Pronchery    0x9a, 0xac, 0xf4, 0xcb, 0x8b, 0x13, 0x39, 0xd5,
200*b077aed3SPierre Pronchery    0x0c, 0x9c, 0x12, 0x40, 0x93, 0x5d, 0xd0, 0x8b
201*b077aed3SPierre Pronchery};
202*b077aed3SPierre Proncherystatic const unsigned char aes_256_gcm_iv[] = {
203*b077aed3SPierre Pronchery    0xac, 0x93, 0xa1, 0xa6, 0x14, 0x52, 0x99, 0xbd,
204*b077aed3SPierre Pronchery    0xe9, 0x02, 0xf2, 0x1a
205*b077aed3SPierre Pronchery};
206*b077aed3SPierre Proncherystatic const unsigned char aes_256_gcm_pt[] = {
207*b077aed3SPierre Pronchery    0x2d, 0x71, 0xbc, 0xfa, 0x91, 0x4e, 0x4a, 0xc0,
208*b077aed3SPierre Pronchery    0x45, 0xb2, 0xaa, 0x60, 0x95, 0x5f, 0xad, 0x24
209*b077aed3SPierre Pronchery};
210*b077aed3SPierre Proncherystatic const unsigned char aes_256_gcm_aad[] = {
211*b077aed3SPierre Pronchery    0x1e, 0x08, 0x89, 0x01, 0x6f, 0x67, 0x60, 0x1c,
212*b077aed3SPierre Pronchery    0x8e, 0xbe, 0xa4, 0x94, 0x3b, 0xc2, 0x3a, 0xd6
213*b077aed3SPierre Pronchery};
214*b077aed3SPierre Proncherystatic const unsigned char aes_256_gcm_ct[] = {
215*b077aed3SPierre Pronchery    0x89, 0x95, 0xae, 0x2e, 0x6d, 0xf3, 0xdb, 0xf9,
216*b077aed3SPierre Pronchery    0x6f, 0xac, 0x7b, 0x71, 0x37, 0xba, 0xe6, 0x7f
217*b077aed3SPierre Pronchery};
218*b077aed3SPierre Proncherystatic const unsigned char aes_256_gcm_tag[] = {
219*b077aed3SPierre Pronchery    0xec, 0xa5, 0xaa, 0x77, 0xd5, 0x1d, 0x4a, 0x0a,
220*b077aed3SPierre Pronchery    0x14, 0xd9, 0xc5, 0x1e, 0x1d, 0xa4, 0x74, 0xab
221*b077aed3SPierre Pronchery};
222*b077aed3SPierre Pronchery
223*b077aed3SPierre Pronchery/* AES-ECB test data */
224*b077aed3SPierre Proncherystatic const unsigned char aes_128_ecb_key[] = {
225*b077aed3SPierre Pronchery    0x10, 0xa5, 0x88, 0x69, 0xd7, 0x4b, 0xe5, 0xa3,
226*b077aed3SPierre Pronchery    0x74, 0xcf, 0x86, 0x7c, 0xfb, 0x47, 0x38, 0x59
227*b077aed3SPierre Pronchery};
228*b077aed3SPierre Proncherystatic const unsigned char aes_128_ecb_pt[] = {
229*b077aed3SPierre Pronchery    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
230*b077aed3SPierre Pronchery    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
231*b077aed3SPierre Pronchery};
232*b077aed3SPierre Proncherystatic const unsigned char aes_128_ecb_ct[] = {
233*b077aed3SPierre Pronchery    0x6d, 0x25, 0x1e, 0x69, 0x44, 0xb0, 0x51, 0xe0,
234*b077aed3SPierre Pronchery    0x4e, 0xaa, 0x6f, 0xb4, 0xdb, 0xf7, 0x84, 0x65
235*b077aed3SPierre Pronchery};
236*b077aed3SPierre Pronchery
237*b077aed3SPierre Proncherystatic const ST_KAT_CIPHER st_kat_cipher_tests[] = {
238*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DES
239*b077aed3SPierre Pronchery    {
240*b077aed3SPierre Pronchery        {
241*b077aed3SPierre Pronchery            OSSL_SELF_TEST_DESC_CIPHER_TDES,
242*b077aed3SPierre Pronchery            "DES-EDE3-CBC",
243*b077aed3SPierre Pronchery            ITM(des_ede3_cbc_pt),
244*b077aed3SPierre Pronchery            ITM(des_ede3_cbc_ct)
245*b077aed3SPierre Pronchery        },
246*b077aed3SPierre Pronchery        CIPHER_MODE_ENCRYPT | CIPHER_MODE_DECRYPT,
247*b077aed3SPierre Pronchery        ITM(des_ede3_cbc_key),
248*b077aed3SPierre Pronchery        ITM(des_ede3_cbc_iv),
249*b077aed3SPierre Pronchery    },
250*b077aed3SPierre Pronchery#endif
251*b077aed3SPierre Pronchery    {
252*b077aed3SPierre Pronchery        {
253*b077aed3SPierre Pronchery            OSSL_SELF_TEST_DESC_CIPHER_AES_GCM,
254*b077aed3SPierre Pronchery            "AES-256-GCM",
255*b077aed3SPierre Pronchery            ITM(aes_256_gcm_pt),
256*b077aed3SPierre Pronchery            ITM(aes_256_gcm_ct)
257*b077aed3SPierre Pronchery        },
258*b077aed3SPierre Pronchery        CIPHER_MODE_ENCRYPT | CIPHER_MODE_DECRYPT,
259*b077aed3SPierre Pronchery        ITM(aes_256_gcm_key),
260*b077aed3SPierre Pronchery        ITM(aes_256_gcm_iv),
261*b077aed3SPierre Pronchery        ITM(aes_256_gcm_aad),
262*b077aed3SPierre Pronchery        ITM(aes_256_gcm_tag)
263*b077aed3SPierre Pronchery    },
264*b077aed3SPierre Pronchery    {
265*b077aed3SPierre Pronchery        {
266*b077aed3SPierre Pronchery            OSSL_SELF_TEST_DESC_CIPHER_AES_ECB,
267*b077aed3SPierre Pronchery            "AES-128-ECB",
268*b077aed3SPierre Pronchery            ITM(aes_128_ecb_pt),
269*b077aed3SPierre Pronchery            ITM(aes_128_ecb_ct)
270*b077aed3SPierre Pronchery        },
271*b077aed3SPierre Pronchery        CIPHER_MODE_DECRYPT,
272*b077aed3SPierre Pronchery        ITM(aes_128_ecb_key)
273*b077aed3SPierre Pronchery    }
274*b077aed3SPierre Pronchery};
275*b077aed3SPierre Pronchery
276*b077aed3SPierre Proncherystatic const char hkdf_digest[] = "SHA256";
277*b077aed3SPierre Proncherystatic const unsigned char hkdf_secret[] = { 's', 'e', 'c', 'r', 'e', 't' };
278*b077aed3SPierre Proncherystatic const unsigned char hkdf_salt[] = { 's', 'a', 'l', 't' };
279*b077aed3SPierre Proncherystatic const unsigned char hkdf_info[] = { 'l', 'a', 'b', 'e', 'l' };
280*b077aed3SPierre Pronchery
281*b077aed3SPierre Proncherystatic const ST_KAT_PARAM hkdf_params[] = {
282*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, hkdf_digest),
283*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, hkdf_secret),
284*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SALT, hkdf_salt),
285*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_INFO, hkdf_info),
286*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
287*b077aed3SPierre Pronchery};
288*b077aed3SPierre Proncherystatic const unsigned char hkdf_expected[] = {
289*b077aed3SPierre Pronchery    0x2a, 0xc4, 0x36, 0x9f, 0x52, 0x59, 0x96, 0xf8,
290*b077aed3SPierre Pronchery    0xde, 0x13
291*b077aed3SPierre Pronchery};
292*b077aed3SPierre Pronchery
293*b077aed3SPierre Proncherystatic const char sskdf_digest[] = "SHA224";
294*b077aed3SPierre Proncherystatic const unsigned char sskdf_secret[] = {
295*b077aed3SPierre Pronchery    0x6d, 0xbd, 0xc2, 0x3f, 0x04, 0x54, 0x88, 0xe4,
296*b077aed3SPierre Pronchery    0x06, 0x27, 0x57, 0xb0, 0x6b, 0x9e, 0xba, 0xe1,
297*b077aed3SPierre Pronchery    0x83, 0xfc, 0x5a, 0x59, 0x46, 0xd8, 0x0d, 0xb9,
298*b077aed3SPierre Pronchery    0x3f, 0xec, 0x6f, 0x62, 0xec, 0x07, 0xe3, 0x72,
299*b077aed3SPierre Pronchery    0x7f, 0x01, 0x26, 0xae, 0xd1, 0x2c, 0xe4, 0xb2,
300*b077aed3SPierre Pronchery    0x62, 0xf4, 0x7d, 0x48, 0xd5, 0x42, 0x87, 0xf8,
301*b077aed3SPierre Pronchery    0x1d, 0x47, 0x4c, 0x7c, 0x3b, 0x18, 0x50, 0xe9
302*b077aed3SPierre Pronchery};
303*b077aed3SPierre Proncherystatic const unsigned char sskdf_otherinfo[] = {
304*b077aed3SPierre Pronchery    0xa1, 0xb2, 0xc3, 0xd4, 0xe5, 0x43, 0x41, 0x56,
305*b077aed3SPierre Pronchery    0x53, 0x69, 0x64, 0x3c, 0x83, 0x2e, 0x98, 0x49,
306*b077aed3SPierre Pronchery    0xdc, 0xdb, 0xa7, 0x1e, 0x9a, 0x31, 0x39, 0xe6,
307*b077aed3SPierre Pronchery    0x06, 0xe0, 0x95, 0xde, 0x3c, 0x26, 0x4a, 0x66,
308*b077aed3SPierre Pronchery    0xe9, 0x8a, 0x16, 0x58, 0x54, 0xcd, 0x07, 0x98,
309*b077aed3SPierre Pronchery    0x9b, 0x1e, 0xe0, 0xec, 0x3f, 0x8d, 0xbe
310*b077aed3SPierre Pronchery};
311*b077aed3SPierre Proncherystatic const unsigned char sskdf_expected[] = {
312*b077aed3SPierre Pronchery    0xa4, 0x62, 0xde, 0x16, 0xa8, 0x9d, 0xe8, 0x46,
313*b077aed3SPierre Pronchery    0x6e, 0xf5, 0x46, 0x0b, 0x47, 0xb8
314*b077aed3SPierre Pronchery};
315*b077aed3SPierre Proncherystatic const ST_KAT_PARAM sskdf_params[] = {
316*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, sskdf_digest),
317*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, sskdf_secret),
318*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_INFO, sskdf_otherinfo),
319*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
320*b077aed3SPierre Pronchery};
321*b077aed3SPierre Pronchery
322*b077aed3SPierre Proncherystatic const char x942kdf_digest[] = "SHA1";
323*b077aed3SPierre Proncherystatic const char x942kdf_cekalg[] = "AES-128-WRAP";
324*b077aed3SPierre Proncherystatic const unsigned char x942kdf_secret[] = {
325*b077aed3SPierre Pronchery    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
326*b077aed3SPierre Pronchery    0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
327*b077aed3SPierre Pronchery    0x10, 0x11, 0x12, 0x13
328*b077aed3SPierre Pronchery};
329*b077aed3SPierre Proncherystatic const unsigned char x942kdf_expected[] = {
330*b077aed3SPierre Pronchery    0xd6, 0xd6, 0xb0, 0x94, 0xc1, 0x02, 0x7a, 0x7d,
331*b077aed3SPierre Pronchery    0xe6, 0xe3, 0x11, 0x72, 0x94, 0xa3, 0x53, 0x64
332*b077aed3SPierre Pronchery};
333*b077aed3SPierre Proncherystatic const ST_KAT_PARAM x942kdf_params[] = {
334*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, x942kdf_digest),
335*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_CEK_ALG, x942kdf_cekalg),
336*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, x942kdf_secret),
337*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
338*b077aed3SPierre Pronchery};
339*b077aed3SPierre Pronchery
340*b077aed3SPierre Proncherystatic const char x963kdf_digest[] = "SHA256";
341*b077aed3SPierre Proncherystatic const unsigned char x963kdf_otherinfo[] = {
342*b077aed3SPierre Pronchery    0x75, 0xee, 0xf8, 0x1a, 0xa3, 0x04, 0x1e, 0x33,
343*b077aed3SPierre Pronchery    0xb8, 0x09, 0x71, 0x20, 0x3d, 0x2c, 0x0c, 0x52
344*b077aed3SPierre Pronchery};
345*b077aed3SPierre Proncherystatic const unsigned char x963kdf_secret[] = {
346*b077aed3SPierre Pronchery    0x22, 0x51, 0x8b, 0x10, 0xe7, 0x0f, 0x2a, 0x3f,
347*b077aed3SPierre Pronchery    0x24, 0x38, 0x10, 0xae, 0x32, 0x54, 0x13, 0x9e,
348*b077aed3SPierre Pronchery    0xfb, 0xee, 0x04, 0xaa, 0x57, 0xc7, 0xaf, 0x7d
349*b077aed3SPierre Pronchery};
350*b077aed3SPierre Proncherystatic const unsigned char x963kdf_expected[] = {
351*b077aed3SPierre Pronchery    0xc4, 0x98, 0xaf, 0x77, 0x16, 0x1c, 0xc5, 0x9f,
352*b077aed3SPierre Pronchery    0x29, 0x62, 0xb9, 0xa7, 0x13, 0xe2, 0xb2, 0x15,
353*b077aed3SPierre Pronchery    0x15, 0x2d, 0x13, 0x97, 0x66, 0xce, 0x34, 0xa7,
354*b077aed3SPierre Pronchery    0x76, 0xdf, 0x11, 0x86, 0x6a, 0x69, 0xbf, 0x2e
355*b077aed3SPierre Pronchery};
356*b077aed3SPierre Proncherystatic const ST_KAT_PARAM x963kdf_params[] = {
357*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, x963kdf_digest),
358*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, x963kdf_secret),
359*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_INFO, x963kdf_otherinfo),
360*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
361*b077aed3SPierre Pronchery};
362*b077aed3SPierre Pronchery
363*b077aed3SPierre Proncherystatic const char pbkdf2_digest[] = "SHA256";
364*b077aed3SPierre Proncherystatic const unsigned char pbkdf2_password[] = {
365*b077aed3SPierre Pronchery    0x70, 0x61, 0x73, 0x73, 0x00, 0x77, 0x6f, 0x72,
366*b077aed3SPierre Pronchery    0x64
367*b077aed3SPierre Pronchery};
368*b077aed3SPierre Proncherystatic const unsigned char pbkdf2_salt[] = {
369*b077aed3SPierre Pronchery    0x73, 0x61, 0x00, 0x6c, 0x74
370*b077aed3SPierre Pronchery};
371*b077aed3SPierre Proncherystatic const unsigned char pbkdf2_expected[] = {
372*b077aed3SPierre Pronchery    0x89, 0xb6, 0x9d, 0x05, 0x16, 0xf8, 0x29, 0x89,
373*b077aed3SPierre Pronchery    0x3c, 0x69, 0x62, 0x26, 0x65, 0x0a, 0x86, 0x87,
374*b077aed3SPierre Pronchery};
375*b077aed3SPierre Proncherystatic int pbkdf2_iterations = 4096;
376*b077aed3SPierre Proncherystatic int pbkdf2_pkcs5 = 1;
377*b077aed3SPierre Proncherystatic const ST_KAT_PARAM pbkdf2_params[] = {
378*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, pbkdf2_digest),
379*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_PASSWORD, pbkdf2_password),
380*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SALT, pbkdf2_salt),
381*b077aed3SPierre Pronchery    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_ITER, pbkdf2_iterations),
382*b077aed3SPierre Pronchery    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_PKCS5, pbkdf2_pkcs5),
383*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
384*b077aed3SPierre Pronchery};
385*b077aed3SPierre Pronchery
386*b077aed3SPierre Proncherystatic const char sshkdf_digest[] = "SHA1";
387*b077aed3SPierre Proncherystatic const char sshkdf_type = EVP_KDF_SSHKDF_TYPE_INITIAL_IV_CLI_TO_SRV;
388*b077aed3SPierre Proncherystatic const unsigned char sshkdf_key[] = {
389*b077aed3SPierre Pronchery    0x00, 0x00, 0x00, 0x80, 0x55, 0xba, 0xe9, 0x31,
390*b077aed3SPierre Pronchery    0xc0, 0x7f, 0xd8, 0x24, 0xbf, 0x10, 0xad, 0xd1,
391*b077aed3SPierre Pronchery    0x90, 0x2b, 0x6f, 0xbc, 0x7c, 0x66, 0x53, 0x47,
392*b077aed3SPierre Pronchery    0x38, 0x34, 0x98, 0xa6, 0x86, 0x92, 0x9f, 0xf5,
393*b077aed3SPierre Pronchery    0xa2, 0x5f, 0x8e, 0x40, 0xcb, 0x66, 0x45, 0xea,
394*b077aed3SPierre Pronchery    0x81, 0x4f, 0xb1, 0xa5, 0xe0, 0xa1, 0x1f, 0x85,
395*b077aed3SPierre Pronchery    0x2f, 0x86, 0x25, 0x56, 0x41, 0xe5, 0xed, 0x98,
396*b077aed3SPierre Pronchery    0x6e, 0x83, 0xa7, 0x8b, 0xc8, 0x26, 0x94, 0x80,
397*b077aed3SPierre Pronchery    0xea, 0xc0, 0xb0, 0xdf, 0xd7, 0x70, 0xca, 0xb9,
398*b077aed3SPierre Pronchery    0x2e, 0x7a, 0x28, 0xdd, 0x87, 0xff, 0x45, 0x24,
399*b077aed3SPierre Pronchery    0x66, 0xd6, 0xae, 0x86, 0x7c, 0xea, 0xd6, 0x3b,
400*b077aed3SPierre Pronchery    0x36, 0x6b, 0x1c, 0x28, 0x6e, 0x6c, 0x48, 0x11,
401*b077aed3SPierre Pronchery    0xa9, 0xf1, 0x4c, 0x27, 0xae, 0xa1, 0x4c, 0x51,
402*b077aed3SPierre Pronchery    0x71, 0xd4, 0x9b, 0x78, 0xc0, 0x6e, 0x37, 0x35,
403*b077aed3SPierre Pronchery    0xd3, 0x6e, 0x6a, 0x3b, 0xe3, 0x21, 0xdd, 0x5f,
404*b077aed3SPierre Pronchery    0xc8, 0x23, 0x08, 0xf3, 0x4e, 0xe1, 0xcb, 0x17,
405*b077aed3SPierre Pronchery    0xfb, 0xa9, 0x4a, 0x59,
406*b077aed3SPierre Pronchery};
407*b077aed3SPierre Proncherystatic const unsigned char sshkdf_xcghash[] = {
408*b077aed3SPierre Pronchery    0xa4, 0xeb, 0xd4, 0x59, 0x34, 0xf5, 0x67, 0x92,
409*b077aed3SPierre Pronchery    0xb5, 0x11, 0x2d, 0xcd, 0x75, 0xa1, 0x07, 0x5f,
410*b077aed3SPierre Pronchery    0xdc, 0x88, 0x92, 0x45,
411*b077aed3SPierre Pronchery};
412*b077aed3SPierre Proncherystatic const unsigned char sshkdf_session_id[] = {
413*b077aed3SPierre Pronchery    0xa4, 0xeb, 0xd4, 0x59, 0x34, 0xf5, 0x67, 0x92,
414*b077aed3SPierre Pronchery    0xb5, 0x11, 0x2d, 0xcd, 0x75, 0xa1, 0x07, 0x5f,
415*b077aed3SPierre Pronchery    0xdc, 0x88, 0x92, 0x45,
416*b077aed3SPierre Pronchery};
417*b077aed3SPierre Proncherystatic const unsigned char sshkdf_expected[] = {
418*b077aed3SPierre Pronchery    0xe2, 0xf6, 0x27, 0xc0, 0xb4, 0x3f, 0x1a, 0xc1,
419*b077aed3SPierre Pronchery};
420*b077aed3SPierre Proncherystatic const ST_KAT_PARAM sshkdf_params[] = {
421*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, sshkdf_digest),
422*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8CHAR(OSSL_KDF_PARAM_SSHKDF_TYPE, sshkdf_type),
423*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, sshkdf_key),
424*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SSHKDF_XCGHASH, sshkdf_xcghash),
425*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SSHKDF_SESSION_ID, sshkdf_session_id),
426*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
427*b077aed3SPierre Pronchery};
428*b077aed3SPierre Pronchery
429*b077aed3SPierre Proncherystatic const char tls12prf_digest[] = "SHA256";
430*b077aed3SPierre Proncherystatic const unsigned char tls12prf_secret[] = {
431*b077aed3SPierre Pronchery    0x20, 0x2c, 0x88, 0xc0, 0x0f, 0x84, 0xa1, 0x7a,
432*b077aed3SPierre Pronchery    0x20, 0x02, 0x70, 0x79, 0x60, 0x47, 0x87, 0x46,
433*b077aed3SPierre Pronchery    0x11, 0x76, 0x45, 0x55, 0x39, 0xe7, 0x05, 0xbe,
434*b077aed3SPierre Pronchery    0x73, 0x08, 0x90, 0x60, 0x2c, 0x28, 0x9a, 0x50,
435*b077aed3SPierre Pronchery    0x01, 0xe3, 0x4e, 0xeb, 0x3a, 0x04, 0x3e, 0x5d,
436*b077aed3SPierre Pronchery    0x52, 0xa6, 0x5e, 0x66, 0x12, 0x51, 0x88, 0xbf,
437*b077aed3SPierre Pronchery};
438*b077aed3SPierre Proncherystatic const unsigned char tls12prf_seed[] = {
439*b077aed3SPierre Pronchery    'k', 'e', 'y', ' ', 'e', 'x', 'p', 'a', 'n', 's', 'i', 'o', 'n',
440*b077aed3SPierre Pronchery    0xae, 0x6c, 0x80, 0x6f, 0x8a, 0xd4, 0xd8, 0x07,
441*b077aed3SPierre Pronchery    0x84, 0x54, 0x9d, 0xff, 0x28, 0xa4, 0xb5, 0x8f,
442*b077aed3SPierre Pronchery    0xd8, 0x37, 0x68, 0x1a, 0x51, 0xd9, 0x28, 0xc3,
443*b077aed3SPierre Pronchery    0xe3, 0x0e, 0xe5, 0xff, 0x14, 0xf3, 0x98, 0x68,
444*b077aed3SPierre Pronchery    0x62, 0xe1, 0xfd, 0x91, 0xf2, 0x3f, 0x55, 0x8a,
445*b077aed3SPierre Pronchery    0x60, 0x5f, 0x28, 0x47, 0x8c, 0x58, 0xcf, 0x72,
446*b077aed3SPierre Pronchery    0x63, 0x7b, 0x89, 0x78, 0x4d, 0x95, 0x9d, 0xf7,
447*b077aed3SPierre Pronchery    0xe9, 0x46, 0xd3, 0xf0, 0x7b, 0xd1, 0xb6, 0x16,
448*b077aed3SPierre Pronchery };
449*b077aed3SPierre Proncherystatic const unsigned char tls12prf_expected[] = {
450*b077aed3SPierre Pronchery    0xd0, 0x61, 0x39, 0x88, 0x9f, 0xff, 0xac, 0x1e,
451*b077aed3SPierre Pronchery    0x3a, 0x71, 0x86, 0x5f, 0x50, 0x4a, 0xa5, 0xd0,
452*b077aed3SPierre Pronchery    0xd2, 0xa2, 0xe8, 0x95, 0x06, 0xc6, 0xf2, 0x27,
453*b077aed3SPierre Pronchery    0x9b, 0x67, 0x0c, 0x3e, 0x1b, 0x74, 0xf5, 0x31,
454*b077aed3SPierre Pronchery    0x01, 0x6a, 0x25, 0x30, 0xc5, 0x1a, 0x3a, 0x0f,
455*b077aed3SPierre Pronchery    0x7e, 0x1d, 0x65, 0x90, 0xd0, 0xf0, 0x56, 0x6b,
456*b077aed3SPierre Pronchery    0x2f, 0x38, 0x7f, 0x8d, 0x11, 0xfd, 0x4f, 0x73,
457*b077aed3SPierre Pronchery    0x1c, 0xdd, 0x57, 0x2d, 0x2e, 0xae, 0x92, 0x7f,
458*b077aed3SPierre Pronchery    0x6f, 0x2f, 0x81, 0x41, 0x0b, 0x25, 0xe6, 0x96,
459*b077aed3SPierre Pronchery    0x0b, 0xe6, 0x89, 0x85, 0xad, 0xd6, 0xc3, 0x84,
460*b077aed3SPierre Pronchery    0x45, 0xad, 0x9f, 0x8c, 0x64, 0xbf, 0x80, 0x68,
461*b077aed3SPierre Pronchery    0xbf, 0x9a, 0x66, 0x79, 0x48, 0x5d, 0x96, 0x6f,
462*b077aed3SPierre Pronchery    0x1a, 0xd6, 0xf6, 0x8b, 0x43, 0x49, 0x5b, 0x10,
463*b077aed3SPierre Pronchery    0xa6, 0x83, 0x75, 0x5e, 0xa2, 0xb8, 0x58, 0xd7,
464*b077aed3SPierre Pronchery    0x0c, 0xca, 0xc7, 0xec, 0x8b, 0x05, 0x3c, 0x6b,
465*b077aed3SPierre Pronchery    0xd4, 0x1c, 0xa2, 0x99, 0xd4, 0xe5, 0x19, 0x28,
466*b077aed3SPierre Pronchery};
467*b077aed3SPierre Proncherystatic const ST_KAT_PARAM tls12prf_params[] = {
468*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, tls12prf_digest),
469*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SECRET, tls12prf_secret),
470*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SEED, tls12prf_seed),
471*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
472*b077aed3SPierre Pronchery};
473*b077aed3SPierre Pronchery
474*b077aed3SPierre Proncherystatic const char kbkdf_digest[] = "SHA256";
475*b077aed3SPierre Proncherystatic const char kbkdf_mac[] = "HMAC";
476*b077aed3SPierre Proncherystatic const unsigned char kbkdf_salt[] = { 'p', 'r', 'f' };
477*b077aed3SPierre Proncherystatic const unsigned char kbkdf_prfinput[] = { 't', 'e', 's', 't' };
478*b077aed3SPierre Proncherystatic unsigned char kbkdf_key[] = {
479*b077aed3SPierre Pronchery    0x37, 0x05, 0xD9, 0x60, 0x80, 0xC1, 0x77, 0x28,
480*b077aed3SPierre Pronchery    0xA0, 0xE8, 0x00, 0xEA, 0xB6, 0xE0, 0xD2, 0x3C,
481*b077aed3SPierre Pronchery};
482*b077aed3SPierre Proncherystatic unsigned char kbkdf_expected[] = {
483*b077aed3SPierre Pronchery    0x9D, 0x18, 0x86, 0x16, 0xF6, 0x38, 0x52, 0xFE,
484*b077aed3SPierre Pronchery    0x86, 0x91, 0x5B, 0xB8, 0x40, 0xB4, 0xA8, 0x86,
485*b077aed3SPierre Pronchery    0xFF, 0x3E, 0x6B, 0xB0, 0xF8, 0x19, 0xB4, 0x9B,
486*b077aed3SPierre Pronchery    0x89, 0x33, 0x93, 0xD3, 0x93, 0x85, 0x42, 0x95,
487*b077aed3SPierre Pronchery};
488*b077aed3SPierre Proncherystatic const ST_KAT_PARAM kbkdf_params[] = {
489*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, kbkdf_digest),
490*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_MAC, kbkdf_mac),
491*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, kbkdf_key),
492*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_SALT, kbkdf_salt),
493*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_INFO, kbkdf_prfinput),
494*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
495*b077aed3SPierre Pronchery};
496*b077aed3SPierre Pronchery
497*b077aed3SPierre Proncherystatic const char tls13_kdf_digest[] = "SHA256";
498*b077aed3SPierre Proncherystatic int tls13_kdf_extract_mode = EVP_KDF_HKDF_MODE_EXTRACT_ONLY;
499*b077aed3SPierre Proncherystatic int tls13_kdf_expand_mode = EVP_KDF_HKDF_MODE_EXPAND_ONLY;
500*b077aed3SPierre Proncherystatic const unsigned char tls13_kdf_prefix[] = {
501*b077aed3SPierre Pronchery    0x74, 0x6C, 0x73, 0x31, 0x33, 0x20          /* "tls13 " */
502*b077aed3SPierre Pronchery};
503*b077aed3SPierre Proncherystatic const unsigned char tls13_kdf_client_early_secret_label[] = {
504*b077aed3SPierre Pronchery    0x63, 0x20, 0x65, 0x20, 0x74, 0x72, 0x61, 0x66,
505*b077aed3SPierre Pronchery    0x66, 0x69, 0x63                            /* "c e traffic"*/
506*b077aed3SPierre Pronchery};
507*b077aed3SPierre Proncherystatic const unsigned char tls13_kdf_psk[] = {
508*b077aed3SPierre Pronchery    0xF8, 0xAF, 0x6A, 0xEA, 0x2D, 0x39, 0x7B, 0xAF,
509*b077aed3SPierre Pronchery    0x29, 0x48, 0xA2, 0x5B, 0x28, 0x34, 0x20, 0x06,
510*b077aed3SPierre Pronchery    0x92, 0xCF, 0xF1, 0x7E, 0xEE, 0x91, 0x65, 0xE4,
511*b077aed3SPierre Pronchery    0xE2, 0x7B, 0xAB, 0xEE, 0x9E, 0xDE, 0xFD, 0x05
512*b077aed3SPierre Pronchery};
513*b077aed3SPierre Proncherystatic const unsigned char tls13_kdf_client_hello_hash[] = {
514*b077aed3SPierre Pronchery    0x7c, 0x92, 0xf6, 0x8b, 0xd5, 0xbf, 0x36, 0x38,
515*b077aed3SPierre Pronchery    0xea, 0x33, 0x8a, 0x64, 0x94, 0x72, 0x2e, 0x1b,
516*b077aed3SPierre Pronchery    0x44, 0x12, 0x7e, 0x1b, 0x7e, 0x8a, 0xad, 0x53,
517*b077aed3SPierre Pronchery    0x5f, 0x23, 0x22, 0xa6, 0x44, 0xff, 0x22, 0xb3
518*b077aed3SPierre Pronchery};
519*b077aed3SPierre Pronchery
520*b077aed3SPierre Proncherystatic const unsigned char tls13_kdf_early_secret[] = {
521*b077aed3SPierre Pronchery    0x15, 0x3B, 0x63, 0x94, 0xA9, 0xC0, 0x3C, 0xF3,
522*b077aed3SPierre Pronchery    0xF5, 0xAC, 0xCC, 0x6E, 0x45, 0x5A, 0x76, 0x93,
523*b077aed3SPierre Pronchery    0x28, 0x11, 0x38, 0xA1, 0xBC, 0xFA, 0x38, 0x03,
524*b077aed3SPierre Pronchery    0xC2, 0x67, 0x35, 0xDD, 0x11, 0x94, 0xD2, 0x16
525*b077aed3SPierre Pronchery};
526*b077aed3SPierre Proncherystatic const unsigned char tls13_kdf_client_early_traffic_secret[] = {
527*b077aed3SPierre Pronchery    0xC8, 0x05, 0x83, 0xA9, 0x0E, 0x99, 0x5C, 0x48,
528*b077aed3SPierre Pronchery    0x96, 0x00, 0x49, 0x2A, 0x5D, 0xA6, 0x42, 0xE6,
529*b077aed3SPierre Pronchery    0xB1, 0xF6, 0x79, 0xBA, 0x67, 0x48, 0x28, 0x79,
530*b077aed3SPierre Pronchery    0x2D, 0xF0, 0x87, 0xB9, 0x39, 0x63, 0x61, 0x71
531*b077aed3SPierre Pronchery};
532*b077aed3SPierre Proncherystatic const ST_KAT_PARAM tls13_kdf_early_secret_params[] = {
533*b077aed3SPierre Pronchery    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_MODE, tls13_kdf_extract_mode),
534*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, tls13_kdf_digest),
535*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, tls13_kdf_psk),
536*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
537*b077aed3SPierre Pronchery};
538*b077aed3SPierre Proncherystatic const ST_KAT_PARAM tls13_kdf_client_early_secret_params[] = {
539*b077aed3SPierre Pronchery    ST_KAT_PARAM_INT(OSSL_KDF_PARAM_MODE, tls13_kdf_expand_mode),
540*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_KDF_PARAM_DIGEST, tls13_kdf_digest),
541*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_KEY, tls13_kdf_early_secret),
542*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_DATA, tls13_kdf_client_hello_hash),
543*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_PREFIX, tls13_kdf_prefix),
544*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_KDF_PARAM_LABEL,
545*b077aed3SPierre Pronchery                       tls13_kdf_client_early_secret_label),
546*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
547*b077aed3SPierre Pronchery};
548*b077aed3SPierre Pronchery
549*b077aed3SPierre Proncherystatic const ST_KAT_KDF st_kat_kdf_tests[] =
550*b077aed3SPierre Pronchery{
551*b077aed3SPierre Pronchery    {
552*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_TLS13_EXTRACT,
553*b077aed3SPierre Pronchery        OSSL_KDF_NAME_TLS1_3_KDF,
554*b077aed3SPierre Pronchery        tls13_kdf_early_secret_params,
555*b077aed3SPierre Pronchery        ITM(tls13_kdf_early_secret)
556*b077aed3SPierre Pronchery    },
557*b077aed3SPierre Pronchery    {
558*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_TLS13_EXPAND,
559*b077aed3SPierre Pronchery        OSSL_KDF_NAME_TLS1_3_KDF,
560*b077aed3SPierre Pronchery        tls13_kdf_client_early_secret_params,
561*b077aed3SPierre Pronchery        ITM(tls13_kdf_client_early_traffic_secret)
562*b077aed3SPierre Pronchery    },
563*b077aed3SPierre Pronchery    {
564*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_TLS12_PRF,
565*b077aed3SPierre Pronchery        OSSL_KDF_NAME_TLS1_PRF,
566*b077aed3SPierre Pronchery        tls12prf_params,
567*b077aed3SPierre Pronchery        ITM(tls12prf_expected)
568*b077aed3SPierre Pronchery    },
569*b077aed3SPierre Pronchery    {
570*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_PBKDF2,
571*b077aed3SPierre Pronchery        OSSL_KDF_NAME_PBKDF2,
572*b077aed3SPierre Pronchery        pbkdf2_params,
573*b077aed3SPierre Pronchery        ITM(pbkdf2_expected)
574*b077aed3SPierre Pronchery    },
575*b077aed3SPierre Pronchery    {
576*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_SSHKDF,
577*b077aed3SPierre Pronchery        OSSL_KDF_NAME_SSHKDF,
578*b077aed3SPierre Pronchery        sshkdf_params,
579*b077aed3SPierre Pronchery        ITM(sshkdf_expected)
580*b077aed3SPierre Pronchery    },
581*b077aed3SPierre Pronchery    {
582*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_KBKDF,
583*b077aed3SPierre Pronchery        OSSL_KDF_NAME_KBKDF,
584*b077aed3SPierre Pronchery        kbkdf_params,
585*b077aed3SPierre Pronchery        ITM(kbkdf_expected)
586*b077aed3SPierre Pronchery    },
587*b077aed3SPierre Pronchery    {
588*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_HKDF,
589*b077aed3SPierre Pronchery        OSSL_KDF_NAME_HKDF,
590*b077aed3SPierre Pronchery        hkdf_params,
591*b077aed3SPierre Pronchery        ITM(hkdf_expected)
592*b077aed3SPierre Pronchery    },
593*b077aed3SPierre Pronchery    {
594*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_SSKDF,
595*b077aed3SPierre Pronchery        OSSL_KDF_NAME_SSKDF,
596*b077aed3SPierre Pronchery        sskdf_params,
597*b077aed3SPierre Pronchery        ITM(sskdf_expected)
598*b077aed3SPierre Pronchery    },
599*b077aed3SPierre Pronchery    {
600*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_X963KDF,
601*b077aed3SPierre Pronchery        OSSL_KDF_NAME_X963KDF,
602*b077aed3SPierre Pronchery        x963kdf_params,
603*b077aed3SPierre Pronchery        ITM(x963kdf_expected)
604*b077aed3SPierre Pronchery    },
605*b077aed3SPierre Pronchery    {
606*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KDF_X942KDF,
607*b077aed3SPierre Pronchery        OSSL_KDF_NAME_X942KDF_ASN1,
608*b077aed3SPierre Pronchery        x942kdf_params,
609*b077aed3SPierre Pronchery        ITM(x942kdf_expected)
610*b077aed3SPierre Pronchery    },
611*b077aed3SPierre Pronchery};
612*b077aed3SPierre Pronchery
613*b077aed3SPierre Pronchery/*-
614*b077aed3SPierre Pronchery* DRBG test vectors are a small subset of
615*b077aed3SPierre Pronchery* https://csrc.nist.rip/groups/STM/cavp/documents/drbg/drbgtestvectors.zip
616*b077aed3SPierre Pronchery* Using the folder drbgvectors_pr_true
617*b077aed3SPierre Pronchery* Generated for CAVS 14.3.
618*b077aed3SPierre Pronchery*/
619*b077aed3SPierre Pronchery
620*b077aed3SPierre Pronchery/*
621*b077aed3SPierre Pronchery * Hash_DRBG.rsp
622*b077aed3SPierre Pronchery *
623*b077aed3SPierre Pronchery * [SHA-256]
624*b077aed3SPierre Pronchery * [PredictionResistance = True]
625*b077aed3SPierre Pronchery * [EntropyInputLen = 256]
626*b077aed3SPierre Pronchery * [NonceLen = 128]
627*b077aed3SPierre Pronchery * [PersonalizationStringLen = 256]
628*b077aed3SPierre Pronchery * [AdditionalInputLen = 256]
629*b077aed3SPierre Pronchery * [ReturnedBitsLen = 1024]
630*b077aed3SPierre Pronchery *
631*b077aed3SPierre Pronchery * COUNT = 14
632*b077aed3SPierre Pronchery */
633*b077aed3SPierre Proncherystatic const unsigned char drbg_hash_sha256_pr_entropyin[] = {
634*b077aed3SPierre Pronchery    0x06, 0x6d, 0xc8, 0xce, 0x75, 0xb2, 0x89, 0x66, 0xa6, 0x85, 0x16, 0x3f,
635*b077aed3SPierre Pronchery    0xe2, 0xa4, 0xd4, 0x27, 0xfb, 0xdb, 0x61, 0x66, 0x50, 0x61, 0x6b, 0xa2,
636*b077aed3SPierre Pronchery    0x82, 0xfc, 0x33, 0x2b, 0x4e, 0x6f, 0x12, 0x20
637*b077aed3SPierre Pronchery};
638*b077aed3SPierre Proncherystatic const unsigned char drbg_hash_sha256_pr_nonce[] = {
639*b077aed3SPierre Pronchery    0x55, 0x9f, 0x7c, 0x64, 0x89, 0x70, 0x83, 0xec, 0x2d, 0x73, 0x70, 0xd9,
640*b077aed3SPierre Pronchery    0xf0, 0xe5, 0x07, 0x1f
641*b077aed3SPierre Pronchery};
642*b077aed3SPierre Proncherystatic const unsigned char drbg_hash_sha256_pr_persstr[] = {
643*b077aed3SPierre Pronchery    0x88, 0x6f, 0x54, 0x9a, 0xad, 0x1a, 0xc6, 0x3d, 0x18, 0xcb, 0xcc, 0x66,
644*b077aed3SPierre Pronchery    0x85, 0xda, 0xa2, 0xc2, 0xf7, 0x9e, 0xb0, 0x89, 0x4c, 0xb4, 0xae, 0xf1,
645*b077aed3SPierre Pronchery    0xac, 0x54, 0x4f, 0xce, 0x57, 0xf1, 0x5e, 0x11
646*b077aed3SPierre Pronchery};
647*b077aed3SPierre Proncherystatic const unsigned char drbg_hash_sha256_pr_entropyinpr0[] = {
648*b077aed3SPierre Pronchery    0xff, 0x80, 0xb7, 0xd2, 0x6a, 0x05, 0xbc, 0x8a, 0x7a, 0xbe, 0x53, 0x28,
649*b077aed3SPierre Pronchery    0x6b, 0x0e, 0xeb, 0x73, 0x3b, 0x71, 0x5a, 0x20, 0x5b, 0xfa, 0x4f, 0xf6,
650*b077aed3SPierre Pronchery    0x37, 0x03, 0xde, 0xad, 0xb6, 0xea, 0x0e, 0xf4
651*b077aed3SPierre Pronchery};
652*b077aed3SPierre Proncherystatic const unsigned char drbg_hash_sha256_pr_entropyinpr1[] = {
653*b077aed3SPierre Pronchery    0xc7, 0x38, 0x32, 0x53, 0x46, 0x81, 0xed, 0xe3, 0x7e, 0x03, 0x84, 0x6d,
654*b077aed3SPierre Pronchery    0x3c, 0x84, 0x17, 0x67, 0x29, 0x7d, 0x24, 0x6c, 0x68, 0x92, 0x41, 0xd2,
655*b077aed3SPierre Pronchery    0xe7, 0x75, 0xbe, 0x7e, 0xc9, 0x96, 0x29, 0x3d
656*b077aed3SPierre Pronchery};
657*b077aed3SPierre Proncherystatic const unsigned char drbg_hash_sha256_pr_addin0[] = {
658*b077aed3SPierre Pronchery    0xb7, 0x21, 0x5f, 0x14, 0xac, 0x7b, 0xaf, 0xd0, 0xa9, 0x17, 0x72, 0xba,
659*b077aed3SPierre Pronchery    0x22, 0xf7, 0x19, 0xaf, 0xbd, 0x20, 0xb3, 0x11, 0x63, 0x6c, 0x2b, 0x1e,
660*b077aed3SPierre Pronchery    0x83, 0xe4, 0xa8, 0x23, 0x35, 0x3f, 0xc6, 0xea
661*b077aed3SPierre Pronchery};
662*b077aed3SPierre Proncherystatic const unsigned char drbg_hash_sha256_pr_addin1[] = {
663*b077aed3SPierre Pronchery    0xce, 0xd3, 0x1f, 0x7e, 0x0d, 0xae, 0x5b, 0xb5, 0xc0, 0x43, 0xe2, 0x46,
664*b077aed3SPierre Pronchery    0xb2, 0x94, 0x73, 0xe2, 0xfd, 0x39, 0x51, 0x2e, 0xad, 0x45, 0x69, 0xee,
665*b077aed3SPierre Pronchery    0xe3, 0xe3, 0x80, 0x33, 0x14, 0xab, 0xa7, 0xa3
666*b077aed3SPierre Pronchery};
667*b077aed3SPierre Proncherystatic const unsigned char drbg_hash_sha256_pr_expected[] = {
668*b077aed3SPierre Pronchery    0x60, 0xc2, 0x34, 0xcf, 0xaf, 0xb4, 0x68, 0x03, 0x3b, 0xf1, 0x95, 0xe5,
669*b077aed3SPierre Pronchery    0x78, 0xce, 0x26, 0x6e, 0x14, 0x65, 0x32, 0x6a, 0x96, 0xa9, 0xe0, 0x3f,
670*b077aed3SPierre Pronchery    0x8b, 0x89, 0x36, 0x70, 0xef, 0x62, 0x75, 0x4d, 0x5e, 0x80, 0xd5, 0x53,
671*b077aed3SPierre Pronchery    0xa1, 0xf8, 0x49, 0x50, 0x20, 0x8b, 0x93, 0x43, 0x07, 0x9f, 0x2e, 0xf8,
672*b077aed3SPierre Pronchery    0x56, 0xe9, 0xc5, 0x70, 0x61, 0x85, 0x97, 0xb5, 0xdc, 0x82, 0xa2, 0xda,
673*b077aed3SPierre Pronchery    0xea, 0xa3, 0xfd, 0x9b, 0x2f, 0xd2, 0xa0, 0xd7, 0x1b, 0xc6, 0x29, 0x35,
674*b077aed3SPierre Pronchery    0xcc, 0xb8, 0x3d, 0xa0, 0x67, 0x98, 0x05, 0xa0, 0xe3, 0x1e, 0xfe, 0xe4,
675*b077aed3SPierre Pronchery    0xf0, 0xe5, 0x13, 0xb0, 0x83, 0x17, 0xfa, 0xca, 0x93, 0x5e, 0x38, 0x29,
676*b077aed3SPierre Pronchery    0x48, 0xd2, 0x72, 0xdb, 0x76, 0x3e, 0x6d, 0xf3, 0x25, 0x10, 0xff, 0x1b,
677*b077aed3SPierre Pronchery    0x99, 0xff, 0xf8, 0xc6, 0x0e, 0xb0, 0xdd, 0x29, 0x2e, 0xbc, 0xbb, 0xc8,
678*b077aed3SPierre Pronchery    0x0a, 0x01, 0x6e, 0xd3, 0xb0, 0x0e, 0x4e, 0xab
679*b077aed3SPierre Pronchery};
680*b077aed3SPierre Pronchery
681*b077aed3SPierre Pronchery/*
682*b077aed3SPierre Pronchery * CTR_DRBG.rsp
683*b077aed3SPierre Pronchery *
684*b077aed3SPierre Pronchery * [AES-128 use df]
685*b077aed3SPierre Pronchery * [PredictionResistance = True]
686*b077aed3SPierre Pronchery * [EntropyInputLen = 128]
687*b077aed3SPierre Pronchery * [NonceLen = 64]
688*b077aed3SPierre Pronchery * [PersonalizationStringLen = 128]
689*b077aed3SPierre Pronchery * [AdditionalInputLen = 128]
690*b077aed3SPierre Pronchery * [ReturnedBitsLen = 512]
691*b077aed3SPierre Pronchery *
692*b077aed3SPierre Pronchery * COUNT = 0
693*b077aed3SPierre Pronchery */
694*b077aed3SPierre Proncherystatic const unsigned char drbg_ctr_aes128_pr_df_entropyin[] = {
695*b077aed3SPierre Pronchery    0x92, 0x89, 0x8f, 0x31, 0xfa, 0x1c, 0xff, 0x6d, 0x18, 0x2f, 0x26, 0x06,
696*b077aed3SPierre Pronchery    0x43, 0xdf, 0xf8, 0x18
697*b077aed3SPierre Pronchery};
698*b077aed3SPierre Proncherystatic const unsigned char drbg_ctr_aes128_pr_df_nonce[] = {
699*b077aed3SPierre Pronchery    0xc2, 0xa4, 0xd9, 0x72, 0xc3, 0xb9, 0xb6, 0x97
700*b077aed3SPierre Pronchery};
701*b077aed3SPierre Proncherystatic const unsigned char drbg_ctr_aes128_pr_df_persstr[] = {
702*b077aed3SPierre Pronchery    0xea, 0x65, 0xee, 0x60, 0x26, 0x4e, 0x7e, 0xb6, 0x0e, 0x82, 0x68, 0xc4,
703*b077aed3SPierre Pronchery    0x37, 0x3c, 0x5c, 0x0b
704*b077aed3SPierre Pronchery};
705*b077aed3SPierre Proncherystatic const unsigned char drbg_ctr_aes128_pr_df_entropyinpr0[] = {
706*b077aed3SPierre Pronchery    0x20, 0x72, 0x8a, 0x06, 0xf8, 0x6f, 0x8d, 0xd4, 0x41, 0xe2, 0x72, 0xb7,
707*b077aed3SPierre Pronchery    0xc4, 0x2c, 0xe8, 0x10
708*b077aed3SPierre Pronchery};
709*b077aed3SPierre Proncherystatic const unsigned char drbg_ctr_aes128_pr_df_entropyinpr1[] = {
710*b077aed3SPierre Pronchery    0x3d, 0xb0, 0xf0, 0x94, 0xf3, 0x05, 0x50, 0x33, 0x17, 0x86, 0x3e, 0x22,
711*b077aed3SPierre Pronchery    0x08, 0xf7, 0xa5, 0x01
712*b077aed3SPierre Pronchery};
713*b077aed3SPierre Proncherystatic const unsigned char drbg_ctr_aes128_pr_df_addin0[] = {
714*b077aed3SPierre Pronchery    0x1a, 0x40, 0xfa, 0xe3, 0xcc, 0x6c, 0x7c, 0xa0, 0xf8, 0xda, 0xba, 0x59,
715*b077aed3SPierre Pronchery    0x23, 0x6d, 0xad, 0x1d
716*b077aed3SPierre Pronchery};
717*b077aed3SPierre Proncherystatic const unsigned char drbg_ctr_aes128_pr_df_addin1[] = {
718*b077aed3SPierre Pronchery    0x9f, 0x72, 0x76, 0x6c, 0xc7, 0x46, 0xe5, 0xed, 0x2e, 0x53, 0x20, 0x12,
719*b077aed3SPierre Pronchery    0xbc, 0x59, 0x31, 0x8c
720*b077aed3SPierre Pronchery};
721*b077aed3SPierre Proncherystatic const unsigned char drbg_ctr_aes128_pr_df_expected[] = {
722*b077aed3SPierre Pronchery    0x5a, 0x35, 0x39, 0x87, 0x0f, 0x4d, 0x22, 0xa4, 0x09, 0x24, 0xee, 0x71,
723*b077aed3SPierre Pronchery    0xc9, 0x6f, 0xac, 0x72, 0x0a, 0xd6, 0xf0, 0x88, 0x82, 0xd0, 0x83, 0x28,
724*b077aed3SPierre Pronchery    0x73, 0xec, 0x3f, 0x93, 0xd8, 0xab, 0x45, 0x23, 0xf0, 0x7e, 0xac, 0x45,
725*b077aed3SPierre Pronchery    0x14, 0x5e, 0x93, 0x9f, 0xb1, 0xd6, 0x76, 0x43, 0x3d, 0xb6, 0xe8, 0x08,
726*b077aed3SPierre Pronchery    0x88, 0xf6, 0xda, 0x89, 0x08, 0x77, 0x42, 0xfe, 0x1a, 0xf4, 0x3f, 0xc4,
727*b077aed3SPierre Pronchery    0x23, 0xc5, 0x1f, 0x68
728*b077aed3SPierre Pronchery};
729*b077aed3SPierre Pronchery
730*b077aed3SPierre Pronchery/*
731*b077aed3SPierre Pronchery * HMAC_DRBG.rsp
732*b077aed3SPierre Pronchery *
733*b077aed3SPierre Pronchery * [SHA-1]
734*b077aed3SPierre Pronchery * [PredictionResistance = True]
735*b077aed3SPierre Pronchery * [EntropyInputLen = 128]
736*b077aed3SPierre Pronchery * [NonceLen = 64]
737*b077aed3SPierre Pronchery * [PersonalizationStringLen = 128]
738*b077aed3SPierre Pronchery * [AdditionalInputLen = 128]
739*b077aed3SPierre Pronchery * [ReturnedBitsLen = 640]
740*b077aed3SPierre Pronchery *
741*b077aed3SPierre Pronchery * COUNT = 0
742*b077aed3SPierre Pronchery */
743*b077aed3SPierre Proncherystatic const unsigned char drbg_hmac_sha1_pr_entropyin[] = {
744*b077aed3SPierre Pronchery    0x68, 0x0f, 0xac, 0xe9, 0x0d, 0x7b, 0xca, 0x21, 0xd4, 0xa0, 0xed, 0xb7,
745*b077aed3SPierre Pronchery    0x79, 0x9e, 0xe5, 0xd8
746*b077aed3SPierre Pronchery};
747*b077aed3SPierre Proncherystatic const unsigned char drbg_hmac_sha1_pr_nonce[] = {
748*b077aed3SPierre Pronchery    0xb7, 0xbe, 0x9e, 0xed, 0xdd, 0x0e, 0x3b, 0x4b
749*b077aed3SPierre Pronchery};
750*b077aed3SPierre Proncherystatic const unsigned char drbg_hmac_sha1_pr_persstr[] = {
751*b077aed3SPierre Pronchery    0xf5, 0x8c, 0x40, 0xae, 0x70, 0xf7, 0xa5, 0x56, 0x48, 0xa9, 0x31, 0xa0,
752*b077aed3SPierre Pronchery    0xa9, 0x31, 0x3d, 0xd7
753*b077aed3SPierre Pronchery};
754*b077aed3SPierre Proncherystatic const unsigned char drbg_hmac_sha1_pr_entropyinpr0[] = {
755*b077aed3SPierre Pronchery    0x7c, 0xaf, 0xe2, 0x31, 0x63, 0x0a, 0xa9, 0x5a, 0x74, 0x2c, 0x4e, 0x5f,
756*b077aed3SPierre Pronchery    0x5f, 0x22, 0xc6, 0xa4
757*b077aed3SPierre Pronchery};
758*b077aed3SPierre Proncherystatic const unsigned char drbg_hmac_sha1_pr_entropyinpr1[] = {
759*b077aed3SPierre Pronchery    0x1c, 0x0d, 0x77, 0x92, 0x89, 0x88, 0x27, 0x94, 0x8a, 0x58, 0x9f, 0x82,
760*b077aed3SPierre Pronchery    0x2d, 0x1a, 0xf7, 0xa6
761*b077aed3SPierre Pronchery};
762*b077aed3SPierre Proncherystatic const unsigned char drbg_hmac_sha1_pr_addin0[] = {
763*b077aed3SPierre Pronchery    0xdc, 0x36, 0x63, 0xf0, 0x62, 0x78, 0x9c, 0xd1, 0x5c, 0xbb, 0x20, 0xc3,
764*b077aed3SPierre Pronchery    0xc1, 0x8c, 0xd9, 0xd7
765*b077aed3SPierre Pronchery};
766*b077aed3SPierre Proncherystatic const unsigned char drbg_hmac_sha1_pr_addin1[] = {
767*b077aed3SPierre Pronchery    0xfe, 0x85, 0xb0, 0xab, 0x14, 0xc6, 0x96, 0xe6, 0x9c, 0x24, 0xe7, 0xb5,
768*b077aed3SPierre Pronchery    0xa1, 0x37, 0x12, 0x0c
769*b077aed3SPierre Pronchery};
770*b077aed3SPierre Proncherystatic const unsigned char drbg_hmac_sha1_pr_expected[] = {
771*b077aed3SPierre Pronchery    0x68, 0x00, 0x4b, 0x3a, 0x28, 0xf7, 0xf0, 0x1c, 0xf9, 0xe9, 0xb5, 0x71,
772*b077aed3SPierre Pronchery    0x20, 0x79, 0xef, 0x80, 0x87, 0x1b, 0x08, 0xb9, 0xa9, 0x1b, 0xcd, 0x2b,
773*b077aed3SPierre Pronchery    0x9f, 0x09, 0x4d, 0xa4, 0x84, 0x80, 0xb3, 0x4c, 0xaf, 0xd5, 0x59, 0x6b,
774*b077aed3SPierre Pronchery    0x0c, 0x0a, 0x48, 0xe1, 0x48, 0xda, 0xbc, 0x6f, 0x77, 0xb8, 0xff, 0xaf,
775*b077aed3SPierre Pronchery    0x18, 0x70, 0x28, 0xe1, 0x04, 0x13, 0x7a, 0x4f, 0xeb, 0x1c, 0x72, 0xb0,
776*b077aed3SPierre Pronchery    0xc4, 0x4f, 0xe8, 0xb1, 0xaf, 0xab, 0xa5, 0xbc, 0xfd, 0x86, 0x67, 0xf2,
777*b077aed3SPierre Pronchery    0xf5, 0x5b, 0x46, 0x06, 0x63, 0x2e, 0x3c, 0xbc
778*b077aed3SPierre Pronchery};
779*b077aed3SPierre Pronchery
780*b077aed3SPierre Proncherystatic const ST_KAT_DRBG st_kat_drbg_tests[] =
781*b077aed3SPierre Pronchery{
782*b077aed3SPierre Pronchery    {
783*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_DRBG_HASH,
784*b077aed3SPierre Pronchery        "HASH-DRBG", "digest", "SHA256",
785*b077aed3SPierre Pronchery        ITM(drbg_hash_sha256_pr_entropyin),
786*b077aed3SPierre Pronchery        ITM(drbg_hash_sha256_pr_nonce),
787*b077aed3SPierre Pronchery        ITM(drbg_hash_sha256_pr_persstr),
788*b077aed3SPierre Pronchery        ITM(drbg_hash_sha256_pr_entropyinpr0),
789*b077aed3SPierre Pronchery        ITM(drbg_hash_sha256_pr_entropyinpr1),
790*b077aed3SPierre Pronchery        ITM(drbg_hash_sha256_pr_addin0),
791*b077aed3SPierre Pronchery        ITM(drbg_hash_sha256_pr_addin1),
792*b077aed3SPierre Pronchery        ITM(drbg_hash_sha256_pr_expected)
793*b077aed3SPierre Pronchery    },
794*b077aed3SPierre Pronchery    {
795*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_DRBG_CTR,
796*b077aed3SPierre Pronchery        "CTR-DRBG", "cipher", "AES-128-CTR",
797*b077aed3SPierre Pronchery        ITM(drbg_ctr_aes128_pr_df_entropyin),
798*b077aed3SPierre Pronchery        ITM(drbg_ctr_aes128_pr_df_nonce),
799*b077aed3SPierre Pronchery        ITM(drbg_ctr_aes128_pr_df_persstr),
800*b077aed3SPierre Pronchery        ITM(drbg_ctr_aes128_pr_df_entropyinpr0),
801*b077aed3SPierre Pronchery        ITM(drbg_ctr_aes128_pr_df_entropyinpr1),
802*b077aed3SPierre Pronchery        ITM(drbg_ctr_aes128_pr_df_addin0),
803*b077aed3SPierre Pronchery        ITM(drbg_ctr_aes128_pr_df_addin1),
804*b077aed3SPierre Pronchery        ITM(drbg_ctr_aes128_pr_df_expected)
805*b077aed3SPierre Pronchery    },
806*b077aed3SPierre Pronchery    {
807*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_DRBG_HMAC,
808*b077aed3SPierre Pronchery        "HMAC-DRBG", "digest", "SHA1",
809*b077aed3SPierre Pronchery        ITM(drbg_hmac_sha1_pr_entropyin),
810*b077aed3SPierre Pronchery        ITM(drbg_hmac_sha1_pr_nonce),
811*b077aed3SPierre Pronchery        ITM(drbg_hmac_sha1_pr_persstr),
812*b077aed3SPierre Pronchery        ITM(drbg_hmac_sha1_pr_entropyinpr0),
813*b077aed3SPierre Pronchery        ITM(drbg_hmac_sha1_pr_entropyinpr1),
814*b077aed3SPierre Pronchery        ITM(drbg_hmac_sha1_pr_addin0),
815*b077aed3SPierre Pronchery        ITM(drbg_hmac_sha1_pr_addin1),
816*b077aed3SPierre Pronchery        ITM(drbg_hmac_sha1_pr_expected)
817*b077aed3SPierre Pronchery    }
818*b077aed3SPierre Pronchery};
819*b077aed3SPierre Pronchery
820*b077aed3SPierre Pronchery/* KEY EXCHANGE TEST DATA */
821*b077aed3SPierre Pronchery
822*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DH
823*b077aed3SPierre Pronchery/* DH KAT */
824*b077aed3SPierre Proncherystatic const unsigned char dh_p[] = {
825*b077aed3SPierre Pronchery    0xdc, 0xca, 0x15, 0x11, 0xb2, 0x31, 0x32, 0x25,
826*b077aed3SPierre Pronchery    0xf5, 0x21, 0x16, 0xe1, 0x54, 0x27, 0x89, 0xe0,
827*b077aed3SPierre Pronchery    0x01, 0xf0, 0x42, 0x5b, 0xcc, 0xc7, 0xf3, 0x66,
828*b077aed3SPierre Pronchery    0xf7, 0x40, 0x64, 0x07, 0xf1, 0xc9, 0xfa, 0x8b,
829*b077aed3SPierre Pronchery    0xe6, 0x10, 0xf1, 0x77, 0x8b, 0xb1, 0x70, 0xbe,
830*b077aed3SPierre Pronchery    0x39, 0xdb, 0xb7, 0x6f, 0x85, 0xbf, 0x24, 0xce,
831*b077aed3SPierre Pronchery    0x68, 0x80, 0xad, 0xb7, 0x62, 0x9f, 0x7c, 0x6d,
832*b077aed3SPierre Pronchery    0x01, 0x5e, 0x61, 0xd4, 0x3f, 0xa3, 0xee, 0x4d,
833*b077aed3SPierre Pronchery    0xe1, 0x85, 0xf2, 0xcf, 0xd0, 0x41, 0xff, 0xde,
834*b077aed3SPierre Pronchery    0x9d, 0x41, 0x84, 0x07, 0xe1, 0x51, 0x38, 0xbb,
835*b077aed3SPierre Pronchery    0x02, 0x1d, 0xae, 0xb3, 0x5f, 0x76, 0x2d, 0x17,
836*b077aed3SPierre Pronchery    0x82, 0xac, 0xc6, 0x58, 0xd3, 0x2b, 0xd4, 0xb0,
837*b077aed3SPierre Pronchery    0x23, 0x2c, 0x92, 0x7d, 0xd3, 0x8f, 0xa0, 0x97,
838*b077aed3SPierre Pronchery    0xb3, 0xd1, 0x85, 0x9f, 0xa8, 0xac, 0xaf, 0xb9,
839*b077aed3SPierre Pronchery    0x8f, 0x06, 0x66, 0x08, 0xfc, 0x64, 0x4e, 0xc7,
840*b077aed3SPierre Pronchery    0xdd, 0xb6, 0xf0, 0x85, 0x99, 0xf9, 0x2a, 0xc1,
841*b077aed3SPierre Pronchery    0xb5, 0x98, 0x25, 0xda, 0x84, 0x32, 0x07, 0x7d,
842*b077aed3SPierre Pronchery    0xef, 0x69, 0x56, 0x46, 0x06, 0x3c, 0x20, 0x82,
843*b077aed3SPierre Pronchery    0x3c, 0x95, 0x07, 0xab, 0x6f, 0x01, 0x76, 0xd4,
844*b077aed3SPierre Pronchery    0x73, 0x0d, 0x99, 0x0d, 0xbb, 0xe6, 0x36, 0x1c,
845*b077aed3SPierre Pronchery    0xd8, 0xb2, 0xb9, 0x4d, 0x3d, 0x2f, 0x32, 0x9b,
846*b077aed3SPierre Pronchery    0x82, 0x09, 0x9b, 0xd6, 0x61, 0xf4, 0x29, 0x50,
847*b077aed3SPierre Pronchery    0xf4, 0x03, 0xdf, 0x3e, 0xde, 0x62, 0xa3, 0x31,
848*b077aed3SPierre Pronchery    0x88, 0xb0, 0x27, 0x98, 0xba, 0x82, 0x3f, 0x44,
849*b077aed3SPierre Pronchery    0xb9, 0x46, 0xfe, 0x9d, 0xf6, 0x77, 0xa0, 0xc5,
850*b077aed3SPierre Pronchery    0xa1, 0x23, 0x8e, 0xaa, 0x97, 0xb7, 0x0f, 0x80,
851*b077aed3SPierre Pronchery    0xda, 0x8c, 0xac, 0x88, 0xe0, 0x92, 0xb1, 0x12,
852*b077aed3SPierre Pronchery    0x70, 0x60, 0xff, 0xbf, 0x45, 0x57, 0x99, 0x94,
853*b077aed3SPierre Pronchery    0x01, 0x1d, 0xc2, 0xfa, 0xa5, 0xe7, 0xf6, 0xc7,
854*b077aed3SPierre Pronchery    0x62, 0x45, 0xe1, 0xcc, 0x31, 0x22, 0x31, 0xc1,
855*b077aed3SPierre Pronchery    0x7d, 0x1c, 0xa6, 0xb1, 0x90, 0x07, 0xef, 0x0d,
856*b077aed3SPierre Pronchery    0xb9, 0x9f, 0x9c, 0xb6, 0x0e, 0x1d, 0x5f, 0x69
857*b077aed3SPierre Pronchery};
858*b077aed3SPierre Proncherystatic const unsigned char dh_q[] = {
859*b077aed3SPierre Pronchery    0x89, 0x8b, 0x22, 0x67, 0x17, 0xef, 0x03, 0x9e,
860*b077aed3SPierre Pronchery    0x60, 0x3e, 0x82, 0xe5, 0xc7, 0xaf, 0xe4, 0x83,
861*b077aed3SPierre Pronchery    0x74, 0xac, 0x5f, 0x62, 0x5c, 0x54, 0xf1, 0xea,
862*b077aed3SPierre Pronchery    0x11, 0xac, 0xb5, 0x7d
863*b077aed3SPierre Pronchery};
864*b077aed3SPierre Proncherystatic const unsigned char dh_g[] = {
865*b077aed3SPierre Pronchery    0x5e, 0xf7, 0xb8, 0x8f, 0x2d, 0xf6, 0x01, 0x39,
866*b077aed3SPierre Pronchery    0x35, 0x1d, 0xfb, 0xfe, 0x12, 0x66, 0x80, 0x5f,
867*b077aed3SPierre Pronchery    0xdf, 0x35, 0x6c, 0xdf, 0xd1, 0x3a, 0x4d, 0xa0,
868*b077aed3SPierre Pronchery    0x05, 0x0c, 0x7e, 0xde, 0x24, 0x6d, 0xf5, 0x9f,
869*b077aed3SPierre Pronchery    0x6a, 0xbf, 0x96, 0xad, 0xe5, 0xf2, 0xb2, 0x8f,
870*b077aed3SPierre Pronchery    0xfe, 0x88, 0xd6, 0xbc, 0xe7, 0xf7, 0x89, 0x4a,
871*b077aed3SPierre Pronchery    0x3d, 0x53, 0x5f, 0xc8, 0x21, 0x26, 0xdd, 0xd4,
872*b077aed3SPierre Pronchery    0x24, 0x87, 0x2e, 0x16, 0xb8, 0x38, 0xdf, 0x8c,
873*b077aed3SPierre Pronchery    0x51, 0xe9, 0x01, 0x6f, 0x88, 0x9c, 0x7c, 0x20,
874*b077aed3SPierre Pronchery    0x3e, 0x98, 0xa8, 0xb6, 0x31, 0xf9, 0xc7, 0x25,
875*b077aed3SPierre Pronchery    0x63, 0xd3, 0x8a, 0x49, 0x58, 0x9a, 0x07, 0x53,
876*b077aed3SPierre Pronchery    0xd3, 0x58, 0xe7, 0x83, 0x31, 0x8c, 0xef, 0xd9,
877*b077aed3SPierre Pronchery    0x67, 0x7c, 0x7b, 0x2d, 0xbb, 0x77, 0xd6, 0xdc,
878*b077aed3SPierre Pronchery    0xe2, 0xa1, 0x96, 0x37, 0x95, 0xca, 0x64, 0xb9,
879*b077aed3SPierre Pronchery    0x2d, 0x1c, 0x9a, 0xac, 0x6d, 0x0e, 0x8d, 0x43,
880*b077aed3SPierre Pronchery    0x1d, 0xe5, 0xe5, 0x00, 0x60, 0xdf, 0xf7, 0x86,
881*b077aed3SPierre Pronchery    0x89, 0xc9, 0xec, 0xa1, 0xc1, 0x24, 0x8c, 0x16,
882*b077aed3SPierre Pronchery    0xed, 0x09, 0xc7, 0xad, 0x41, 0x2a, 0x17, 0x40,
883*b077aed3SPierre Pronchery    0x6d, 0x2b, 0x52, 0x5a, 0xa1, 0xca, 0xbb, 0x23,
884*b077aed3SPierre Pronchery    0x7b, 0x97, 0x34, 0xec, 0x7b, 0x8c, 0xe3, 0xfa,
885*b077aed3SPierre Pronchery    0xe0, 0x2f, 0x29, 0xc5, 0xef, 0xed, 0x30, 0xd6,
886*b077aed3SPierre Pronchery    0x91, 0x87, 0xda, 0x10, 0x9c, 0x2c, 0x9f, 0xe2,
887*b077aed3SPierre Pronchery    0xaa, 0xdb, 0xb0, 0xc2, 0x2a, 0xf5, 0x4c, 0x61,
888*b077aed3SPierre Pronchery    0x66, 0x55, 0x00, 0x0c, 0x43, 0x1c, 0x6b, 0x4a,
889*b077aed3SPierre Pronchery    0x37, 0x97, 0x63, 0xb0, 0xa9, 0x16, 0x58, 0xef,
890*b077aed3SPierre Pronchery    0xc8, 0x4e, 0x8b, 0x06, 0x35, 0x8c, 0x8b, 0x4f,
891*b077aed3SPierre Pronchery    0x21, 0x37, 0x10, 0xfd, 0x10, 0x17, 0x2c, 0xf3,
892*b077aed3SPierre Pronchery    0x9b, 0x83, 0x0c, 0x2d, 0xd8, 0x4a, 0x0c, 0x8a,
893*b077aed3SPierre Pronchery    0xb8, 0x25, 0x16, 0xec, 0xab, 0x99, 0x5f, 0xa4,
894*b077aed3SPierre Pronchery    0x21, 0x5e, 0x02, 0x3e, 0x4e, 0xcf, 0x80, 0x74,
895*b077aed3SPierre Pronchery    0xc3, 0x9d, 0x6c, 0x88, 0xb7, 0x0d, 0x1e, 0xe4,
896*b077aed3SPierre Pronchery    0xe9, 0x6f, 0xdc, 0x20, 0xea, 0x11, 0x5c, 0x32
897*b077aed3SPierre Pronchery};
898*b077aed3SPierre Proncherystatic const unsigned char dh_priv[] = {
899*b077aed3SPierre Pronchery    0x14, 0x33, 0xe0, 0xb5, 0xa9, 0x17, 0xb6, 0x0a,
900*b077aed3SPierre Pronchery    0x30, 0x23, 0xf2, 0xf8, 0xaa, 0x2c, 0x2d, 0x70,
901*b077aed3SPierre Pronchery    0xd2, 0x96, 0x8a, 0xba, 0x9a, 0xea, 0xc8, 0x15,
902*b077aed3SPierre Pronchery    0x40, 0xb8, 0xfc, 0xe6
903*b077aed3SPierre Pronchery};
904*b077aed3SPierre Proncherystatic const unsigned char dh_pub[] = {
905*b077aed3SPierre Pronchery    0x95, 0xdd, 0x33, 0x8d, 0x29, 0xe5, 0x71, 0x04,
906*b077aed3SPierre Pronchery    0x92, 0xb9, 0x18, 0x31, 0x7b, 0x72, 0xa3, 0x69,
907*b077aed3SPierre Pronchery    0x36, 0xe1, 0x95, 0x1a, 0x2e, 0xe5, 0xa5, 0x59,
908*b077aed3SPierre Pronchery    0x16, 0x99, 0xc0, 0x48, 0x6d, 0x0d, 0x4f, 0x9b,
909*b077aed3SPierre Pronchery    0xdd, 0x6d, 0x5a, 0x3f, 0x6b, 0x98, 0x89, 0x0c,
910*b077aed3SPierre Pronchery    0x62, 0xb3, 0x76, 0x52, 0xd3, 0x6e, 0x71, 0x21,
911*b077aed3SPierre Pronchery    0x11, 0xe6, 0x8a, 0x73, 0x55, 0x37, 0x25, 0x06,
912*b077aed3SPierre Pronchery    0x99, 0xef, 0xe3, 0x30, 0x53, 0x73, 0x91, 0xfb,
913*b077aed3SPierre Pronchery    0xc2, 0xc5, 0x48, 0xbc, 0x5a, 0xc3, 0xe5, 0xb2,
914*b077aed3SPierre Pronchery    0x33, 0x86, 0xc3, 0xee, 0xf5, 0xeb, 0x43, 0xc0,
915*b077aed3SPierre Pronchery    0x99, 0xd7, 0x0a, 0x52, 0x02, 0x68, 0x7e, 0x83,
916*b077aed3SPierre Pronchery    0x96, 0x42, 0x48, 0xfc, 0xa9, 0x1f, 0x40, 0x90,
917*b077aed3SPierre Pronchery    0x8e, 0x8f, 0xb3, 0x31, 0x93, 0x15, 0xf6, 0xd2,
918*b077aed3SPierre Pronchery    0x60, 0x6d, 0x7f, 0x7c, 0xd5, 0x2c, 0xc6, 0xe7,
919*b077aed3SPierre Pronchery    0xc5, 0x84, 0x3a, 0xfb, 0x22, 0x51, 0x9c, 0xf0,
920*b077aed3SPierre Pronchery    0xf0, 0xf9, 0xd3, 0xa0, 0xa4, 0xe8, 0xc8, 0x88,
921*b077aed3SPierre Pronchery    0x99, 0xef, 0xed, 0xe7, 0x36, 0x43, 0x51, 0xfb,
922*b077aed3SPierre Pronchery    0x6a, 0x36, 0x3e, 0xe7, 0x17, 0xe5, 0x44, 0x5a,
923*b077aed3SPierre Pronchery    0xda, 0xb4, 0xc9, 0x31, 0xa6, 0x48, 0x39, 0x97,
924*b077aed3SPierre Pronchery    0xb8, 0x7d, 0xad, 0x83, 0x67, 0x7e, 0x4d, 0x1d,
925*b077aed3SPierre Pronchery    0x3a, 0x77, 0x75, 0xe0, 0xf6, 0xd0, 0x0f, 0xdf,
926*b077aed3SPierre Pronchery    0x73, 0xc7, 0xad, 0x80, 0x1e, 0x66, 0x5a, 0x0e,
927*b077aed3SPierre Pronchery    0x5a, 0x79, 0x6d, 0x0a, 0x03, 0x80, 0xa1, 0x9f,
928*b077aed3SPierre Pronchery    0xa1, 0x82, 0xef, 0xc8, 0xa0, 0x4f, 0x5e, 0x4d,
929*b077aed3SPierre Pronchery    0xb9, 0x0d, 0x1a, 0x86, 0x37, 0xf9, 0x5d, 0xb1,
930*b077aed3SPierre Pronchery    0x64, 0x36, 0xbd, 0xc8, 0xf3, 0xfc, 0x09, 0x6c,
931*b077aed3SPierre Pronchery    0x4f, 0xf7, 0xf2, 0x34, 0xbe, 0x8f, 0xef, 0x47,
932*b077aed3SPierre Pronchery    0x9a, 0xc4, 0xb0, 0xdc, 0x4b, 0x77, 0x26, 0x3e,
933*b077aed3SPierre Pronchery    0x07, 0xd9, 0x95, 0x9d, 0xe0, 0xf1, 0xbf, 0x3f,
934*b077aed3SPierre Pronchery    0x0a, 0xe3, 0xd9, 0xd5, 0x0e, 0x4b, 0x89, 0xc9,
935*b077aed3SPierre Pronchery    0x9e, 0x3e, 0xa1, 0x21, 0x73, 0x43, 0xdd, 0x8c,
936*b077aed3SPierre Pronchery    0x65, 0x81, 0xac, 0xc4, 0x95, 0x9c, 0x91, 0xd3
937*b077aed3SPierre Pronchery};
938*b077aed3SPierre Proncherystatic const unsigned char dh_peer_pub[] = {
939*b077aed3SPierre Pronchery    0x1f, 0xc1, 0xda, 0x34, 0x1d, 0x1a, 0x84, 0x6a,
940*b077aed3SPierre Pronchery    0x96, 0xb7, 0xbe, 0x24, 0x34, 0x0f, 0x87, 0x7d,
941*b077aed3SPierre Pronchery    0xd0, 0x10, 0xaa, 0x03, 0x56, 0xd5, 0xad, 0x58,
942*b077aed3SPierre Pronchery    0xaa, 0xe9, 0xc7, 0xb0, 0x8f, 0x74, 0x9a, 0x32,
943*b077aed3SPierre Pronchery    0x23, 0x51, 0x10, 0xb5, 0xd8, 0x8e, 0xb5, 0xdb,
944*b077aed3SPierre Pronchery    0xfa, 0x97, 0x8d, 0x27, 0xec, 0xc5, 0x30, 0xf0,
945*b077aed3SPierre Pronchery    0x2d, 0x31, 0x14, 0x00, 0x5b, 0x64, 0xb1, 0xc0,
946*b077aed3SPierre Pronchery    0xe0, 0x24, 0xcb, 0x8a, 0xe2, 0x16, 0x98, 0xbc,
947*b077aed3SPierre Pronchery    0xa9, 0xe6, 0x0d, 0x42, 0x80, 0x86, 0x22, 0xf1,
948*b077aed3SPierre Pronchery    0x81, 0xc5, 0x6e, 0x1d, 0xe7, 0xa9, 0x6e, 0x6e,
949*b077aed3SPierre Pronchery    0xfe, 0xe9, 0xd6, 0x65, 0x67, 0xe9, 0x1b, 0x97,
950*b077aed3SPierre Pronchery    0x70, 0x42, 0xc7, 0xe3, 0xd0, 0x44, 0x8f, 0x05,
951*b077aed3SPierre Pronchery    0xfb, 0x77, 0xf5, 0x22, 0xb9, 0xbf, 0xc8, 0xd3,
952*b077aed3SPierre Pronchery    0x3c, 0xc3, 0xc3, 0x1e, 0xd3, 0xb3, 0x1f, 0x0f,
953*b077aed3SPierre Pronchery    0xec, 0xb6, 0xdb, 0x4f, 0x6e, 0xa3, 0x11, 0xe7,
954*b077aed3SPierre Pronchery    0x7a, 0xfd, 0xbc, 0xd4, 0x7a, 0xee, 0x1b, 0xb1,
955*b077aed3SPierre Pronchery    0x50, 0xf2, 0x16, 0x87, 0x35, 0x78, 0xfb, 0x96,
956*b077aed3SPierre Pronchery    0x46, 0x8e, 0x8f, 0x9f, 0x3d, 0xe8, 0xef, 0xbf,
957*b077aed3SPierre Pronchery    0xce, 0x75, 0x62, 0x4b, 0x1d, 0xf0, 0x53, 0x22,
958*b077aed3SPierre Pronchery    0xa3, 0x4f, 0x14, 0x63, 0xe8, 0x39, 0xe8, 0x98,
959*b077aed3SPierre Pronchery    0x4c, 0x4a, 0xd0, 0xa9, 0x6e, 0x1a, 0xc8, 0x42,
960*b077aed3SPierre Pronchery    0xe5, 0x31, 0x8c, 0xc2, 0x3c, 0x06, 0x2a, 0x8c,
961*b077aed3SPierre Pronchery    0xa1, 0x71, 0xb8, 0xd5, 0x75, 0x98, 0x0d, 0xde,
962*b077aed3SPierre Pronchery    0x7f, 0xc5, 0x6f, 0x15, 0x36, 0x52, 0x38, 0x20,
963*b077aed3SPierre Pronchery    0xd4, 0x31, 0x92, 0xbf, 0xd5, 0x1e, 0x8e, 0x22,
964*b077aed3SPierre Pronchery    0x89, 0x78, 0xac, 0xa5, 0xb9, 0x44, 0x72, 0xf3,
965*b077aed3SPierre Pronchery    0x39, 0xca, 0xeb, 0x99, 0x31, 0xb4, 0x2b, 0xe3,
966*b077aed3SPierre Pronchery    0x01, 0x26, 0x8b, 0xc9, 0x97, 0x89, 0xc9, 0xb2,
967*b077aed3SPierre Pronchery    0x55, 0x71, 0xc3, 0xc0, 0xe4, 0xcb, 0x3f, 0x00,
968*b077aed3SPierre Pronchery    0x7f, 0x1a, 0x51, 0x1c, 0xbb, 0x53, 0xc8, 0x51,
969*b077aed3SPierre Pronchery    0x9c, 0xdd, 0x13, 0x02, 0xab, 0xca, 0x6c, 0x0f,
970*b077aed3SPierre Pronchery    0x34, 0xf9, 0x67, 0x39, 0xf1, 0x7f, 0xf4, 0x8b
971*b077aed3SPierre Pronchery};
972*b077aed3SPierre Pronchery
973*b077aed3SPierre Proncherystatic const unsigned char dh_secret_expected[] = {
974*b077aed3SPierre Pronchery    0x08, 0xff, 0x33, 0xbb, 0x2e, 0xcf, 0xf4, 0x9a,
975*b077aed3SPierre Pronchery    0x7d, 0x4a, 0x79, 0x12, 0xae, 0xb1, 0xbb, 0x6a,
976*b077aed3SPierre Pronchery    0xb5, 0x11, 0x64, 0x1b, 0x4a, 0x76, 0x77, 0x0c,
977*b077aed3SPierre Pronchery    0x8c, 0xc1, 0xbc, 0xc2, 0x33, 0x34, 0x3d, 0xfe,
978*b077aed3SPierre Pronchery    0x70, 0x0d, 0x11, 0x81, 0x3d, 0x2c, 0x9e, 0xd2,
979*b077aed3SPierre Pronchery    0x3b, 0x21, 0x1c, 0xa9, 0xe8, 0x78, 0x69, 0x21,
980*b077aed3SPierre Pronchery    0xed, 0xca, 0x28, 0x3c, 0x68, 0xb1, 0x61, 0x53,
981*b077aed3SPierre Pronchery    0xfa, 0x01, 0xe9, 0x1a, 0xb8, 0x2c, 0x90, 0xdd,
982*b077aed3SPierre Pronchery    0xab, 0x4a, 0x95, 0x81, 0x67, 0x70, 0xa9, 0x87,
983*b077aed3SPierre Pronchery    0x10, 0xe1, 0x4c, 0x92, 0xab, 0x83, 0xb6, 0xe4,
984*b077aed3SPierre Pronchery    0x6e, 0x1e, 0x42, 0x6e, 0xe8, 0x52, 0x43, 0x0d,
985*b077aed3SPierre Pronchery    0x61, 0x87, 0xda, 0xa3, 0x72, 0x0a, 0x6b, 0xcd,
986*b077aed3SPierre Pronchery    0x73, 0x23, 0x5c, 0x6b, 0x0f, 0x94, 0x1f, 0x33,
987*b077aed3SPierre Pronchery    0x64, 0xf5, 0x04, 0x20, 0x55, 0x1a, 0x4b, 0xfe,
988*b077aed3SPierre Pronchery    0xaf, 0xe2, 0xbc, 0x43, 0x85, 0x05, 0xa5, 0x9a,
989*b077aed3SPierre Pronchery    0x4a, 0x40, 0xda, 0xca, 0x7a, 0x89, 0x5a, 0x73,
990*b077aed3SPierre Pronchery    0xdb, 0x57, 0x5c, 0x74, 0xc1, 0x3a, 0x23, 0xad,
991*b077aed3SPierre Pronchery    0x88, 0x32, 0x95, 0x7d, 0x58, 0x2d, 0x38, 0xf0,
992*b077aed3SPierre Pronchery    0xa6, 0x16, 0x5f, 0xb0, 0xd7, 0xe9, 0xb8, 0x79,
993*b077aed3SPierre Pronchery    0x9e, 0x42, 0xfd, 0x32, 0x20, 0xe3, 0x32, 0xe9,
994*b077aed3SPierre Pronchery    0x81, 0x85, 0xa0, 0xc9, 0x42, 0x97, 0x57, 0xb2,
995*b077aed3SPierre Pronchery    0xd0, 0xd0, 0x2c, 0x17, 0xdb, 0xaa, 0x1f, 0xf6,
996*b077aed3SPierre Pronchery    0xed, 0x93, 0xd7, 0xe7, 0x3e, 0x24, 0x1e, 0xae,
997*b077aed3SPierre Pronchery    0xd9, 0x0c, 0xaf, 0x39, 0x4d, 0x2b, 0xc6, 0x57,
998*b077aed3SPierre Pronchery    0x0f, 0x18, 0xc8, 0x1f, 0x2b, 0xe5, 0xd0, 0x1a,
999*b077aed3SPierre Pronchery    0x2c, 0xa9, 0x9f, 0xf1, 0x42, 0xb5, 0xd9, 0x63,
1000*b077aed3SPierre Pronchery    0xf9, 0xf5, 0x00, 0x32, 0x5e, 0x75, 0x56, 0xf9,
1001*b077aed3SPierre Pronchery    0x58, 0x49, 0xb3, 0xff, 0xc7, 0x47, 0x94, 0x86,
1002*b077aed3SPierre Pronchery    0xbe, 0x1d, 0x45, 0x96, 0xa3, 0x10, 0x6b, 0xd5,
1003*b077aed3SPierre Pronchery    0xcb, 0x4f, 0x61, 0xc5, 0x7e, 0xc5, 0xf1, 0x00,
1004*b077aed3SPierre Pronchery    0xfb, 0x7a, 0x0c, 0x82, 0xa1, 0x0b, 0x82, 0x52,
1005*b077aed3SPierre Pronchery    0x6a, 0x97, 0xd1, 0xd9, 0x7d, 0x98, 0xea, 0xf6
1006*b077aed3SPierre Pronchery};
1007*b077aed3SPierre Pronchery
1008*b077aed3SPierre Proncherystatic const ST_KAT_PARAM dh_group[] = {
1009*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_FFC_P, dh_p),
1010*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_FFC_Q, dh_q),
1011*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_FFC_G, dh_g),
1012*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1013*b077aed3SPierre Pronchery};
1014*b077aed3SPierre Pronchery
1015*b077aed3SPierre Pronchery/* The host's private key */
1016*b077aed3SPierre Proncherystatic const ST_KAT_PARAM dh_host_key[] = {
1017*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PUB_KEY, dh_pub),
1018*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PRIV_KEY, dh_priv),
1019*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1020*b077aed3SPierre Pronchery};
1021*b077aed3SPierre Pronchery
1022*b077aed3SPierre Pronchery/* The peer's public key */
1023*b077aed3SPierre Proncherystatic const ST_KAT_PARAM dh_peer_key[] = {
1024*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PUB_KEY, dh_peer_pub),
1025*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1026*b077aed3SPierre Pronchery};
1027*b077aed3SPierre Pronchery#endif /* OPENSSL_NO_DH */
1028*b077aed3SPierre Pronchery
1029*b077aed3SPierre Pronchery
1030*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_EC
1031*b077aed3SPierre Proncherystatic const char ecdh_curve_name[] = "prime256v1";
1032*b077aed3SPierre Proncherystatic const unsigned char ecdh_privd[] = {
1033*b077aed3SPierre Pronchery    0x33, 0xd0, 0x43, 0x83, 0xa9, 0x89, 0x56, 0x03,
1034*b077aed3SPierre Pronchery    0xd2, 0xd7, 0xfe, 0x6b, 0x01, 0x6f, 0xe4, 0x59,
1035*b077aed3SPierre Pronchery    0xcc, 0x0d, 0x9a, 0x24, 0x6c, 0x86, 0x1b, 0x2e,
1036*b077aed3SPierre Pronchery    0xdc, 0x4b, 0x4d, 0x35, 0x43, 0xe1, 0x1b, 0xad
1037*b077aed3SPierre Pronchery};
1038*b077aed3SPierre Proncherystatic const unsigned char ecdh_pub[] = {
1039*b077aed3SPierre Pronchery    0x04,
1040*b077aed3SPierre Pronchery    0x1b, 0x93, 0x67, 0x55, 0x1c, 0x55, 0x9f, 0x63,
1041*b077aed3SPierre Pronchery    0xd1, 0x22, 0xa4, 0xd8, 0xd1, 0x0a, 0x60, 0x6d,
1042*b077aed3SPierre Pronchery    0x02, 0xa5, 0x77, 0x57, 0xc8, 0xa3, 0x47, 0x73,
1043*b077aed3SPierre Pronchery    0x3a, 0x6a, 0x08, 0x28, 0x39, 0xbd, 0xc9, 0xd2,
1044*b077aed3SPierre Pronchery    0x80, 0xec, 0xe9, 0xa7, 0x08, 0x29, 0x71, 0x2f,
1045*b077aed3SPierre Pronchery    0xc9, 0x56, 0x82, 0xee, 0x9a, 0x85, 0x0f, 0x6d,
1046*b077aed3SPierre Pronchery    0x7f, 0x59, 0x5f, 0x8c, 0xd1, 0x96, 0x0b, 0xdf,
1047*b077aed3SPierre Pronchery    0x29, 0x3e, 0x49, 0x07, 0x88, 0x3f, 0x9a, 0x29
1048*b077aed3SPierre Pronchery};
1049*b077aed3SPierre Proncherystatic const unsigned char ecdh_peer_pub[] = {
1050*b077aed3SPierre Pronchery    0x04,
1051*b077aed3SPierre Pronchery    0x1f, 0x72, 0xbd, 0x2a, 0x3e, 0xeb, 0x6c, 0x76,
1052*b077aed3SPierre Pronchery    0xe5, 0x5d, 0x69, 0x75, 0x24, 0xbf, 0x2f, 0x5b,
1053*b077aed3SPierre Pronchery    0x96, 0xb2, 0x91, 0x62, 0x06, 0x35, 0xcc, 0xb2,
1054*b077aed3SPierre Pronchery    0x4b, 0x31, 0x1b, 0x0c, 0x6f, 0x06, 0x9f, 0x86,
1055*b077aed3SPierre Pronchery    0xcf, 0xc8, 0xac, 0xd5, 0x4f, 0x4d, 0x77, 0xf3,
1056*b077aed3SPierre Pronchery    0x70, 0x4a, 0x8f, 0x04, 0x9a, 0xb1, 0x03, 0xc7,
1057*b077aed3SPierre Pronchery    0xeb, 0xd5, 0x94, 0x78, 0x61, 0xab, 0x78, 0x0c,
1058*b077aed3SPierre Pronchery    0x4a, 0x2d, 0x6b, 0xf3, 0x2f, 0x2e, 0x4a, 0xbc
1059*b077aed3SPierre Pronchery};
1060*b077aed3SPierre Pronchery
1061*b077aed3SPierre Proncherystatic const ST_KAT_PARAM ecdh_group[] = {
1062*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_PKEY_PARAM_GROUP_NAME, ecdh_curve_name),
1063*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1064*b077aed3SPierre Pronchery};
1065*b077aed3SPierre Proncherystatic const ST_KAT_PARAM ecdh_host_key[] = {
1066*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PUB_KEY, ecdh_pub),
1067*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PRIV_KEY, ecdh_privd),
1068*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1069*b077aed3SPierre Pronchery};
1070*b077aed3SPierre Proncherystatic const ST_KAT_PARAM ecdh_peer_key[] = {
1071*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PUB_KEY, ecdh_peer_pub),
1072*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1073*b077aed3SPierre Pronchery};
1074*b077aed3SPierre Proncherystatic const unsigned char ecdh_secret_expected[] = {
1075*b077aed3SPierre Pronchery    0x45, 0x2a, 0x2f, 0x0d, 0x24, 0xe6, 0x8d, 0xd0,
1076*b077aed3SPierre Pronchery    0xda, 0x59, 0x7b, 0x0c, 0xec, 0x9b, 0x4c, 0x38,
1077*b077aed3SPierre Pronchery    0x41, 0xdd, 0xce, 0xb3, 0xcc, 0xf1, 0x90, 0x8e,
1078*b077aed3SPierre Pronchery    0x30, 0xdb, 0x5b, 0x5f, 0x97, 0xea, 0xe0, 0xc2
1079*b077aed3SPierre Pronchery};
1080*b077aed3SPierre Pronchery#endif /* OPENSSL_NO_EC */
1081*b077aed3SPierre Pronchery
1082*b077aed3SPierre Pronchery#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC)
1083*b077aed3SPierre Proncherystatic const ST_KAT_KAS st_kat_kas_tests[] =
1084*b077aed3SPierre Pronchery{
1085*b077aed3SPierre Pronchery# ifndef OPENSSL_NO_DH
1086*b077aed3SPierre Pronchery    {
1087*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KA_DH,
1088*b077aed3SPierre Pronchery        "DH",
1089*b077aed3SPierre Pronchery        dh_group,
1090*b077aed3SPierre Pronchery        dh_host_key,
1091*b077aed3SPierre Pronchery        dh_peer_key,
1092*b077aed3SPierre Pronchery        ITM(dh_secret_expected)
1093*b077aed3SPierre Pronchery    },
1094*b077aed3SPierre Pronchery# endif /* OPENSSL_NO_DH */
1095*b077aed3SPierre Pronchery# ifndef OPENSSL_NO_EC
1096*b077aed3SPierre Pronchery    {
1097*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_KA_ECDH,
1098*b077aed3SPierre Pronchery        "EC",
1099*b077aed3SPierre Pronchery        ecdh_group,
1100*b077aed3SPierre Pronchery        ecdh_host_key,
1101*b077aed3SPierre Pronchery        ecdh_peer_key,
1102*b077aed3SPierre Pronchery        ITM(ecdh_secret_expected)
1103*b077aed3SPierre Pronchery    },
1104*b077aed3SPierre Pronchery# endif /* OPENSSL_NO_EC */
1105*b077aed3SPierre Pronchery};
1106*b077aed3SPierre Pronchery#endif /* !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_EC) */
1107*b077aed3SPierre Pronchery
1108*b077aed3SPierre Pronchery/* RSA key data */
1109*b077aed3SPierre Proncherystatic const unsigned char rsa_n[] = {
1110*b077aed3SPierre Pronchery    0xDB, 0x10, 0x1A, 0xC2, 0xA3, 0xF1, 0xDC, 0xFF,
1111*b077aed3SPierre Pronchery    0x13, 0x6B, 0xED, 0x44, 0xDF, 0xF0, 0x02, 0x6D,
1112*b077aed3SPierre Pronchery    0x13, 0xC7, 0x88, 0xDA, 0x70, 0x6B, 0x54, 0xF1,
1113*b077aed3SPierre Pronchery    0xE8, 0x27, 0xDC, 0xC3, 0x0F, 0x99, 0x6A, 0xFA,
1114*b077aed3SPierre Pronchery    0xC6, 0x67, 0xFF, 0x1D, 0x1E, 0x3C, 0x1D, 0xC1,
1115*b077aed3SPierre Pronchery    0xB5, 0x5F, 0x6C, 0xC0, 0xB2, 0x07, 0x3A, 0x6D,
1116*b077aed3SPierre Pronchery    0x41, 0xE4, 0x25, 0x99, 0xAC, 0xFC, 0xD2, 0x0F,
1117*b077aed3SPierre Pronchery    0x02, 0xD3, 0xD1, 0x54, 0x06, 0x1A, 0x51, 0x77,
1118*b077aed3SPierre Pronchery    0xBD, 0xB6, 0xBF, 0xEA, 0xA7, 0x5C, 0x06, 0xA9,
1119*b077aed3SPierre Pronchery    0x5D, 0x69, 0x84, 0x45, 0xD7, 0xF5, 0x05, 0xBA,
1120*b077aed3SPierre Pronchery    0x47, 0xF0, 0x1B, 0xD7, 0x2B, 0x24, 0xEC, 0xCB,
1121*b077aed3SPierre Pronchery    0x9B, 0x1B, 0x10, 0x8D, 0x81, 0xA0, 0xBE, 0xB1,
1122*b077aed3SPierre Pronchery    0x8C, 0x33, 0xE4, 0x36, 0xB8, 0x43, 0xEB, 0x19,
1123*b077aed3SPierre Pronchery    0x2A, 0x81, 0x8D, 0xDE, 0x81, 0x0A, 0x99, 0x48,
1124*b077aed3SPierre Pronchery    0xB6, 0xF6, 0xBC, 0xCD, 0x49, 0x34, 0x3A, 0x8F,
1125*b077aed3SPierre Pronchery    0x26, 0x94, 0xE3, 0x28, 0x82, 0x1A, 0x7C, 0x8F,
1126*b077aed3SPierre Pronchery    0x59, 0x9F, 0x45, 0xE8, 0x5D, 0x1A, 0x45, 0x76,
1127*b077aed3SPierre Pronchery    0x04, 0x56, 0x05, 0xA1, 0xD0, 0x1B, 0x8C, 0x77,
1128*b077aed3SPierre Pronchery    0x6D, 0xAF, 0x53, 0xFA, 0x71, 0xE2, 0x67, 0xE0,
1129*b077aed3SPierre Pronchery    0x9A, 0xFE, 0x03, 0xA9, 0x85, 0xD2, 0xC9, 0xAA,
1130*b077aed3SPierre Pronchery    0xBA, 0x2A, 0xBC, 0xF4, 0xA0, 0x08, 0xF5, 0x13,
1131*b077aed3SPierre Pronchery    0x98, 0x13, 0x5D, 0xF0, 0xD9, 0x33, 0x34, 0x2A,
1132*b077aed3SPierre Pronchery    0x61, 0xC3, 0x89, 0x55, 0xF0, 0xAE, 0x1A, 0x9C,
1133*b077aed3SPierre Pronchery    0x22, 0xEE, 0x19, 0x05, 0x8D, 0x32, 0xFE, 0xEC,
1134*b077aed3SPierre Pronchery    0x9C, 0x84, 0xBA, 0xB7, 0xF9, 0x6C, 0x3A, 0x4F,
1135*b077aed3SPierre Pronchery    0x07, 0xFC, 0x45, 0xEB, 0x12, 0xE5, 0x7B, 0xFD,
1136*b077aed3SPierre Pronchery    0x55, 0xE6, 0x29, 0x69, 0xD1, 0xC2, 0xE8, 0xB9,
1137*b077aed3SPierre Pronchery    0x78, 0x59, 0xF6, 0x79, 0x10, 0xC6, 0x4E, 0xEB,
1138*b077aed3SPierre Pronchery    0x6A, 0x5E, 0xB9, 0x9A, 0xC7, 0xC4, 0x5B, 0x63,
1139*b077aed3SPierre Pronchery    0xDA, 0xA3, 0x3F, 0x5E, 0x92, 0x7A, 0x81, 0x5E,
1140*b077aed3SPierre Pronchery    0xD6, 0xB0, 0xE2, 0x62, 0x8F, 0x74, 0x26, 0xC2,
1141*b077aed3SPierre Pronchery    0x0C, 0xD3, 0x9A, 0x17, 0x47, 0xE6, 0x8E, 0xAB
1142*b077aed3SPierre Pronchery};
1143*b077aed3SPierre Proncherystatic const unsigned char rsa_e[] = { 0x01, 0x00, 0x01 };
1144*b077aed3SPierre Proncherystatic const unsigned char rsa_d[] = {
1145*b077aed3SPierre Pronchery    0x52, 0x41, 0xF4, 0xDA, 0x7B, 0xB7, 0x59, 0x55,
1146*b077aed3SPierre Pronchery    0xCA, 0xD4, 0x2F, 0x0F, 0x3A, 0xCB, 0xA4, 0x0D,
1147*b077aed3SPierre Pronchery    0x93, 0x6C, 0xCC, 0x9D, 0xC1, 0xB2, 0xFB, 0xFD,
1148*b077aed3SPierre Pronchery    0xAE, 0x40, 0x31, 0xAC, 0x69, 0x52, 0x21, 0x92,
1149*b077aed3SPierre Pronchery    0xB3, 0x27, 0xDF, 0xEA, 0xEE, 0x2C, 0x82, 0xBB,
1150*b077aed3SPierre Pronchery    0xF7, 0x40, 0x32, 0xD5, 0x14, 0xC4, 0x94, 0x12,
1151*b077aed3SPierre Pronchery    0xEC, 0xB8, 0x1F, 0xCA, 0x59, 0xE3, 0xC1, 0x78,
1152*b077aed3SPierre Pronchery    0xF3, 0x85, 0xD8, 0x47, 0xA5, 0xD7, 0x02, 0x1A,
1153*b077aed3SPierre Pronchery    0x65, 0x79, 0x97, 0x0D, 0x24, 0xF4, 0xF0, 0x67,
1154*b077aed3SPierre Pronchery    0x6E, 0x75, 0x2D, 0xBF, 0x10, 0x3D, 0xA8, 0x7D,
1155*b077aed3SPierre Pronchery    0xEF, 0x7F, 0x60, 0xE4, 0xE6, 0x05, 0x82, 0x89,
1156*b077aed3SPierre Pronchery    0x5D, 0xDF, 0xC6, 0xD2, 0x6C, 0x07, 0x91, 0x33,
1157*b077aed3SPierre Pronchery    0x98, 0x42, 0xF0, 0x02, 0x00, 0x25, 0x38, 0xC5,
1158*b077aed3SPierre Pronchery    0x85, 0x69, 0x8A, 0x7D, 0x2F, 0x95, 0x6C, 0x43,
1159*b077aed3SPierre Pronchery    0x9A, 0xB8, 0x81, 0xE2, 0xD0, 0x07, 0x35, 0xAA,
1160*b077aed3SPierre Pronchery    0x05, 0x41, 0xC9, 0x1E, 0xAF, 0xE4, 0x04, 0x3B,
1161*b077aed3SPierre Pronchery    0x19, 0xB8, 0x73, 0xA2, 0xAC, 0x4B, 0x1E, 0x66,
1162*b077aed3SPierre Pronchery    0x48, 0xD8, 0x72, 0x1F, 0xAC, 0xF6, 0xCB, 0xBC,
1163*b077aed3SPierre Pronchery    0x90, 0x09, 0xCA, 0xEC, 0x0C, 0xDC, 0xF9, 0x2C,
1164*b077aed3SPierre Pronchery    0xD7, 0xEB, 0xAE, 0xA3, 0xA4, 0x47, 0xD7, 0x33,
1165*b077aed3SPierre Pronchery    0x2F, 0x8A, 0xCA, 0xBC, 0x5E, 0xF0, 0x77, 0xE4,
1166*b077aed3SPierre Pronchery    0x97, 0x98, 0x97, 0xC7, 0x10, 0x91, 0x7D, 0x2A,
1167*b077aed3SPierre Pronchery    0xA6, 0xFF, 0x46, 0x83, 0x97, 0xDE, 0xE9, 0xE2,
1168*b077aed3SPierre Pronchery    0x17, 0x03, 0x06, 0x14, 0xE2, 0xD7, 0xB1, 0x1D,
1169*b077aed3SPierre Pronchery    0x77, 0xAF, 0x51, 0x27, 0x5B, 0x5E, 0x69, 0xB8,
1170*b077aed3SPierre Pronchery    0x81, 0xE6, 0x11, 0xC5, 0x43, 0x23, 0x81, 0x04,
1171*b077aed3SPierre Pronchery    0x62, 0xFF, 0xE9, 0x46, 0xB8, 0xD8, 0x44, 0xDB,
1172*b077aed3SPierre Pronchery    0xA5, 0xCC, 0x31, 0x54, 0x34, 0xCE, 0x3E, 0x82,
1173*b077aed3SPierre Pronchery    0xD6, 0xBF, 0x7A, 0x0B, 0x64, 0x21, 0x6D, 0x88,
1174*b077aed3SPierre Pronchery    0x7E, 0x5B, 0x45, 0x12, 0x1E, 0x63, 0x8D, 0x49,
1175*b077aed3SPierre Pronchery    0xA7, 0x1D, 0xD9, 0x1E, 0x06, 0xCD, 0xE8, 0xBA,
1176*b077aed3SPierre Pronchery    0x2C, 0x8C, 0x69, 0x32, 0xEA, 0xBE, 0x60, 0x71
1177*b077aed3SPierre Pronchery};
1178*b077aed3SPierre Proncherystatic const unsigned char rsa_p[] = {
1179*b077aed3SPierre Pronchery    0xFA, 0xAC, 0xE1, 0x37, 0x5E, 0x32, 0x11, 0x34,
1180*b077aed3SPierre Pronchery    0xC6, 0x72, 0x58, 0x2D, 0x91, 0x06, 0x3E, 0x77,
1181*b077aed3SPierre Pronchery    0xE7, 0x11, 0x21, 0xCD, 0x4A, 0xF8, 0xA4, 0x3F,
1182*b077aed3SPierre Pronchery    0x0F, 0xEF, 0x31, 0xE3, 0xF3, 0x55, 0xA0, 0xB9,
1183*b077aed3SPierre Pronchery    0xAC, 0xB6, 0xCB, 0xBB, 0x41, 0xD0, 0x32, 0x81,
1184*b077aed3SPierre Pronchery    0x9A, 0x8F, 0x7A, 0x99, 0x30, 0x77, 0x6C, 0x68,
1185*b077aed3SPierre Pronchery    0x27, 0xE2, 0x96, 0xB5, 0x72, 0xC9, 0xC3, 0xD4,
1186*b077aed3SPierre Pronchery    0x42, 0xAA, 0xAA, 0xCA, 0x95, 0x8F, 0xFF, 0xC9,
1187*b077aed3SPierre Pronchery    0x9B, 0x52, 0x34, 0x30, 0x1D, 0xCF, 0xFE, 0xCF,
1188*b077aed3SPierre Pronchery    0x3C, 0x56, 0x68, 0x6E, 0xEF, 0xE7, 0x6C, 0xD7,
1189*b077aed3SPierre Pronchery    0xFB, 0x99, 0xF5, 0x4A, 0xA5, 0x21, 0x1F, 0x2B,
1190*b077aed3SPierre Pronchery    0xEA, 0x93, 0xE8, 0x98, 0x26, 0xC4, 0x6E, 0x42,
1191*b077aed3SPierre Pronchery    0x21, 0x5E, 0xA0, 0xA1, 0x2A, 0x58, 0x35, 0xBB,
1192*b077aed3SPierre Pronchery    0x10, 0xE7, 0xBA, 0x27, 0x0A, 0x3B, 0xB3, 0xAF,
1193*b077aed3SPierre Pronchery    0xE2, 0x75, 0x36, 0x04, 0xAC, 0x56, 0xA0, 0xAB,
1194*b077aed3SPierre Pronchery    0x52, 0xDE, 0xCE, 0xDD, 0x2C, 0x28, 0x77, 0x03
1195*b077aed3SPierre Pronchery};
1196*b077aed3SPierre Proncherystatic const unsigned char rsa_q[] = {
1197*b077aed3SPierre Pronchery    0xDF, 0xB7, 0x52, 0xB6, 0xD7, 0xC0, 0xE2, 0x96,
1198*b077aed3SPierre Pronchery    0xE7, 0xC9, 0xFE, 0x5D, 0x71, 0x5A, 0xC4, 0x40,
1199*b077aed3SPierre Pronchery    0x96, 0x2F, 0xE5, 0x87, 0xEA, 0xF3, 0xA5, 0x77,
1200*b077aed3SPierre Pronchery    0x11, 0x67, 0x3C, 0x8D, 0x56, 0x08, 0xA7, 0xB5,
1201*b077aed3SPierre Pronchery    0x67, 0xFA, 0x37, 0xA8, 0xB8, 0xCF, 0x61, 0xE8,
1202*b077aed3SPierre Pronchery    0x63, 0xD8, 0x38, 0x06, 0x21, 0x2B, 0x92, 0x09,
1203*b077aed3SPierre Pronchery    0xA6, 0x39, 0x3A, 0xEA, 0xA8, 0xB4, 0x45, 0x4B,
1204*b077aed3SPierre Pronchery    0x36, 0x10, 0x4C, 0xE4, 0x00, 0x66, 0x71, 0x65,
1205*b077aed3SPierre Pronchery    0xF8, 0x0B, 0x94, 0x59, 0x4F, 0x8C, 0xFD, 0xD5,
1206*b077aed3SPierre Pronchery    0x34, 0xA2, 0xE7, 0x62, 0x84, 0x0A, 0xA7, 0xBB,
1207*b077aed3SPierre Pronchery    0xDB, 0xD9, 0x8A, 0xCD, 0x05, 0xE1, 0xCC, 0x57,
1208*b077aed3SPierre Pronchery    0x7B, 0xF1, 0xF1, 0x1F, 0x11, 0x9D, 0xBA, 0x3E,
1209*b077aed3SPierre Pronchery    0x45, 0x18, 0x99, 0x1B, 0x41, 0x64, 0x43, 0xEE,
1210*b077aed3SPierre Pronchery    0x97, 0x5D, 0x77, 0x13, 0x5B, 0x74, 0x69, 0x73,
1211*b077aed3SPierre Pronchery    0x87, 0x95, 0x05, 0x07, 0xBE, 0x45, 0x07, 0x17,
1212*b077aed3SPierre Pronchery    0x7E, 0x4A, 0x69, 0x22, 0xF3, 0xDB, 0x05, 0x39
1213*b077aed3SPierre Pronchery};
1214*b077aed3SPierre Proncherystatic const unsigned char rsa_dp[] = {
1215*b077aed3SPierre Pronchery    0x5E, 0xD8, 0xDC, 0xDA, 0x53, 0x44, 0xC4, 0x67,
1216*b077aed3SPierre Pronchery    0xE0, 0x92, 0x51, 0x34, 0xE4, 0x83, 0xA5, 0x4D,
1217*b077aed3SPierre Pronchery    0x3E, 0xDB, 0xA7, 0x9B, 0x82, 0xBB, 0x73, 0x81,
1218*b077aed3SPierre Pronchery    0xFC, 0xE8, 0x77, 0x4B, 0x15, 0xBE, 0x17, 0x73,
1219*b077aed3SPierre Pronchery    0x49, 0x9B, 0x5C, 0x98, 0xBC, 0xBD, 0x26, 0xEF,
1220*b077aed3SPierre Pronchery    0x0C, 0xE9, 0x2E, 0xED, 0x19, 0x7E, 0x86, 0x41,
1221*b077aed3SPierre Pronchery    0x1E, 0x9E, 0x48, 0x81, 0xDD, 0x2D, 0xE4, 0x6F,
1222*b077aed3SPierre Pronchery    0xC2, 0xCD, 0xCA, 0x93, 0x9E, 0x65, 0x7E, 0xD5,
1223*b077aed3SPierre Pronchery    0xEC, 0x73, 0xFD, 0x15, 0x1B, 0xA2, 0xA0, 0x7A,
1224*b077aed3SPierre Pronchery    0x0F, 0x0D, 0x6E, 0xB4, 0x53, 0x07, 0x90, 0x92,
1225*b077aed3SPierre Pronchery    0x64, 0x3B, 0x8B, 0xA9, 0x33, 0xB3, 0xC5, 0x94,
1226*b077aed3SPierre Pronchery    0x9B, 0x4C, 0x5D, 0x9C, 0x7C, 0x46, 0xA4, 0xA5,
1227*b077aed3SPierre Pronchery    0x56, 0xF4, 0xF3, 0xF8, 0x27, 0x0A, 0x7B, 0x42,
1228*b077aed3SPierre Pronchery    0x0D, 0x92, 0x70, 0x47, 0xE7, 0x42, 0x51, 0xA9,
1229*b077aed3SPierre Pronchery    0xC2, 0x18, 0xB1, 0x58, 0xB1, 0x50, 0x91, 0xB8,
1230*b077aed3SPierre Pronchery    0x61, 0x41, 0xB6, 0xA9, 0xCE, 0xD4, 0x7C, 0xBB
1231*b077aed3SPierre Pronchery};
1232*b077aed3SPierre Proncherystatic const unsigned char rsa_dq[] = {
1233*b077aed3SPierre Pronchery    0x54, 0x09, 0x1F, 0x0F, 0x03, 0xD8, 0xB6, 0xC5,
1234*b077aed3SPierre Pronchery    0x0C, 0xE8, 0xB9, 0x9E, 0x0C, 0x38, 0x96, 0x43,
1235*b077aed3SPierre Pronchery    0xD4, 0xA6, 0xC5, 0x47, 0xDB, 0x20, 0x0E, 0xE5,
1236*b077aed3SPierre Pronchery    0xBD, 0x29, 0xD4, 0x7B, 0x1A, 0xF8, 0x41, 0x57,
1237*b077aed3SPierre Pronchery    0x49, 0x69, 0x9A, 0x82, 0xCC, 0x79, 0x4A, 0x43,
1238*b077aed3SPierre Pronchery    0xEB, 0x4D, 0x8B, 0x2D, 0xF2, 0x43, 0xD5, 0xA5,
1239*b077aed3SPierre Pronchery    0xBE, 0x44, 0xFD, 0x36, 0xAC, 0x8C, 0x9B, 0x02,
1240*b077aed3SPierre Pronchery    0xF7, 0x9A, 0x03, 0xE8, 0x19, 0xA6, 0x61, 0xAE,
1241*b077aed3SPierre Pronchery    0x76, 0x10, 0x93, 0x77, 0x41, 0x04, 0xAB, 0x4C,
1242*b077aed3SPierre Pronchery    0xED, 0x6A, 0xCC, 0x14, 0x1B, 0x99, 0x8D, 0x0C,
1243*b077aed3SPierre Pronchery    0x6A, 0x37, 0x3B, 0x86, 0x6C, 0x51, 0x37, 0x5B,
1244*b077aed3SPierre Pronchery    0x1D, 0x79, 0xF2, 0xA3, 0x43, 0x10, 0xC6, 0xA7,
1245*b077aed3SPierre Pronchery    0x21, 0x79, 0x6D, 0xF9, 0xE9, 0x04, 0x6A, 0xE8,
1246*b077aed3SPierre Pronchery    0x32, 0xFF, 0xAE, 0xFD, 0x1C, 0x7B, 0x8C, 0x29,
1247*b077aed3SPierre Pronchery    0x13, 0xA3, 0x0C, 0xB2, 0xAD, 0xEC, 0x6C, 0x0F,
1248*b077aed3SPierre Pronchery    0x8D, 0x27, 0x12, 0x7B, 0x48, 0xB2, 0xDB, 0x31
1249*b077aed3SPierre Pronchery};
1250*b077aed3SPierre Proncherystatic const unsigned char rsa_qInv[] = {
1251*b077aed3SPierre Pronchery    0x8D, 0x1B, 0x05, 0xCA, 0x24, 0x1F, 0x0C, 0x53,
1252*b077aed3SPierre Pronchery    0x19, 0x52, 0x74, 0x63, 0x21, 0xFA, 0x78, 0x46,
1253*b077aed3SPierre Pronchery    0x79, 0xAF, 0x5C, 0xDE, 0x30, 0xA4, 0x6C, 0x20,
1254*b077aed3SPierre Pronchery    0x38, 0xE6, 0x97, 0x39, 0xB8, 0x7A, 0x70, 0x0D,
1255*b077aed3SPierre Pronchery    0x8B, 0x6C, 0x6D, 0x13, 0x74, 0xD5, 0x1C, 0xDE,
1256*b077aed3SPierre Pronchery    0xA9, 0xF4, 0x60, 0x37, 0xFE, 0x68, 0x77, 0x5E,
1257*b077aed3SPierre Pronchery    0x0B, 0x4E, 0x5E, 0x03, 0x31, 0x30, 0xDF, 0xD6,
1258*b077aed3SPierre Pronchery    0xAE, 0x85, 0xD0, 0x81, 0xBB, 0x61, 0xC7, 0xB1,
1259*b077aed3SPierre Pronchery    0x04, 0x5A, 0xC4, 0x6D, 0x56, 0x1C, 0xD9, 0x64,
1260*b077aed3SPierre Pronchery    0xE7, 0x85, 0x7F, 0x88, 0x91, 0xC9, 0x60, 0x28,
1261*b077aed3SPierre Pronchery    0x05, 0xE2, 0xC6, 0x24, 0x8F, 0xDD, 0x61, 0x64,
1262*b077aed3SPierre Pronchery    0xD8, 0x09, 0xDE, 0x7E, 0xD3, 0x4A, 0x61, 0x1A,
1263*b077aed3SPierre Pronchery    0xD3, 0x73, 0x58, 0x4B, 0xD8, 0xA0, 0x54, 0x25,
1264*b077aed3SPierre Pronchery    0x48, 0x83, 0x6F, 0x82, 0x6C, 0xAF, 0x36, 0x51,
1265*b077aed3SPierre Pronchery    0x2A, 0x5D, 0x14, 0x2F, 0x41, 0x25, 0x00, 0xDD,
1266*b077aed3SPierre Pronchery    0xF8, 0xF3, 0x95, 0xFE, 0x31, 0x25, 0x50, 0x12
1267*b077aed3SPierre Pronchery};
1268*b077aed3SPierre Pronchery
1269*b077aed3SPierre Proncherystatic const ST_KAT_PARAM rsa_crt_key[] = {
1270*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_N, rsa_n),
1271*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_E, rsa_e),
1272*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_D, rsa_d),
1273*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_FACTOR1, rsa_p),
1274*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_FACTOR2, rsa_q),
1275*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_EXPONENT1, rsa_dp),
1276*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_EXPONENT2, rsa_dq),
1277*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_COEFFICIENT1, rsa_qInv),
1278*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1279*b077aed3SPierre Pronchery};
1280*b077aed3SPierre Pronchery
1281*b077aed3SPierre Proncherystatic const ST_KAT_PARAM rsa_pub_key[] = {
1282*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_N, rsa_n),
1283*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_E, rsa_e),
1284*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1285*b077aed3SPierre Pronchery};
1286*b077aed3SPierre Pronchery
1287*b077aed3SPierre Proncherystatic const ST_KAT_PARAM rsa_priv_key[] = {
1288*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_N, rsa_n),
1289*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_E, rsa_e),
1290*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_RSA_D, rsa_d),
1291*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1292*b077aed3SPierre Pronchery};
1293*b077aed3SPierre Pronchery
1294*b077aed3SPierre Pronchery/*-
1295*b077aed3SPierre Pronchery * Using OSSL_PKEY_RSA_PAD_MODE_NONE directly in the expansion of the
1296*b077aed3SPierre Pronchery * ST_KAT_PARAM_UTF8STRING macro below causes a failure on ancient
1297*b077aed3SPierre Pronchery * HP/UX PA-RISC compilers.
1298*b077aed3SPierre Pronchery */
1299*b077aed3SPierre Proncherystatic const char pad_mode_none[] = OSSL_PKEY_RSA_PAD_MODE_NONE;
1300*b077aed3SPierre Pronchery
1301*b077aed3SPierre Proncherystatic const ST_KAT_PARAM rsa_enc_params[] = {
1302*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_ASYM_CIPHER_PARAM_PAD_MODE, pad_mode_none),
1303*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1304*b077aed3SPierre Pronchery};
1305*b077aed3SPierre Pronchery
1306*b077aed3SPierre Proncherystatic const unsigned char rsa_expected_sig[256] = {
1307*b077aed3SPierre Pronchery    0xad, 0xbe, 0x2a, 0xaf, 0x16, 0x85, 0xc5, 0x00,
1308*b077aed3SPierre Pronchery    0x91, 0x3e, 0xd0, 0x49, 0xfb, 0x3a, 0x81, 0xb9,
1309*b077aed3SPierre Pronchery    0x6c, 0x28, 0xbc, 0xbf, 0xea, 0x96, 0x5f, 0xe4,
1310*b077aed3SPierre Pronchery    0x9f, 0x99, 0xf7, 0x18, 0x8c, 0xec, 0x60, 0x28,
1311*b077aed3SPierre Pronchery    0xeb, 0x29, 0x02, 0x49, 0xfc, 0xda, 0xd7, 0x78,
1312*b077aed3SPierre Pronchery    0x68, 0xf8, 0xe1, 0xe9, 0x4d, 0x20, 0x6d, 0x32,
1313*b077aed3SPierre Pronchery    0xa6, 0xde, 0xfc, 0xe4, 0xda, 0xcc, 0x6c, 0x75,
1314*b077aed3SPierre Pronchery    0x36, 0x6b, 0xff, 0x5a, 0xac, 0x01, 0xa8, 0xc2,
1315*b077aed3SPierre Pronchery    0xa9, 0xe6, 0x8b, 0x18, 0x3e, 0xec, 0xea, 0x4c,
1316*b077aed3SPierre Pronchery    0x4a, 0x9e, 0x00, 0x09, 0xd1, 0x8a, 0x69, 0x1b,
1317*b077aed3SPierre Pronchery    0x8b, 0xd9, 0xad, 0x37, 0xe5, 0x7c, 0xff, 0x7d,
1318*b077aed3SPierre Pronchery    0x59, 0x56, 0x3e, 0xa0, 0xc6, 0x32, 0xd8, 0x35,
1319*b077aed3SPierre Pronchery    0x2f, 0xff, 0xfb, 0x05, 0x02, 0xcd, 0xd7, 0x19,
1320*b077aed3SPierre Pronchery    0xb9, 0x00, 0x86, 0x2a, 0xcf, 0xaa, 0x78, 0x16,
1321*b077aed3SPierre Pronchery    0x4b, 0xf1, 0xa7, 0x59, 0xef, 0x7d, 0xe8, 0x74,
1322*b077aed3SPierre Pronchery    0x23, 0x5c, 0xb2, 0xd4, 0x8a, 0x99, 0xa5, 0xbc,
1323*b077aed3SPierre Pronchery    0xfa, 0x63, 0xd8, 0xf7, 0xbd, 0xc6, 0x00, 0x13,
1324*b077aed3SPierre Pronchery    0x06, 0x02, 0x9a, 0xd4, 0xa7, 0xb4, 0x3d, 0x61,
1325*b077aed3SPierre Pronchery    0xab, 0xf1, 0xc2, 0x95, 0x59, 0x9b, 0x3d, 0x67,
1326*b077aed3SPierre Pronchery    0x1f, 0xde, 0x57, 0xb6, 0xb6, 0x9f, 0xb0, 0x87,
1327*b077aed3SPierre Pronchery    0xd6, 0x51, 0xd5, 0x3e, 0x00, 0xe2, 0xc9, 0xa0,
1328*b077aed3SPierre Pronchery    0x03, 0x66, 0xbc, 0x01, 0xb3, 0x8e, 0xfa, 0xf1,
1329*b077aed3SPierre Pronchery    0x15, 0xeb, 0x26, 0xf1, 0x5d, 0x81, 0x90, 0xb4,
1330*b077aed3SPierre Pronchery    0x1c, 0x00, 0x7c, 0x83, 0x4a, 0xa5, 0xde, 0x64,
1331*b077aed3SPierre Pronchery    0xae, 0xea, 0x6c, 0x43, 0xc3, 0x20, 0x77, 0x77,
1332*b077aed3SPierre Pronchery    0x42, 0x12, 0x24, 0xf5, 0xe3, 0x70, 0xdd, 0x59,
1333*b077aed3SPierre Pronchery    0x48, 0x9c, 0xef, 0xd4, 0x8a, 0x3c, 0x29, 0x6a,
1334*b077aed3SPierre Pronchery    0x0c, 0x9c, 0xf2, 0x13, 0xa4, 0x1c, 0x2f, 0x49,
1335*b077aed3SPierre Pronchery    0xcd, 0xb4, 0xaa, 0x28, 0x40, 0x34, 0xc6, 0x75,
1336*b077aed3SPierre Pronchery    0xba, 0x30, 0xe6, 0xd8, 0x5b, 0x2f, 0x08, 0xd0,
1337*b077aed3SPierre Pronchery    0x29, 0xa5, 0x39, 0xfb, 0x6e, 0x3b, 0x0f, 0x52,
1338*b077aed3SPierre Pronchery    0x2c, 0x68, 0xf0, 0x37, 0xa9, 0xd2, 0x56, 0xd6
1339*b077aed3SPierre Pronchery};
1340*b077aed3SPierre Pronchery
1341*b077aed3SPierre Proncherystatic const unsigned char rsa_asym_plaintext_encrypt[256] = {
1342*b077aed3SPierre Pronchery   0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
1343*b077aed3SPierre Pronchery   0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
1344*b077aed3SPierre Pronchery};
1345*b077aed3SPierre Proncherystatic const unsigned char rsa_asym_expected_encrypt[256] = {
1346*b077aed3SPierre Pronchery    0x54, 0xac, 0x23, 0x96, 0x1d, 0x82, 0x5d, 0x8b,
1347*b077aed3SPierre Pronchery    0x8f, 0x36, 0x33, 0xd0, 0xf4, 0x02, 0xa2, 0x61,
1348*b077aed3SPierre Pronchery    0xb1, 0x13, 0xd4, 0x4a, 0x46, 0x06, 0x37, 0x3c,
1349*b077aed3SPierre Pronchery    0xbf, 0x40, 0x05, 0x3c, 0xc6, 0x3b, 0x64, 0xdc,
1350*b077aed3SPierre Pronchery    0x22, 0x22, 0xaf, 0x36, 0x79, 0x62, 0x45, 0xf0,
1351*b077aed3SPierre Pronchery    0x97, 0x82, 0x22, 0x44, 0x86, 0x4a, 0x7c, 0xfa,
1352*b077aed3SPierre Pronchery    0xac, 0x03, 0x21, 0x84, 0x3f, 0x31, 0xad, 0x2a,
1353*b077aed3SPierre Pronchery    0xa4, 0x6e, 0x7a, 0xc5, 0x93, 0xf3, 0x0f, 0xfc,
1354*b077aed3SPierre Pronchery    0xf1, 0x62, 0xce, 0x82, 0x12, 0x45, 0xc9, 0x35,
1355*b077aed3SPierre Pronchery    0xb0, 0x7a, 0xcd, 0x99, 0x8c, 0x91, 0x6b, 0x5a,
1356*b077aed3SPierre Pronchery    0xd3, 0x46, 0xdb, 0xf9, 0x9e, 0x52, 0x49, 0xbd,
1357*b077aed3SPierre Pronchery    0x1e, 0xe8, 0xda, 0xac, 0x61, 0x47, 0xc2, 0xda,
1358*b077aed3SPierre Pronchery    0xfc, 0x1e, 0xfb, 0x74, 0xd7, 0xd6, 0xc1, 0x18,
1359*b077aed3SPierre Pronchery    0x86, 0x3e, 0x20, 0x9c, 0x7a, 0xe1, 0x04, 0xb7,
1360*b077aed3SPierre Pronchery    0x38, 0x43, 0xb1, 0x4e, 0xa0, 0xd8, 0xc1, 0x39,
1361*b077aed3SPierre Pronchery    0x4d, 0xe1, 0xd3, 0xb0, 0xb3, 0xf1, 0x82, 0x87,
1362*b077aed3SPierre Pronchery    0x1f, 0x74, 0xb5, 0x69, 0xfd, 0x33, 0xd6, 0x21,
1363*b077aed3SPierre Pronchery    0x7c, 0x61, 0x60, 0x28, 0xca, 0x70, 0xdb, 0xa0,
1364*b077aed3SPierre Pronchery    0xbb, 0xc8, 0x73, 0xa9, 0x82, 0xf8, 0x6b, 0xd8,
1365*b077aed3SPierre Pronchery    0xf0, 0xc9, 0x7b, 0x20, 0xdf, 0x9d, 0xfb, 0x8c,
1366*b077aed3SPierre Pronchery    0xd4, 0xa2, 0x89, 0xe1, 0x9b, 0x04, 0xad, 0xaa,
1367*b077aed3SPierre Pronchery    0x11, 0x6c, 0x8f, 0xce, 0x83, 0x29, 0x56, 0x69,
1368*b077aed3SPierre Pronchery    0xbb, 0x00, 0x3b, 0xef, 0xca, 0x2d, 0xcd, 0x52,
1369*b077aed3SPierre Pronchery    0xc8, 0xf1, 0xb3, 0x9b, 0xb4, 0x4f, 0x6d, 0x9c,
1370*b077aed3SPierre Pronchery    0x3d, 0x69, 0xcc, 0x6d, 0x1f, 0x38, 0x4d, 0xe6,
1371*b077aed3SPierre Pronchery    0xbb, 0x0c, 0x87, 0xdc, 0x5f, 0xa9, 0x24, 0x93,
1372*b077aed3SPierre Pronchery    0x03, 0x46, 0xa2, 0x33, 0x6c, 0xf4, 0xd8, 0x5d,
1373*b077aed3SPierre Pronchery    0x68, 0xf3, 0xd3, 0xe0, 0xf2, 0x30, 0xdb, 0xf5,
1374*b077aed3SPierre Pronchery    0x4f, 0x0f, 0xad, 0xc7, 0xd0, 0xaa, 0x47, 0xd9,
1375*b077aed3SPierre Pronchery    0x9f, 0x85, 0x1b, 0x2e, 0x6c, 0x3c, 0x57, 0x04,
1376*b077aed3SPierre Pronchery    0x29, 0xf4, 0xf5, 0x66, 0x7d, 0x93, 0x4a, 0xaa,
1377*b077aed3SPierre Pronchery    0x05, 0x52, 0x55, 0xc1, 0xc6, 0x06, 0x90, 0xab,
1378*b077aed3SPierre Pronchery};
1379*b077aed3SPierre Pronchery
1380*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_EC
1381*b077aed3SPierre Pronchery/* ECDSA key data */
1382*b077aed3SPierre Proncherystatic const char ecd_prime_curve_name[] = "secp224r1";
1383*b077aed3SPierre Proncherystatic const unsigned char ecd_prime_priv[] = {
1384*b077aed3SPierre Pronchery    0x98, 0x1f, 0xb5, 0xf1, 0xfc, 0x87, 0x1d, 0x7d,
1385*b077aed3SPierre Pronchery    0xde, 0x1e, 0x01, 0x64, 0x09, 0x9b, 0xe7, 0x1b,
1386*b077aed3SPierre Pronchery    0x9f, 0xad, 0x63, 0xdd, 0x33, 0x01, 0xd1, 0x50,
1387*b077aed3SPierre Pronchery    0x80, 0x93, 0x50, 0x30
1388*b077aed3SPierre Pronchery};
1389*b077aed3SPierre Proncherystatic const unsigned char ecd_prime_pub[] = {
1390*b077aed3SPierre Pronchery    0x04, 0x95, 0x47, 0x99, 0x44, 0x29, 0x8f, 0x51,
1391*b077aed3SPierre Pronchery    0x39, 0xe2, 0x53, 0xec, 0x79, 0xb0, 0x4d, 0xde,
1392*b077aed3SPierre Pronchery    0x87, 0x1a, 0x76, 0x54, 0xd5, 0x96, 0xb8, 0x7a,
1393*b077aed3SPierre Pronchery    0x6d, 0xf4, 0x1c, 0x2c, 0x87, 0x91, 0x5f, 0xd5,
1394*b077aed3SPierre Pronchery    0x31, 0xdd, 0x24, 0xe5, 0x78, 0xd9, 0x08, 0x24,
1395*b077aed3SPierre Pronchery    0x8a, 0x49, 0x99, 0xec, 0x55, 0xf2, 0x82, 0xb3,
1396*b077aed3SPierre Pronchery    0xc4, 0xb7, 0x33, 0x68, 0xe4, 0x24, 0xa9, 0x12,
1397*b077aed3SPierre Pronchery    0x82
1398*b077aed3SPierre Pronchery};
1399*b077aed3SPierre Proncherystatic const ST_KAT_PARAM ecdsa_prime_key[] = {
1400*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_PKEY_PARAM_GROUP_NAME, ecd_prime_curve_name),
1401*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PUB_KEY, ecd_prime_pub),
1402*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PRIV_KEY, ecd_prime_priv),
1403*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1404*b077aed3SPierre Pronchery};
1405*b077aed3SPierre Pronchery
1406*b077aed3SPierre Pronchery# ifndef OPENSSL_NO_EC2M
1407*b077aed3SPierre Proncherystatic const char ecd_bin_curve_name[] = "sect233r1";
1408*b077aed3SPierre Proncherystatic const unsigned char ecd_bin_priv[] = {
1409*b077aed3SPierre Pronchery    0x00, 0x6d, 0xd6, 0x39, 0x9d, 0x2a, 0xa2, 0xc8,
1410*b077aed3SPierre Pronchery    0x8c, 0xfc, 0x7b, 0x80, 0x66, 0xaa, 0xe1, 0xaa,
1411*b077aed3SPierre Pronchery    0xba, 0xee, 0xcb, 0xfd, 0xc9, 0xe5, 0x36, 0x38,
1412*b077aed3SPierre Pronchery    0x2e, 0xf7, 0x37, 0x6d, 0xd3, 0x20
1413*b077aed3SPierre Pronchery};
1414*b077aed3SPierre Proncherystatic const unsigned char ecd_bin_pub[] = {
1415*b077aed3SPierre Pronchery    0x04, 0x00, 0x06, 0xe2, 0x56, 0xf7, 0x37, 0xf9,
1416*b077aed3SPierre Pronchery    0xea, 0xb6, 0xd1, 0x0f, 0x59, 0xfa, 0x23, 0xc3,
1417*b077aed3SPierre Pronchery    0x93, 0xa8, 0xb2, 0x26, 0xe2, 0x5c, 0x08, 0xbe,
1418*b077aed3SPierre Pronchery    0x63, 0x49, 0x26, 0xdc, 0xc7, 0x1e, 0x6f, 0x01,
1419*b077aed3SPierre Pronchery    0x32, 0x3b, 0xe6, 0x54, 0x8d, 0xc1, 0x13, 0x3e,
1420*b077aed3SPierre Pronchery    0x54, 0xb2, 0x66, 0x89, 0xb2, 0x82, 0x0a, 0x72,
1421*b077aed3SPierre Pronchery    0x02, 0xa8, 0xe9, 0x6f, 0x54, 0xfd, 0x3a, 0x6b,
1422*b077aed3SPierre Pronchery    0x99, 0xb6, 0x8f, 0x80, 0x46
1423*b077aed3SPierre Pronchery};
1424*b077aed3SPierre Proncherystatic const ST_KAT_PARAM ecdsa_bin_key[] = {
1425*b077aed3SPierre Pronchery    ST_KAT_PARAM_UTF8STRING(OSSL_PKEY_PARAM_GROUP_NAME, ecd_bin_curve_name),
1426*b077aed3SPierre Pronchery    ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_PUB_KEY, ecd_bin_pub),
1427*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PRIV_KEY, ecd_bin_priv),
1428*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1429*b077aed3SPierre Pronchery};
1430*b077aed3SPierre Pronchery# endif /* OPENSSL_NO_EC2M */
1431*b077aed3SPierre Pronchery#endif /* OPENSSL_NO_EC */
1432*b077aed3SPierre Pronchery
1433*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DSA
1434*b077aed3SPierre Pronchery/* dsa 2048 */
1435*b077aed3SPierre Proncherystatic const unsigned char dsa_p[] = {
1436*b077aed3SPierre Pronchery    0xa2, 0x9b, 0x88, 0x72, 0xce, 0x8b, 0x84, 0x23,
1437*b077aed3SPierre Pronchery    0xb7, 0xd5, 0xd2, 0x1d, 0x4b, 0x02, 0xf5, 0x7e,
1438*b077aed3SPierre Pronchery    0x03, 0xe9, 0xe6, 0xb8, 0xa2, 0x58, 0xdc, 0x16,
1439*b077aed3SPierre Pronchery    0x61, 0x1b, 0xa0, 0x98, 0xab, 0x54, 0x34, 0x15,
1440*b077aed3SPierre Pronchery    0xe4, 0x15, 0xf1, 0x56, 0x99, 0x7a, 0x3e, 0xe2,
1441*b077aed3SPierre Pronchery    0x36, 0x65, 0x8f, 0xa0, 0x93, 0x26, 0x0d, 0xe3,
1442*b077aed3SPierre Pronchery    0xad, 0x42, 0x2e, 0x05, 0xe0, 0x46, 0xf9, 0xec,
1443*b077aed3SPierre Pronchery    0x29, 0x16, 0x1a, 0x37, 0x5f, 0x0e, 0xb4, 0xef,
1444*b077aed3SPierre Pronchery    0xfc, 0xef, 0x58, 0x28, 0x5c, 0x5d, 0x39, 0xed,
1445*b077aed3SPierre Pronchery    0x42, 0x5d, 0x7a, 0x62, 0xca, 0x12, 0x89, 0x6c,
1446*b077aed3SPierre Pronchery    0x4a, 0x92, 0xcb, 0x19, 0x46, 0xf2, 0x95, 0x2a,
1447*b077aed3SPierre Pronchery    0x48, 0x13, 0x3f, 0x07, 0xda, 0x36, 0x4d, 0x1b,
1448*b077aed3SPierre Pronchery    0xdf, 0x6b, 0x0f, 0x71, 0x39, 0x98, 0x3e, 0x69,
1449*b077aed3SPierre Pronchery    0x3c, 0x80, 0x05, 0x9b, 0x0e, 0xac, 0xd1, 0x47,
1450*b077aed3SPierre Pronchery    0x9b, 0xa9, 0xf2, 0x85, 0x77, 0x54, 0xed, 0xe7,
1451*b077aed3SPierre Pronchery    0x5f, 0x11, 0x2b, 0x07, 0xeb, 0xbf, 0x35, 0x34,
1452*b077aed3SPierre Pronchery    0x8b, 0xbf, 0x3e, 0x01, 0xe0, 0x2f, 0x2d, 0x47,
1453*b077aed3SPierre Pronchery    0x3d, 0xe3, 0x94, 0x53, 0xf9, 0x9d, 0xd2, 0x36,
1454*b077aed3SPierre Pronchery    0x75, 0x41, 0xca, 0xca, 0x3b, 0xa0, 0x11, 0x66,
1455*b077aed3SPierre Pronchery    0x34, 0x3d, 0x7b, 0x5b, 0x58, 0xa3, 0x7b, 0xd1,
1456*b077aed3SPierre Pronchery    0xb7, 0x52, 0x1d, 0xb2, 0xf1, 0x3b, 0x86, 0x70,
1457*b077aed3SPierre Pronchery    0x71, 0x32, 0xfe, 0x09, 0xf4, 0xcd, 0x09, 0xdc,
1458*b077aed3SPierre Pronchery    0x16, 0x18, 0xfa, 0x34, 0x01, 0xeb, 0xf9, 0xcc,
1459*b077aed3SPierre Pronchery    0x7b, 0x19, 0xfa, 0x94, 0xaa, 0x47, 0x20, 0x88,
1460*b077aed3SPierre Pronchery    0x13, 0x3d, 0x6c, 0xb2, 0xd3, 0x5c, 0x11, 0x79,
1461*b077aed3SPierre Pronchery    0xc8, 0xc8, 0xff, 0x36, 0x87, 0x58, 0xd5, 0x07,
1462*b077aed3SPierre Pronchery    0xd9, 0xf9, 0xa1, 0x7d, 0x46, 0xc1, 0x10, 0xfe,
1463*b077aed3SPierre Pronchery    0x31, 0x44, 0xce, 0x9b, 0x02, 0x2b, 0x42, 0xe4,
1464*b077aed3SPierre Pronchery    0x19, 0xeb, 0x4f, 0x53, 0x88, 0x61, 0x3b, 0xfc,
1465*b077aed3SPierre Pronchery    0x3e, 0x26, 0x24, 0x1a, 0x43, 0x2e, 0x87, 0x06,
1466*b077aed3SPierre Pronchery    0xbc, 0x58, 0xef, 0x76, 0x11, 0x72, 0x78, 0xde,
1467*b077aed3SPierre Pronchery    0xab, 0x6c, 0xf6, 0x92, 0x61, 0x82, 0x91, 0xb7
1468*b077aed3SPierre Pronchery};
1469*b077aed3SPierre Proncherystatic const unsigned char dsa_q[] = {
1470*b077aed3SPierre Pronchery    0xa3, 0xbf, 0xd9, 0xab, 0x78, 0x84, 0x79, 0x4e,
1471*b077aed3SPierre Pronchery    0x38, 0x34, 0x50, 0xd5, 0x89, 0x1d, 0xc1, 0x8b,
1472*b077aed3SPierre Pronchery    0x65, 0x15, 0x7b, 0xdc, 0xfc, 0xda, 0xc5, 0x15,
1473*b077aed3SPierre Pronchery    0x18, 0x90, 0x28, 0x67
1474*b077aed3SPierre Pronchery};
1475*b077aed3SPierre Proncherystatic const unsigned char dsa_g[] = {
1476*b077aed3SPierre Pronchery    0x68, 0x19, 0x27, 0x88, 0x69, 0xc7, 0xfd, 0x3d,
1477*b077aed3SPierre Pronchery    0x2d, 0x7b, 0x77, 0xf7, 0x7e, 0x81, 0x50, 0xd9,
1478*b077aed3SPierre Pronchery    0xad, 0x43, 0x3b, 0xea, 0x3b, 0xa8, 0x5e, 0xfc,
1479*b077aed3SPierre Pronchery    0x80, 0x41, 0x5a, 0xa3, 0x54, 0x5f, 0x78, 0xf7,
1480*b077aed3SPierre Pronchery    0x22, 0x96, 0xf0, 0x6c, 0xb1, 0x9c, 0xed, 0xa0,
1481*b077aed3SPierre Pronchery    0x6c, 0x94, 0xb0, 0x55, 0x1c, 0xfe, 0x6e, 0x6f,
1482*b077aed3SPierre Pronchery    0x86, 0x3e, 0x31, 0xd1, 0xde, 0x6e, 0xed, 0x7d,
1483*b077aed3SPierre Pronchery    0xab, 0x8b, 0x0c, 0x9d, 0xf2, 0x31, 0xe0, 0x84,
1484*b077aed3SPierre Pronchery    0x34, 0xd1, 0x18, 0x4f, 0x91, 0xd0, 0x33, 0x69,
1485*b077aed3SPierre Pronchery    0x6b, 0xb3, 0x82, 0xf8, 0x45, 0x5e, 0x98, 0x88,
1486*b077aed3SPierre Pronchery    0xf5, 0xd3, 0x1d, 0x47, 0x84, 0xec, 0x40, 0x12,
1487*b077aed3SPierre Pronchery    0x02, 0x46, 0xf4, 0xbe, 0xa6, 0x17, 0x94, 0xbb,
1488*b077aed3SPierre Pronchery    0xa5, 0x86, 0x6f, 0x09, 0x74, 0x64, 0x63, 0xbd,
1489*b077aed3SPierre Pronchery    0xf8, 0xe9, 0xe1, 0x08, 0xcd, 0x95, 0x29, 0xc3,
1490*b077aed3SPierre Pronchery    0xd0, 0xf6, 0xdf, 0x80, 0x31, 0x6e, 0x2e, 0x70,
1491*b077aed3SPierre Pronchery    0xaa, 0xeb, 0x1b, 0x26, 0xcd, 0xb8, 0xad, 0x97,
1492*b077aed3SPierre Pronchery    0xbc, 0x3d, 0x28, 0x7e, 0x0b, 0x8d, 0x61, 0x6c,
1493*b077aed3SPierre Pronchery    0x42, 0xe6, 0x5b, 0x87, 0xdb, 0x20, 0xde, 0xb7,
1494*b077aed3SPierre Pronchery    0x00, 0x5b, 0xc4, 0x16, 0x74, 0x7a, 0x64, 0x70,
1495*b077aed3SPierre Pronchery    0x14, 0x7a, 0x68, 0xa7, 0x82, 0x03, 0x88, 0xeb,
1496*b077aed3SPierre Pronchery    0xf4, 0x4d, 0x52, 0xe0, 0x62, 0x8a, 0xf9, 0xcf,
1497*b077aed3SPierre Pronchery    0x1b, 0x71, 0x66, 0xd0, 0x34, 0x65, 0xf3, 0x5a,
1498*b077aed3SPierre Pronchery    0xcc, 0x31, 0xb6, 0x11, 0x0c, 0x43, 0xda, 0xbc,
1499*b077aed3SPierre Pronchery    0x7c, 0x5d, 0x59, 0x1e, 0x67, 0x1e, 0xaf, 0x7c,
1500*b077aed3SPierre Pronchery    0x25, 0x2c, 0x1c, 0x14, 0x53, 0x36, 0xa1, 0xa4,
1501*b077aed3SPierre Pronchery    0xdd, 0xf1, 0x32, 0x44, 0xd5, 0x5e, 0x83, 0x56,
1502*b077aed3SPierre Pronchery    0x80, 0xca, 0xb2, 0x53, 0x3b, 0x82, 0xdf, 0x2e,
1503*b077aed3SPierre Pronchery    0xfe, 0x55, 0xec, 0x18, 0xc1, 0xe6, 0xcd, 0x00,
1504*b077aed3SPierre Pronchery    0x7b, 0xb0, 0x89, 0x75, 0x8b, 0xb1, 0x7c, 0x2c,
1505*b077aed3SPierre Pronchery    0xbe, 0x14, 0x44, 0x1b, 0xd0, 0x93, 0xae, 0x66,
1506*b077aed3SPierre Pronchery    0xe5, 0x97, 0x6d, 0x53, 0x73, 0x3f, 0x4f, 0xa3,
1507*b077aed3SPierre Pronchery    0x26, 0x97, 0x01, 0xd3, 0x1d, 0x23, 0xd4, 0x67
1508*b077aed3SPierre Pronchery};
1509*b077aed3SPierre Proncherystatic const unsigned char dsa_pub[] = {
1510*b077aed3SPierre Pronchery    0xa0, 0x12, 0xb3, 0xb1, 0x70, 0xb3, 0x07, 0x22,
1511*b077aed3SPierre Pronchery    0x79, 0x57, 0xb7, 0xca, 0x20, 0x61, 0xa8, 0x16,
1512*b077aed3SPierre Pronchery    0xac, 0x7a, 0x2b, 0x3d, 0x9a, 0xe9, 0x95, 0xa5,
1513*b077aed3SPierre Pronchery    0x11, 0x9c, 0x38, 0x5b, 0x60, 0x3b, 0xf6, 0xf6,
1514*b077aed3SPierre Pronchery    0xc5, 0xde, 0x4d, 0xc5, 0xec, 0xb5, 0xdf, 0xa4,
1515*b077aed3SPierre Pronchery    0xa4, 0x1c, 0x68, 0x66, 0x2e, 0xb2, 0x5b, 0x63,
1516*b077aed3SPierre Pronchery    0x8b, 0x7e, 0x26, 0x20, 0xba, 0x89, 0x8d, 0x07,
1517*b077aed3SPierre Pronchery    0xda, 0x6c, 0x49, 0x91, 0xe7, 0x6c, 0xc0, 0xec,
1518*b077aed3SPierre Pronchery    0xd1, 0xad, 0x34, 0x21, 0x07, 0x70, 0x67, 0xe4,
1519*b077aed3SPierre Pronchery    0x7c, 0x18, 0xf5, 0x8a, 0x92, 0xa7, 0x2a, 0xd4,
1520*b077aed3SPierre Pronchery    0x31, 0x99, 0xec, 0xb7, 0xbd, 0x84, 0xe7, 0xd3,
1521*b077aed3SPierre Pronchery    0xaf, 0xb9, 0x01, 0x9f, 0x0e, 0x9d, 0xd0, 0xfb,
1522*b077aed3SPierre Pronchery    0xaa, 0x48, 0x73, 0x00, 0xb1, 0x30, 0x81, 0xe3,
1523*b077aed3SPierre Pronchery    0x3c, 0x90, 0x28, 0x76, 0x43, 0x6f, 0x7b, 0x03,
1524*b077aed3SPierre Pronchery    0xc3, 0x45, 0x52, 0x84, 0x81, 0xd3, 0x62, 0x81,
1525*b077aed3SPierre Pronchery    0x5e, 0x24, 0xfe, 0x59, 0xda, 0xc5, 0xac, 0x34,
1526*b077aed3SPierre Pronchery    0x66, 0x0d, 0x4c, 0x8a, 0x76, 0xcb, 0x99, 0xa7,
1527*b077aed3SPierre Pronchery    0xc7, 0xde, 0x93, 0xeb, 0x95, 0x6c, 0xd6, 0xbc,
1528*b077aed3SPierre Pronchery    0x88, 0xe5, 0x8d, 0x90, 0x10, 0x34, 0x94, 0x4a,
1529*b077aed3SPierre Pronchery    0x09, 0x4b, 0x01, 0x80, 0x3a, 0x43, 0xc6, 0x72,
1530*b077aed3SPierre Pronchery    0xb9, 0x68, 0x8c, 0x0e, 0x01, 0xd8, 0xf4, 0xfc,
1531*b077aed3SPierre Pronchery    0x91, 0xc6, 0x2a, 0x3f, 0x88, 0x02, 0x1f, 0x7b,
1532*b077aed3SPierre Pronchery    0xd6, 0xa6, 0x51, 0xb1, 0xa8, 0x8f, 0x43, 0xaa,
1533*b077aed3SPierre Pronchery    0x4e, 0xf2, 0x76, 0x53, 0xd1, 0x2b, 0xf8, 0xb7,
1534*b077aed3SPierre Pronchery    0x09, 0x9f, 0xdf, 0x6b, 0x46, 0x10, 0x82, 0xf8,
1535*b077aed3SPierre Pronchery    0xe9, 0x39, 0x10, 0x7b, 0xfd, 0x2f, 0x72, 0x10,
1536*b077aed3SPierre Pronchery    0x08, 0x7d, 0x32, 0x6c, 0x37, 0x52, 0x00, 0xf1,
1537*b077aed3SPierre Pronchery    0xf5, 0x1e, 0x7e, 0x74, 0xa3, 0x41, 0x31, 0x90,
1538*b077aed3SPierre Pronchery    0x1b, 0xcd, 0x08, 0x63, 0x52, 0x1f, 0xf8, 0xd6,
1539*b077aed3SPierre Pronchery    0x76, 0xc4, 0x85, 0x81, 0x86, 0x87, 0x36, 0xc5,
1540*b077aed3SPierre Pronchery    0xe5, 0x1b, 0x16, 0xa4, 0xe3, 0x92, 0x15, 0xea,
1541*b077aed3SPierre Pronchery    0x0b, 0x17, 0xc4, 0x73, 0x59, 0x74, 0xc5, 0x16
1542*b077aed3SPierre Pronchery};
1543*b077aed3SPierre Proncherystatic const unsigned char dsa_priv[] = {
1544*b077aed3SPierre Pronchery    0x6c, 0xca, 0xee, 0xf6, 0xd7, 0x3b, 0x4e, 0x80,
1545*b077aed3SPierre Pronchery    0xf1, 0x1c, 0x17, 0xb8, 0xe9, 0x62, 0x7c, 0x03,
1546*b077aed3SPierre Pronchery    0x66, 0x35, 0xba, 0xc3, 0x94, 0x23, 0x50, 0x5e,
1547*b077aed3SPierre Pronchery    0x40, 0x7e, 0x5c, 0xb7
1548*b077aed3SPierre Pronchery};
1549*b077aed3SPierre Pronchery
1550*b077aed3SPierre Proncherystatic const ST_KAT_PARAM dsa_key[] = {
1551*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_FFC_P, dsa_p),
1552*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_FFC_Q, dsa_q),
1553*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_FFC_G, dsa_g),
1554*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PUB_KEY, dsa_pub),
1555*b077aed3SPierre Pronchery    ST_KAT_PARAM_BIGNUM(OSSL_PKEY_PARAM_PRIV_KEY, dsa_priv),
1556*b077aed3SPierre Pronchery    ST_KAT_PARAM_END()
1557*b077aed3SPierre Pronchery};
1558*b077aed3SPierre Pronchery#endif /* OPENSSL_NO_DSA */
1559*b077aed3SPierre Pronchery
1560*b077aed3SPierre Proncherystatic const ST_KAT_SIGN st_kat_sign_tests[] = {
1561*b077aed3SPierre Pronchery    {
1562*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_SIGN_RSA,
1563*b077aed3SPierre Pronchery        "RSA",
1564*b077aed3SPierre Pronchery        "SHA-256",
1565*b077aed3SPierre Pronchery        rsa_crt_key,
1566*b077aed3SPierre Pronchery        ITM(rsa_expected_sig)
1567*b077aed3SPierre Pronchery    },
1568*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_EC
1569*b077aed3SPierre Pronchery    {
1570*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_SIGN_ECDSA,
1571*b077aed3SPierre Pronchery        "EC",
1572*b077aed3SPierre Pronchery        "SHA-256",
1573*b077aed3SPierre Pronchery        ecdsa_prime_key,
1574*b077aed3SPierre Pronchery        /*
1575*b077aed3SPierre Pronchery         * The ECDSA signature changes each time due to it using a random k.
1576*b077aed3SPierre Pronchery         * So there is no expected KAT for this case.
1577*b077aed3SPierre Pronchery         */
1578*b077aed3SPierre Pronchery    },
1579*b077aed3SPierre Pronchery# ifndef OPENSSL_NO_EC2M
1580*b077aed3SPierre Pronchery    {
1581*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_SIGN_ECDSA,
1582*b077aed3SPierre Pronchery        "EC",
1583*b077aed3SPierre Pronchery        "SHA-256",
1584*b077aed3SPierre Pronchery        ecdsa_bin_key,
1585*b077aed3SPierre Pronchery        /*
1586*b077aed3SPierre Pronchery         * The ECDSA signature changes each time due to it using a random k.
1587*b077aed3SPierre Pronchery         * So there is no expected KAT for this case.
1588*b077aed3SPierre Pronchery         */
1589*b077aed3SPierre Pronchery    },
1590*b077aed3SPierre Pronchery# endif
1591*b077aed3SPierre Pronchery#endif /* OPENSSL_NO_EC */
1592*b077aed3SPierre Pronchery#ifndef OPENSSL_NO_DSA
1593*b077aed3SPierre Pronchery    {
1594*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_SIGN_DSA,
1595*b077aed3SPierre Pronchery        "DSA",
1596*b077aed3SPierre Pronchery        "SHA-256",
1597*b077aed3SPierre Pronchery        dsa_key,
1598*b077aed3SPierre Pronchery        /*
1599*b077aed3SPierre Pronchery         * The DSA signature changes each time due to it using a random k.
1600*b077aed3SPierre Pronchery         * So there is no expected KAT for this case.
1601*b077aed3SPierre Pronchery         */
1602*b077aed3SPierre Pronchery    },
1603*b077aed3SPierre Pronchery#endif /* OPENSSL_NO_DSA */
1604*b077aed3SPierre Pronchery};
1605*b077aed3SPierre Pronchery
1606*b077aed3SPierre Proncherystatic const ST_KAT_ASYM_CIPHER st_kat_asym_cipher_tests[] = {
1607*b077aed3SPierre Pronchery    {
1608*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_ASYM_RSA_ENC,
1609*b077aed3SPierre Pronchery        "RSA",
1610*b077aed3SPierre Pronchery        1,
1611*b077aed3SPierre Pronchery        rsa_pub_key,
1612*b077aed3SPierre Pronchery        rsa_enc_params,
1613*b077aed3SPierre Pronchery        ITM(rsa_asym_plaintext_encrypt),
1614*b077aed3SPierre Pronchery        ITM(rsa_asym_expected_encrypt),
1615*b077aed3SPierre Pronchery    },
1616*b077aed3SPierre Pronchery    {
1617*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_ASYM_RSA_DEC,
1618*b077aed3SPierre Pronchery        "RSA",
1619*b077aed3SPierre Pronchery        0,
1620*b077aed3SPierre Pronchery        rsa_priv_key,
1621*b077aed3SPierre Pronchery        rsa_enc_params,
1622*b077aed3SPierre Pronchery        ITM(rsa_asym_expected_encrypt),
1623*b077aed3SPierre Pronchery        ITM(rsa_asym_plaintext_encrypt),
1624*b077aed3SPierre Pronchery    },
1625*b077aed3SPierre Pronchery    {
1626*b077aed3SPierre Pronchery        OSSL_SELF_TEST_DESC_ASYM_RSA_DEC,
1627*b077aed3SPierre Pronchery        "RSA",
1628*b077aed3SPierre Pronchery        0,
1629*b077aed3SPierre Pronchery        rsa_crt_key,
1630*b077aed3SPierre Pronchery        rsa_enc_params,
1631*b077aed3SPierre Pronchery        ITM(rsa_asym_expected_encrypt),
1632*b077aed3SPierre Pronchery        ITM(rsa_asym_plaintext_encrypt),
1633*b077aed3SPierre Pronchery    },
1634*b077aed3SPierre Pronchery};
1635