xref: /freebsd-src/crypto/openssl/providers/implementations/rands/test_rng.c (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery /*
2*b077aed3SPierre Pronchery  * Copyright 2020-2021 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 #include <string.h>
11*b077aed3SPierre Pronchery #include <openssl/core_dispatch.h>
12*b077aed3SPierre Pronchery #include <openssl/e_os2.h>
13*b077aed3SPierre Pronchery #include <openssl/params.h>
14*b077aed3SPierre Pronchery #include <openssl/core_names.h>
15*b077aed3SPierre Pronchery #include <openssl/evp.h>
16*b077aed3SPierre Pronchery #include <openssl/err.h>
17*b077aed3SPierre Pronchery #include <openssl/randerr.h>
18*b077aed3SPierre Pronchery #include "prov/providercommon.h"
19*b077aed3SPierre Pronchery #include "prov/provider_ctx.h"
20*b077aed3SPierre Pronchery #include "prov/provider_util.h"
21*b077aed3SPierre Pronchery #include "prov/implementations.h"
22*b077aed3SPierre Pronchery 
23*b077aed3SPierre Pronchery static OSSL_FUNC_rand_newctx_fn test_rng_new;
24*b077aed3SPierre Pronchery static OSSL_FUNC_rand_freectx_fn test_rng_free;
25*b077aed3SPierre Pronchery static OSSL_FUNC_rand_instantiate_fn test_rng_instantiate;
26*b077aed3SPierre Pronchery static OSSL_FUNC_rand_uninstantiate_fn test_rng_uninstantiate;
27*b077aed3SPierre Pronchery static OSSL_FUNC_rand_generate_fn test_rng_generate;
28*b077aed3SPierre Pronchery static OSSL_FUNC_rand_reseed_fn test_rng_reseed;
29*b077aed3SPierre Pronchery static OSSL_FUNC_rand_nonce_fn test_rng_nonce;
30*b077aed3SPierre Pronchery static OSSL_FUNC_rand_settable_ctx_params_fn test_rng_settable_ctx_params;
31*b077aed3SPierre Pronchery static OSSL_FUNC_rand_set_ctx_params_fn test_rng_set_ctx_params;
32*b077aed3SPierre Pronchery static OSSL_FUNC_rand_gettable_ctx_params_fn test_rng_gettable_ctx_params;
33*b077aed3SPierre Pronchery static OSSL_FUNC_rand_get_ctx_params_fn test_rng_get_ctx_params;
34*b077aed3SPierre Pronchery static OSSL_FUNC_rand_verify_zeroization_fn test_rng_verify_zeroization;
35*b077aed3SPierre Pronchery static OSSL_FUNC_rand_enable_locking_fn test_rng_enable_locking;
36*b077aed3SPierre Pronchery static OSSL_FUNC_rand_lock_fn test_rng_lock;
37*b077aed3SPierre Pronchery static OSSL_FUNC_rand_unlock_fn test_rng_unlock;
38*b077aed3SPierre Pronchery static OSSL_FUNC_rand_get_seed_fn test_rng_get_seed;
39*b077aed3SPierre Pronchery 
40*b077aed3SPierre Pronchery typedef struct {
41*b077aed3SPierre Pronchery     void *provctx;
42*b077aed3SPierre Pronchery     int state;
43*b077aed3SPierre Pronchery     unsigned int strength;
44*b077aed3SPierre Pronchery     size_t max_request;
45*b077aed3SPierre Pronchery     unsigned char *entropy, *nonce;
46*b077aed3SPierre Pronchery     size_t entropy_len, entropy_pos, nonce_len;
47*b077aed3SPierre Pronchery     CRYPTO_RWLOCK *lock;
48*b077aed3SPierre Pronchery } PROV_TEST_RNG;
49*b077aed3SPierre Pronchery 
test_rng_new(void * provctx,void * parent,const OSSL_DISPATCH * parent_dispatch)50*b077aed3SPierre Pronchery static void *test_rng_new(void *provctx, void *parent,
51*b077aed3SPierre Pronchery                           const OSSL_DISPATCH *parent_dispatch)
52*b077aed3SPierre Pronchery {
53*b077aed3SPierre Pronchery     PROV_TEST_RNG *t;
54*b077aed3SPierre Pronchery 
55*b077aed3SPierre Pronchery     t = OPENSSL_zalloc(sizeof(*t));
56*b077aed3SPierre Pronchery     if (t == NULL)
57*b077aed3SPierre Pronchery         return NULL;
58*b077aed3SPierre Pronchery 
59*b077aed3SPierre Pronchery     t->max_request = INT_MAX;
60*b077aed3SPierre Pronchery     t->provctx = provctx;
61*b077aed3SPierre Pronchery     t->state = EVP_RAND_STATE_UNINITIALISED;
62*b077aed3SPierre Pronchery     return t;
63*b077aed3SPierre Pronchery }
64*b077aed3SPierre Pronchery 
test_rng_free(void * vtest)65*b077aed3SPierre Pronchery static void test_rng_free(void *vtest)
66*b077aed3SPierre Pronchery {
67*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
68*b077aed3SPierre Pronchery 
69*b077aed3SPierre Pronchery     if (t == NULL)
70*b077aed3SPierre Pronchery         return;
71*b077aed3SPierre Pronchery     OPENSSL_free(t->entropy);
72*b077aed3SPierre Pronchery     OPENSSL_free(t->nonce);
73*b077aed3SPierre Pronchery     CRYPTO_THREAD_lock_free(t->lock);
74*b077aed3SPierre Pronchery     OPENSSL_free(t);
75*b077aed3SPierre Pronchery }
76*b077aed3SPierre Pronchery 
test_rng_instantiate(void * vtest,unsigned int strength,int prediction_resistance,const unsigned char * pstr,size_t pstr_len,const OSSL_PARAM params[])77*b077aed3SPierre Pronchery static int test_rng_instantiate(void *vtest, unsigned int strength,
78*b077aed3SPierre Pronchery                                 int prediction_resistance,
79*b077aed3SPierre Pronchery                                 const unsigned char *pstr, size_t pstr_len,
80*b077aed3SPierre Pronchery                                 const OSSL_PARAM params[])
81*b077aed3SPierre Pronchery {
82*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
83*b077aed3SPierre Pronchery 
84*b077aed3SPierre Pronchery     if (!test_rng_set_ctx_params(t, params) || strength > t->strength)
85*b077aed3SPierre Pronchery         return 0;
86*b077aed3SPierre Pronchery 
87*b077aed3SPierre Pronchery     t->state = EVP_RAND_STATE_READY;
88*b077aed3SPierre Pronchery     t->entropy_pos = 0;
89*b077aed3SPierre Pronchery 
90*b077aed3SPierre Pronchery     return 1;
91*b077aed3SPierre Pronchery }
92*b077aed3SPierre Pronchery 
test_rng_uninstantiate(void * vtest)93*b077aed3SPierre Pronchery static int test_rng_uninstantiate(void *vtest)
94*b077aed3SPierre Pronchery {
95*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
96*b077aed3SPierre Pronchery 
97*b077aed3SPierre Pronchery     t->entropy_pos = 0;
98*b077aed3SPierre Pronchery     t->state = EVP_RAND_STATE_UNINITIALISED;
99*b077aed3SPierre Pronchery     return 1;
100*b077aed3SPierre Pronchery }
101*b077aed3SPierre Pronchery 
test_rng_generate(void * vtest,unsigned char * out,size_t outlen,unsigned int strength,int prediction_resistance,const unsigned char * adin,size_t adin_len)102*b077aed3SPierre Pronchery static int test_rng_generate(void *vtest, unsigned char *out, size_t outlen,
103*b077aed3SPierre Pronchery                              unsigned int strength, int prediction_resistance,
104*b077aed3SPierre Pronchery                              const unsigned char *adin, size_t adin_len)
105*b077aed3SPierre Pronchery {
106*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
107*b077aed3SPierre Pronchery 
108*b077aed3SPierre Pronchery     if (strength > t->strength || t->entropy_len - t->entropy_pos < outlen)
109*b077aed3SPierre Pronchery         return 0;
110*b077aed3SPierre Pronchery     memcpy(out, t->entropy + t->entropy_pos, outlen);
111*b077aed3SPierre Pronchery     t->entropy_pos += outlen;
112*b077aed3SPierre Pronchery     return 1;
113*b077aed3SPierre Pronchery }
114*b077aed3SPierre Pronchery 
test_rng_reseed(ossl_unused void * vtest,ossl_unused int prediction_resistance,ossl_unused const unsigned char * ent,ossl_unused size_t ent_len,ossl_unused const unsigned char * adin,ossl_unused size_t adin_len)115*b077aed3SPierre Pronchery static int test_rng_reseed(ossl_unused void *vtest,
116*b077aed3SPierre Pronchery                            ossl_unused int prediction_resistance,
117*b077aed3SPierre Pronchery                            ossl_unused const unsigned char *ent,
118*b077aed3SPierre Pronchery                            ossl_unused size_t ent_len,
119*b077aed3SPierre Pronchery                            ossl_unused const unsigned char *adin,
120*b077aed3SPierre Pronchery                            ossl_unused size_t adin_len)
121*b077aed3SPierre Pronchery {
122*b077aed3SPierre Pronchery     return 1;
123*b077aed3SPierre Pronchery }
124*b077aed3SPierre Pronchery 
test_rng_nonce(void * vtest,unsigned char * out,unsigned int strength,ossl_unused size_t min_noncelen,ossl_unused size_t max_noncelen)125*b077aed3SPierre Pronchery static size_t test_rng_nonce(void *vtest, unsigned char *out,
126*b077aed3SPierre Pronchery                              unsigned int strength,
127*b077aed3SPierre Pronchery                              ossl_unused size_t min_noncelen,
128*b077aed3SPierre Pronchery                              ossl_unused size_t max_noncelen)
129*b077aed3SPierre Pronchery {
130*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
131*b077aed3SPierre Pronchery 
132*b077aed3SPierre Pronchery     if (t->nonce == NULL || strength > t->strength)
133*b077aed3SPierre Pronchery         return 0;
134*b077aed3SPierre Pronchery 
135*b077aed3SPierre Pronchery     if (out != NULL)
136*b077aed3SPierre Pronchery         memcpy(out, t->nonce, t->nonce_len);
137*b077aed3SPierre Pronchery     return t->nonce_len;
138*b077aed3SPierre Pronchery }
139*b077aed3SPierre Pronchery 
test_rng_get_ctx_params(void * vtest,OSSL_PARAM params[])140*b077aed3SPierre Pronchery static int test_rng_get_ctx_params(void *vtest, OSSL_PARAM params[])
141*b077aed3SPierre Pronchery {
142*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
143*b077aed3SPierre Pronchery     OSSL_PARAM *p;
144*b077aed3SPierre Pronchery 
145*b077aed3SPierre Pronchery     p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
146*b077aed3SPierre Pronchery     if (p != NULL && !OSSL_PARAM_set_int(p, t->state))
147*b077aed3SPierre Pronchery         return 0;
148*b077aed3SPierre Pronchery 
149*b077aed3SPierre Pronchery     p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
150*b077aed3SPierre Pronchery     if (p != NULL && !OSSL_PARAM_set_int(p, t->strength))
151*b077aed3SPierre Pronchery         return 0;
152*b077aed3SPierre Pronchery 
153*b077aed3SPierre Pronchery     p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
154*b077aed3SPierre Pronchery     if (p != NULL && !OSSL_PARAM_set_size_t(p, t->max_request))
155*b077aed3SPierre Pronchery         return 0;
156*b077aed3SPierre Pronchery     return 1;
157*b077aed3SPierre Pronchery }
158*b077aed3SPierre Pronchery 
test_rng_gettable_ctx_params(ossl_unused void * vtest,ossl_unused void * provctx)159*b077aed3SPierre Pronchery static const OSSL_PARAM *test_rng_gettable_ctx_params(ossl_unused void *vtest,
160*b077aed3SPierre Pronchery                                                       ossl_unused void *provctx)
161*b077aed3SPierre Pronchery {
162*b077aed3SPierre Pronchery     static const OSSL_PARAM known_gettable_ctx_params[] = {
163*b077aed3SPierre Pronchery         OSSL_PARAM_int(OSSL_RAND_PARAM_STATE, NULL),
164*b077aed3SPierre Pronchery         OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
165*b077aed3SPierre Pronchery         OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
166*b077aed3SPierre Pronchery         OSSL_PARAM_END
167*b077aed3SPierre Pronchery     };
168*b077aed3SPierre Pronchery     return known_gettable_ctx_params;
169*b077aed3SPierre Pronchery }
170*b077aed3SPierre Pronchery 
test_rng_set_ctx_params(void * vtest,const OSSL_PARAM params[])171*b077aed3SPierre Pronchery static int test_rng_set_ctx_params(void *vtest, const OSSL_PARAM params[])
172*b077aed3SPierre Pronchery {
173*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
174*b077aed3SPierre Pronchery     const OSSL_PARAM *p;
175*b077aed3SPierre Pronchery     void *ptr = NULL;
176*b077aed3SPierre Pronchery     size_t size = 0;
177*b077aed3SPierre Pronchery 
178*b077aed3SPierre Pronchery     if (params == NULL)
179*b077aed3SPierre Pronchery         return 1;
180*b077aed3SPierre Pronchery 
181*b077aed3SPierre Pronchery     p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_STRENGTH);
182*b077aed3SPierre Pronchery     if (p != NULL && !OSSL_PARAM_get_uint(p, &t->strength))
183*b077aed3SPierre Pronchery         return 0;
184*b077aed3SPierre Pronchery 
185*b077aed3SPierre Pronchery     p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_TEST_ENTROPY);
186*b077aed3SPierre Pronchery     if (p != NULL) {
187*b077aed3SPierre Pronchery         if (!OSSL_PARAM_get_octet_string(p, &ptr, 0, &size))
188*b077aed3SPierre Pronchery             return 0;
189*b077aed3SPierre Pronchery         OPENSSL_free(t->entropy);
190*b077aed3SPierre Pronchery         t->entropy = ptr;
191*b077aed3SPierre Pronchery         t->entropy_len = size;
192*b077aed3SPierre Pronchery         t->entropy_pos = 0;
193*b077aed3SPierre Pronchery         ptr = NULL;
194*b077aed3SPierre Pronchery     }
195*b077aed3SPierre Pronchery 
196*b077aed3SPierre Pronchery     p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_TEST_NONCE);
197*b077aed3SPierre Pronchery     if (p != NULL) {
198*b077aed3SPierre Pronchery         if (!OSSL_PARAM_get_octet_string(p, &ptr, 0, &size))
199*b077aed3SPierre Pronchery             return 0;
200*b077aed3SPierre Pronchery         OPENSSL_free(t->nonce);
201*b077aed3SPierre Pronchery         t->nonce = ptr;
202*b077aed3SPierre Pronchery         t->nonce_len = size;
203*b077aed3SPierre Pronchery     }
204*b077aed3SPierre Pronchery 
205*b077aed3SPierre Pronchery     p = OSSL_PARAM_locate_const(params, OSSL_RAND_PARAM_MAX_REQUEST);
206*b077aed3SPierre Pronchery     if (p != NULL  && !OSSL_PARAM_get_size_t(p, &t->max_request))
207*b077aed3SPierre Pronchery         return 0;
208*b077aed3SPierre Pronchery 
209*b077aed3SPierre Pronchery     return 1;
210*b077aed3SPierre Pronchery }
211*b077aed3SPierre Pronchery 
test_rng_settable_ctx_params(ossl_unused void * vtest,ossl_unused void * provctx)212*b077aed3SPierre Pronchery static const OSSL_PARAM *test_rng_settable_ctx_params(ossl_unused void *vtest,
213*b077aed3SPierre Pronchery                                                       ossl_unused void *provctx)
214*b077aed3SPierre Pronchery {
215*b077aed3SPierre Pronchery     static const OSSL_PARAM known_settable_ctx_params[] = {
216*b077aed3SPierre Pronchery         OSSL_PARAM_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY, NULL, 0),
217*b077aed3SPierre Pronchery         OSSL_PARAM_octet_string(OSSL_RAND_PARAM_TEST_NONCE, NULL, 0),
218*b077aed3SPierre Pronchery         OSSL_PARAM_uint(OSSL_RAND_PARAM_STRENGTH, NULL),
219*b077aed3SPierre Pronchery         OSSL_PARAM_size_t(OSSL_RAND_PARAM_MAX_REQUEST, NULL),
220*b077aed3SPierre Pronchery         OSSL_PARAM_END
221*b077aed3SPierre Pronchery     };
222*b077aed3SPierre Pronchery     return known_settable_ctx_params;
223*b077aed3SPierre Pronchery }
224*b077aed3SPierre Pronchery 
test_rng_verify_zeroization(ossl_unused void * vtest)225*b077aed3SPierre Pronchery static int test_rng_verify_zeroization(ossl_unused void *vtest)
226*b077aed3SPierre Pronchery {
227*b077aed3SPierre Pronchery     return 1;
228*b077aed3SPierre Pronchery }
229*b077aed3SPierre Pronchery 
test_rng_get_seed(void * vtest,unsigned char ** pout,int entropy,size_t min_len,size_t max_len,ossl_unused int prediction_resistance,ossl_unused const unsigned char * adin,ossl_unused size_t adin_len)230*b077aed3SPierre Pronchery static size_t test_rng_get_seed(void *vtest, unsigned char **pout,
231*b077aed3SPierre Pronchery                                 int entropy, size_t min_len, size_t max_len,
232*b077aed3SPierre Pronchery                                 ossl_unused int prediction_resistance,
233*b077aed3SPierre Pronchery                                 ossl_unused const unsigned char *adin,
234*b077aed3SPierre Pronchery                                 ossl_unused size_t adin_len)
235*b077aed3SPierre Pronchery {
236*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
237*b077aed3SPierre Pronchery 
238*b077aed3SPierre Pronchery     *pout = t->entropy;
239*b077aed3SPierre Pronchery     return  t->entropy_len > max_len ? max_len : t->entropy_len;
240*b077aed3SPierre Pronchery }
241*b077aed3SPierre Pronchery 
test_rng_enable_locking(void * vtest)242*b077aed3SPierre Pronchery static int test_rng_enable_locking(void *vtest)
243*b077aed3SPierre Pronchery {
244*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
245*b077aed3SPierre Pronchery 
246*b077aed3SPierre Pronchery     if (t != NULL && t->lock == NULL) {
247*b077aed3SPierre Pronchery         t->lock = CRYPTO_THREAD_lock_new();
248*b077aed3SPierre Pronchery         if (t->lock == NULL) {
249*b077aed3SPierre Pronchery             ERR_raise(ERR_LIB_PROV, RAND_R_FAILED_TO_CREATE_LOCK);
250*b077aed3SPierre Pronchery             return 0;
251*b077aed3SPierre Pronchery         }
252*b077aed3SPierre Pronchery     }
253*b077aed3SPierre Pronchery     return 1;
254*b077aed3SPierre Pronchery }
255*b077aed3SPierre Pronchery 
test_rng_lock(void * vtest)256*b077aed3SPierre Pronchery static int test_rng_lock(void *vtest)
257*b077aed3SPierre Pronchery {
258*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
259*b077aed3SPierre Pronchery 
260*b077aed3SPierre Pronchery     if (t == NULL || t->lock == NULL)
261*b077aed3SPierre Pronchery         return 1;
262*b077aed3SPierre Pronchery     return CRYPTO_THREAD_write_lock(t->lock);
263*b077aed3SPierre Pronchery }
264*b077aed3SPierre Pronchery 
test_rng_unlock(void * vtest)265*b077aed3SPierre Pronchery static void test_rng_unlock(void *vtest)
266*b077aed3SPierre Pronchery {
267*b077aed3SPierre Pronchery     PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
268*b077aed3SPierre Pronchery 
269*b077aed3SPierre Pronchery     if (t != NULL && t->lock != NULL)
270*b077aed3SPierre Pronchery         CRYPTO_THREAD_unlock(t->lock);
271*b077aed3SPierre Pronchery }
272*b077aed3SPierre Pronchery 
273*b077aed3SPierre Pronchery const OSSL_DISPATCH ossl_test_rng_functions[] = {
274*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_NEWCTX, (void(*)(void))test_rng_new },
275*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_FREECTX, (void(*)(void))test_rng_free },
276*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_INSTANTIATE,
277*b077aed3SPierre Pronchery       (void(*)(void))test_rng_instantiate },
278*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_UNINSTANTIATE,
279*b077aed3SPierre Pronchery       (void(*)(void))test_rng_uninstantiate },
280*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_GENERATE, (void(*)(void))test_rng_generate },
281*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_RESEED, (void(*)(void))test_rng_reseed },
282*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_NONCE, (void(*)(void))test_rng_nonce },
283*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_ENABLE_LOCKING, (void(*)(void))test_rng_enable_locking },
284*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_LOCK, (void(*)(void))test_rng_lock },
285*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_UNLOCK, (void(*)(void))test_rng_unlock },
286*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS,
287*b077aed3SPierre Pronchery       (void(*)(void))test_rng_settable_ctx_params },
288*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_SET_CTX_PARAMS, (void(*)(void))test_rng_set_ctx_params },
289*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS,
290*b077aed3SPierre Pronchery       (void(*)(void))test_rng_gettable_ctx_params },
291*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_GET_CTX_PARAMS, (void(*)(void))test_rng_get_ctx_params },
292*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_VERIFY_ZEROIZATION,
293*b077aed3SPierre Pronchery       (void(*)(void))test_rng_verify_zeroization },
294*b077aed3SPierre Pronchery     { OSSL_FUNC_RAND_GET_SEED, (void(*)(void))test_rng_get_seed },
295*b077aed3SPierre Pronchery     { 0, NULL }
296*b077aed3SPierre Pronchery };
297