Standard preamble:
========================================================================
..
.... 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 -- \(*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\} . 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.
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'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . 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 . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . 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 .\} ========================================================================
Title "PROVIDER-RAND 7ossl"
way too many mistakes in technical documents.
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-1EVP_RAND\s0\|(3).
\fBOSSL_FUNC_rand_freectx() is passed a pointer to the provider side rand context in the mctx parameter. If it receives \s-1NULL\s0 as ctx value, it should not do anything other than return. This function should free any resources associated with that context.
\fBOSSL_FUNC_rand_instantiate() is used to instantiate the \s-1DRBG\s0 ctx at a requested security strength. In addition, prediction_resistance can be requested. Additional input addin of length addin_len bytes can optionally be provided. The parameters specified in params configure the \s-1DRBG\s0 and these should be processed before instantiation.
\fBOSSL_FUNC_rand_uninstantiate() is used to uninstantiate the \s-1DRBG\s0 ctx. After being uninstantiated, a \s-1DRBG\s0 is unable to produce output until it is instantiated anew.
\fBOSSL_FUNC_rand_generate() is used to generate random bytes from the \s-1DRBG\s0 ctx. It will generate outlen bytes placing them into the buffer pointed to by \fIout. The generated bytes will meet the specified security strength and, if prediction_resistance is true, the bytes will be produced after reseeding from a live entropy source. Additional input addin of length addin_len bytes can optionally be provided.
\fBOSSL_FUNC_rand_get_seed() is used by deterministic generators to obtain their seeding material from their parent. The seed bytes will meet the specified security level of entropy bits and there will be between min_len and max_len inclusive bytes in total. If prediction_resistance is true, the bytes will be produced from a live entropy source. Additional input addin of length addin_len bytes can optionally be provided. A pointer to the seed material is returned in *buffer and this must be freed by a later call to OSSL_FUNC_rand_clear_seed().
\fBOSSL_FUNC_rand_clear_seed() frees a seed buffer of length b_len bytes which was previously allocated by OSSL_FUNC_rand_get_seed().
\fBOSSL_FUNC_rand_verify_zeroization() 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.
\fBOSSL_FUNC_rand_enable_locking() 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.
\fBOSSL_FUNC_rand_lock() is used to lock a \s-1DRBG.\s0 Once locked, exclusive access is guaranteed.
\fBOSSL_FUNC_rand_unlock() is used to unlock a \s-1DRBG.\s0
\fBOSSL_FUNC_rand_get_params() gets details of parameter values associated with the provider algorithm and stores them in params.
\fBOSSL_FUNC_rand_set_ctx_params() sets rand parameters associated with the given provider side rand context ctx to params. Any parameter settings are additional to any that were previously set. Passing \s-1NULL\s0 for params should return true.
\fBOSSL_FUNC_rand_get_ctx_params() gets details of currently set parameter values associated with the given provider side rand context ctx and stores them in params. Passing \s-1NULL\s0 for params should return true.
\fBOSSL_FUNC_rand_gettable_params(), OSSL_FUNC_rand_gettable_ctx_params(), and OSSL_FUNC_rand_settable_ctx_params() all return constant \s-1OSSL_PARAM\s0\|(3) arrays as descriptors of the parameters that OSSL_FUNC_rand_get_params(), \fBOSSL_FUNC_rand_get_ctx_params(), and OSSL_FUNC_rand_set_ctx_params() can handle, respectively. OSSL_FUNC_rand_gettable_ctx_params() and OSSL_FUNC_rand_settable_ctx_params() will return the parameters associated with the provider side context ctx in its current state if it is not \s-1NULL.\s0 Otherwise, they return the parameters associated with the provider side algorithm provctx.
Parameters currently recognised by built-in rands are as follows. Not all parameters are relevant to, or are understood by all rands: Item "state (OSSL_RAND_PARAM_STATE) <integer>" Returns the state of the random number generator. Item "strength (OSSL_RAND_PARAM_STRENGTH) <unsigned integer>" Returns the bit strength of the random number generator.
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: 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. 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. 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. Item "min_entropylen (OSSL_DRBG_PARAM_MIN_ENTROPYLEN) <unsigned integer>"
0 Item "max_entropylen (OSSL_DRBG_PARAM_MAX_ENTROPYLEN) <unsigned integer>"
Specify the minimum and maximum number of bytes of random material that can be used to seed the \s-1DRBG.\s0 Item "min_noncelen (OSSL_DRBG_PARAM_MIN_NONCELEN) <unsigned integer>"
0 Item "max_noncelen (OSSL_DRBG_PARAM_MAX_NONCELEN) <unsigned integer>"
Specify the minimum and maximum number of bytes of nonce that can be used to instantiate the \s-1DRBG.\s0 Item "max_perslen (OSSL_DRBG_PARAM_MAX_PERSLEN) <unsigned integer>"
0 Item "max_adinlen (OSSL_DRBG_PARAM_MAX_ADINLEN) <unsigned integer>"
Specify the minimum and maximum number of bytes of personalisation string that can be used with the \s-1DRBG.\s0 Item "reseed_counter (OSSL_DRBG_PARAM_RESEED_COUNTER) <unsigned integer>" Specifies the number of times the \s-1DRBG\s0 has been seeded or reseeded. Item "digest (OSSL_DRBG_PARAM_DIGEST) <UTF8 string>"
0 Item "cipher (OSSL_DRBG_PARAM_CIPHER) <UTF8 string>" Item "mac (OSSL_DRBG_PARAM_MAC) <UTF8 string>"
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. 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.
\fBOSSL_FUNC_rand_gettable_params(), OSSL_FUNC_rand_gettable_ctx_params() and \fBOSSL_FUNC_rand_settable_ctx_params() should return a constant \s-1OSSL_PARAM\s0\|(3) array, or \s-1NULL\s0 if none is offered.
\fBOSSL_FUNC_rand_nonce() returns the size of the generated nonce, or 0 on error.
\fBOSSL_FUNC_rand_get_seed() returns the size of the generated seed, or 0 on error.
All of the remaining functions should return 1 for success or 0 on error.
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>.