Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
.\"	$NetBSD: provider-rand.7,v 1.2 2023/05/31 19:42:44 christos Exp $
.\"
.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "PROVIDER-RAND 7"
.TH PROVIDER-RAND 7 "2023-05-07" "3.0.9" "OpenSSL"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
provider\-rand \- The random number generation library <\-> provider
functions
.SH "LIBRARY"
libcrypto, -lcrypto
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& #include <openssl/core_dispatch.h>
\& #include <openssl/core_names.h>
\&
\& /*
\&  * None of these are actual functions, but are displayed like this for
\&  * the function signatures for functions that are offered as function
\&  * pointers in OSSL_DISPATCH arrays.
\&  */
\&
\& /* Context management */
\& void *OSSL_FUNC_rand_newctx(void *provctx, void *parent,
\&                             const OSSL_DISPATCH *parent_calls);
\& void OSSL_FUNC_rand_freectx(void *ctx);
\&
\& /* Random number generator functions: NIST */
\& int OSSL_FUNC_rand_instantiate(void *ctx, unsigned int strength,
\&                                int prediction_resistance,
\&                                const unsigned char *pstr, size_t pstr_len,
\&                                const OSSL_PARAM params[]);
\& int OSSL_FUNC_rand_uninstantiate(void *ctx);
\& int OSSL_FUNC_rand_generate(void *ctx, unsigned char *out, size_t outlen,
\&                             unsigned int strength, int prediction_resistance,
\&                             const unsigned char *addin, size_t addin_len);
\& int OSSL_FUNC_rand_reseed(void *ctx, int prediction_resistance,
\&                           const unsigned char *ent, size_t ent_len,
\&                           const unsigned char *addin, size_t addin_len);
\&
\& /* Random number generator functions: additional */
\& size_t OSSL_FUNC_rand_nonce(void *ctx, unsigned char *out, size_t outlen,
\&                             int strength, size_t min_noncelen,
\&                             size_t max_noncelen);
\& size_t OSSL_FUNC_rand_get_seed(void *ctx, unsigned char **buffer,
\&                                int entropy, size_t min_len, size_t max_len,
\&                                int prediction_resistance,
\&                                const unsigned char *adin, size_t adin_len);
\& void OSSL_FUNC_rand_clear_seed(void *ctx, unsigned char *buffer, size_t b_len);
\& int OSSL_FUNC_rand_verify_zeroization(void *ctx);
\&
\& /* Context Locking */
\& int OSSL_FUNC_rand_enable_locking(void *ctx);
\& int OSSL_FUNC_rand_lock(void *ctx);
\& void OSSL_FUNC_rand_unlock(void *ctx);
\&
\& /* RAND parameter descriptors */
\& const OSSL_PARAM *OSSL_FUNC_rand_gettable_params(void *provctx);
\& const OSSL_PARAM *OSSL_FUNC_rand_gettable_ctx_params(void *ctx, void *provctx);
\& const OSSL_PARAM *OSSL_FUNC_rand_settable_ctx_params(void *ctx, void *provctx);
\&
\& /* RAND parameters */
\& int OSSL_FUNC_rand_get_params(OSSL_PARAM params[]);
\& int OSSL_FUNC_rand_get_ctx_params(void *ctx, OSSL_PARAM params[]);
\& int OSSL_FUNC_rand_set_ctx_params(void *ctx, const OSSL_PARAM params[]);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This documentation is primarily aimed at provider authors. See \fBprovider\fR\|(7)
for further information.
.PP
The \s-1RAND\s0 operation enables providers to implement random number generation
algorithms and random number sources and make
them available to applications via the \s-1API\s0 function \s-1\fBEVP_RAND\s0\fR\|(3).
.SS "Context Management Functions"
.IX Subsection "Context Management Functions"
\&\fBOSSL_FUNC_rand_newctx()\fR should create and return a pointer to a provider side
structure for holding context information during a rand operation.
A pointer to this context will be passed back in a number of the other rand
operation function calls.
The parameter \fIprovctx\fR is the provider context generated during provider
initialisation (see \fBprovider\fR\|(7)).
The parameter \fIparent\fR specifies another rand instance to be used for
seeding purposes.  If \s-1NULL\s0 and the specific instance supports it, the
operating system will be used for seeding.
The parameter \fIparent_calls\fR points to the dispatch table for \fIparent\fR.
Thus, the parent need not be from the same provider as the new instance.
.PP
\&\fBOSSL_FUNC_rand_freectx()\fR is passed a pointer to the provider side rand context in
the \fImctx\fR parameter.
If it receives \s-1NULL\s0 as \fIctx\fR value, it should not do anything other than
return.
This function should free any resources associated with that context.
.SS "Random Number Generator Functions: \s-1NIST\s0"
.IX Subsection "Random Number Generator Functions: NIST"
These functions correspond to those defined in \s-1NIST SP 800\-90A\s0 and \s-1SP 800\-90C.\s0
.PP
\&\fBOSSL_FUNC_rand_instantiate()\fR is used to instantiate the \s-1DRBG\s0 \fIctx\fR at a requested
security \fIstrength\fR.  In addition, \fIprediction_resistance\fR can be requested.
Additional input \fIaddin\fR of length \fIaddin_len\fR bytes can optionally
be provided.  The parameters specified in \fIparams\fR configure the \s-1DRBG\s0 and these
should be processed before instantiation.
.PP
\&\fBOSSL_FUNC_rand_uninstantiate()\fR is used to uninstantiate the \s-1DRBG\s0 \fIctx\fR.  After being
uninstantiated, a \s-1DRBG\s0 is unable to produce output until it is instantiated
anew.
.PP
\&\fBOSSL_FUNC_rand_generate()\fR is used to generate random bytes from the \s-1DRBG\s0 \fIctx\fR.
It will generate \fIoutlen\fR bytes placing them into the buffer pointed to by
\&\fIout\fR.  The generated bytes will meet the specified security \fIstrength\fR and,
if \fIprediction_resistance\fR is true, the bytes will be produced after reseeding
from a live entropy source.  Additional input \fIaddin\fR of length \fIaddin_len\fR
bytes can optionally be provided.
.SS "Random Number Generator Functions: Additional"
.IX Subsection "Random Number Generator Functions: Additional"
\&\fBOSSL_FUNC_rand_nonce()\fR is used to generate a nonce of the given \fIstrength\fR with a
length from \fImin_noncelen\fR to \fImax_noncelen\fR. If the output buffer \fIout\fR is
\&\s-1NULL,\s0 the length of the nonce should be returned.
.PP
\&\fBOSSL_FUNC_rand_get_seed()\fR is used by deterministic generators to obtain their
seeding material from their parent.  The seed bytes will meet the specified
security level of \fIentropy\fR bits and there will be between \fImin_len\fR
and \fImax_len\fR inclusive bytes in total.  If \fIprediction_resistance\fR is
true, the bytes will be produced from a live entropy source.  Additional
input \fIaddin\fR of length \fIaddin_len\fR bytes can optionally be provided.
A pointer to the seed material is returned in \fI*buffer\fR and this must be
freed by a later call to \fBOSSL_FUNC_rand_clear_seed()\fR.
.PP
\&\fBOSSL_FUNC_rand_clear_seed()\fR frees a seed \fIbuffer\fR of length \fIb_len\fR bytes
which was previously allocated by \fBOSSL_FUNC_rand_get_seed()\fR.
.PP
\&\fBOSSL_FUNC_rand_verify_zeroization()\fR is used to determine if the internal state of the
\&\s-1DRBG\s0 is zero.  This capability is mandated by \s-1NIST\s0 as part of the self
tests, it is unlikely to be useful in other circumstances.
.SS "Context Locking"
.IX Subsection "Context Locking"
When DRBGs are used by multiple threads, there must be locking employed to
ensure their proper operation.  Because locking introduces an overhead, it
is disabled by default.
.PP
\&\fBOSSL_FUNC_rand_enable_locking()\fR allows locking to be turned on for a \s-1DRBG\s0 and all of
its parent DRBGs.  From this call onwards, the \s-1DRBG\s0 can be used in a thread
safe manner.
.PP
\&\fBOSSL_FUNC_rand_lock()\fR is used to lock a \s-1DRBG.\s0  Once locked, exclusive access
is guaranteed.
.PP
\&\fBOSSL_FUNC_rand_unlock()\fR is used to unlock a \s-1DRBG.\s0
.SS "Rand Parameters"
.IX Subsection "Rand Parameters"
See \s-1\fBOSSL_PARAM\s0\fR\|(3) for further details on the parameters structure used by
these functions.
.PP
\&\fBOSSL_FUNC_rand_get_params()\fR gets details of parameter values associated with the
provider algorithm and stores them in \fIparams\fR.
.PP
\&\fBOSSL_FUNC_rand_set_ctx_params()\fR sets rand parameters associated with the given
provider side rand context \fIctx\fR to \fIparams\fR.
Any parameter settings are additional to any that were previously set.
Passing \s-1NULL\s0 for \fIparams\fR should return true.
.PP
\&\fBOSSL_FUNC_rand_get_ctx_params()\fR gets details of currently set parameter values
associated with the given provider side rand context \fIctx\fR and stores them
in \fIparams\fR.
Passing \s-1NULL\s0 for \fIparams\fR should return true.
.PP
\&\fBOSSL_FUNC_rand_gettable_params()\fR, \fBOSSL_FUNC_rand_gettable_ctx_params()\fR,
and \fBOSSL_FUNC_rand_settable_ctx_params()\fR all return constant \s-1\fBOSSL_PARAM\s0\fR\|(3)
arrays as descriptors of the parameters that \fBOSSL_FUNC_rand_get_params()\fR,
\&\fBOSSL_FUNC_rand_get_ctx_params()\fR, and \fBOSSL_FUNC_rand_set_ctx_params()\fR
can handle, respectively.  \fBOSSL_FUNC_rand_gettable_ctx_params()\fR
and \fBOSSL_FUNC_rand_settable_ctx_params()\fR will return the parameters
associated with the provider side context \fIctx\fR in its current state
if it is not \s-1NULL.\s0  Otherwise, they return the parameters associated
with the provider side algorithm \fIprovctx\fR.
.PP
Parameters currently recognised by built-in rands are as follows. Not all
parameters are relevant to, or are understood by all rands:
.ie n .IP """state"" (\fB\s-1OSSL_RAND_PARAM_STATE\s0\fR) <integer>" 4
.el .IP "``state'' (\fB\s-1OSSL_RAND_PARAM_STATE\s0\fR) <integer>" 4
.IX Item "state (OSSL_RAND_PARAM_STATE) <integer>"
Returns the state of the random number generator.
.ie n .IP """strength"" (\fB\s-1OSSL_RAND_PARAM_STRENGTH\s0\fR) <unsigned integer>" 4
.el .IP "``strength'' (\fB\s-1OSSL_RAND_PARAM_STRENGTH\s0\fR) <unsigned integer>" 4
.IX Item "strength (OSSL_RAND_PARAM_STRENGTH) <unsigned integer>"
Returns the bit strength of the random number generator.
.PP
For rands that are also deterministic random bit generators (DRBGs), these
additional parameters are recognised. Not all
parameters are relevant to, or are understood by all \s-1DRBG\s0 rands:
.ie n .IP """reseed_requests"" (\fB\s-1OSSL_DRBG_PARAM_RESEED_REQUESTS\s0\fR) <unsigned integer>" 4
.el .IP "``reseed_requests'' (\fB\s-1OSSL_DRBG_PARAM_RESEED_REQUESTS\s0\fR) <unsigned integer>" 4
.IX Item "reseed_requests (OSSL_DRBG_PARAM_RESEED_REQUESTS) <unsigned integer>"
Reads or set the number of generate requests before reseeding the
associated \s-1RAND\s0 ctx.
.ie n .IP """reseed_time_interval"" (\fB\s-1OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL\s0\fR) <integer>" 4
.el .IP "``reseed_time_interval'' (\fB\s-1OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL\s0\fR) <integer>" 4
.IX Item "reseed_time_interval (OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL) <integer>"
Reads or set the number of elapsed seconds before reseeding the
associated \s-1RAND\s0 ctx.
.ie n .IP """max_request"" (\fB\s-1OSSL_DRBG_PARAM_RESEED_REQUESTS\s0\fR) <unsigned integer>" 4
.el .IP "``max_request'' (\fB\s-1OSSL_DRBG_PARAM_RESEED_REQUESTS\s0\fR) <unsigned integer>" 4
.IX Item "max_request (OSSL_DRBG_PARAM_RESEED_REQUESTS) <unsigned integer>"
Specifies the maximum number of bytes that can be generated in a single
call to OSSL_FUNC_rand_generate.
.ie n .IP """min_entropylen"" (\fB\s-1OSSL_DRBG_PARAM_MIN_ENTROPYLEN\s0\fR) <unsigned integer>" 4
.el .IP "``min_entropylen'' (\fB\s-1OSSL_DRBG_PARAM_MIN_ENTROPYLEN\s0\fR) <unsigned integer>" 4
.IX Item "min_entropylen (OSSL_DRBG_PARAM_MIN_ENTROPYLEN) <unsigned integer>"
.PD 0
.ie n .IP """max_entropylen"" (\fB\s-1OSSL_DRBG_PARAM_MAX_ENTROPYLEN\s0\fR) <unsigned integer>" 4
.el .IP "``max_entropylen'' (\fB\s-1OSSL_DRBG_PARAM_MAX_ENTROPYLEN\s0\fR) <unsigned integer>" 4
.IX Item "max_entropylen (OSSL_DRBG_PARAM_MAX_ENTROPYLEN) <unsigned integer>"
.PD
Specify the minimum and maximum number of bytes of random material that
can be used to seed the \s-1DRBG.\s0
.ie n .IP """min_noncelen"" (\fB\s-1OSSL_DRBG_PARAM_MIN_NONCELEN\s0\fR) <unsigned integer>" 4
.el .IP "``min_noncelen'' (\fB\s-1OSSL_DRBG_PARAM_MIN_NONCELEN\s0\fR) <unsigned integer>" 4
.IX Item "min_noncelen (OSSL_DRBG_PARAM_MIN_NONCELEN) <unsigned integer>"
.PD 0
.ie n .IP """max_noncelen"" (\fB\s-1OSSL_DRBG_PARAM_MAX_NONCELEN\s0\fR) <unsigned integer>" 4
.el .IP "``max_noncelen'' (\fB\s-1OSSL_DRBG_PARAM_MAX_NONCELEN\s0\fR) <unsigned integer>" 4
.IX Item "max_noncelen (OSSL_DRBG_PARAM_MAX_NONCELEN) <unsigned integer>"
.PD
Specify the minimum and maximum number of bytes of nonce that can be used to
instantiate the \s-1DRBG.\s0
.ie n .IP """max_perslen"" (\fB\s-1OSSL_DRBG_PARAM_MAX_PERSLEN\s0\fR) <unsigned integer>" 4
.el .IP "``max_perslen'' (\fB\s-1OSSL_DRBG_PARAM_MAX_PERSLEN\s0\fR) <unsigned integer>" 4
.IX Item "max_perslen (OSSL_DRBG_PARAM_MAX_PERSLEN) <unsigned integer>"
.PD 0
.ie n .IP """max_adinlen"" (\fB\s-1OSSL_DRBG_PARAM_MAX_ADINLEN\s0\fR) <unsigned integer>" 4
.el .IP "``max_adinlen'' (\fB\s-1OSSL_DRBG_PARAM_MAX_ADINLEN\s0\fR) <unsigned integer>" 4
.IX Item "max_adinlen (OSSL_DRBG_PARAM_MAX_ADINLEN) <unsigned integer>"
.PD
Specify the minimum and maximum number of bytes of personalisation string
that can be used with the \s-1DRBG.\s0
.ie n .IP """reseed_counter"" (\fB\s-1OSSL_DRBG_PARAM_RESEED_COUNTER\s0\fR) <unsigned integer>" 4
.el .IP "``reseed_counter'' (\fB\s-1OSSL_DRBG_PARAM_RESEED_COUNTER\s0\fR) <unsigned integer>" 4
.IX Item "reseed_counter (OSSL_DRBG_PARAM_RESEED_COUNTER) <unsigned integer>"
Specifies the number of times the \s-1DRBG\s0 has been seeded or reseeded.
.ie n .IP """digest"" (\fB\s-1OSSL_DRBG_PARAM_DIGEST\s0\fR) <\s-1UTF8\s0 string>" 4
.el .IP "``digest'' (\fB\s-1OSSL_DRBG_PARAM_DIGEST\s0\fR) <\s-1UTF8\s0 string>" 4
.IX Item "digest (OSSL_DRBG_PARAM_DIGEST) <UTF8 string>"
.PD 0
.ie n .IP """cipher"" (\fB\s-1OSSL_DRBG_PARAM_CIPHER\s0\fR) <\s-1UTF8\s0 string>" 4
.el .IP "``cipher'' (\fB\s-1OSSL_DRBG_PARAM_CIPHER\s0\fR) <\s-1UTF8\s0 string>" 4
.IX Item "cipher (OSSL_DRBG_PARAM_CIPHER) <UTF8 string>"
.ie n .IP """mac"" (\fB\s-1OSSL_DRBG_PARAM_MAC\s0\fR) <\s-1UTF8\s0 string>" 4
.el .IP "``mac'' (\fB\s-1OSSL_DRBG_PARAM_MAC\s0\fR) <\s-1UTF8\s0 string>" 4
.IX Item "mac (OSSL_DRBG_PARAM_MAC) <UTF8 string>"
.PD
Sets the name of the underlying cipher, digest or \s-1MAC\s0 to be used.
It must name a suitable algorithm for the \s-1DRBG\s0 that's being used.
.ie n .IP """properties"" (\fB\s-1OSSL_DRBG_PARAM_PROPERTIES\s0\fR) <\s-1UTF8\s0 string>" 4
.el .IP "``properties'' (\fB\s-1OSSL_DRBG_PARAM_PROPERTIES\s0\fR) <\s-1UTF8\s0 string>" 4
.IX Item "properties (OSSL_DRBG_PARAM_PROPERTIES) <UTF8 string>"
Sets the properties to be queried when trying to fetch an underlying algorithm.
This must be given together with the algorithm naming parameter to be
considered valid.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
\&\fBOSSL_FUNC_rand_newctx()\fR should return the newly created
provider side rand context, or \s-1NULL\s0 on failure.
.PP
\&\fBOSSL_FUNC_rand_gettable_params()\fR, \fBOSSL_FUNC_rand_gettable_ctx_params()\fR and
\&\fBOSSL_FUNC_rand_settable_ctx_params()\fR should return a constant \s-1\fBOSSL_PARAM\s0\fR\|(3)
array, or \s-1NULL\s0 if none is offered.
.PP
\&\fBOSSL_FUNC_rand_nonce()\fR returns the size of the generated nonce, or 0 on error.
.PP
\&\fBOSSL_FUNC_rand_get_seed()\fR returns the size of the generated seed, or 0 on
error.
.PP
All of the remaining functions should return 1 for success or 0 on error.
.SH "NOTES"
.IX Header "NOTES"
The \s-1RAND\s0 life-cycle is described in \fBlife_cycle\-rand\fR\|(7).  Providers should
ensure that the various transitions listed there are supported.  At some point
the \s-1EVP\s0 layer will begin enforcing the listed transitions.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBprovider\fR\|(7),
\&\s-1\fBRAND\s0\fR\|(7),
\&\s-1\fBEVP_RAND\s0\fR\|(7),
\&\fBlife_cycle\-rand\fR\|(7),
\&\s-1\fBEVP_RAND\s0\fR\|(3)
.SH "HISTORY"
.IX Header "HISTORY"
The provider \s-1RAND\s0 interface was introduced in OpenSSL 3.0.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright 2020\-2021 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the Apache License 2.0 (the \*(L"License\*(R").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file \s-1LICENSE\s0 in the source distribution or at
<https://www.openssl.org/source/license.html>.