Home | History | Annotate | Line # | Download | only in man3
      1      1.1  christos =pod
      2      1.1  christos 
      3      1.1  christos =head1 NAME
      4      1.1  christos 
      5      1.1  christos EVP_RAND, EVP_RAND_fetch, EVP_RAND_free, EVP_RAND_up_ref, EVP_RAND_CTX,
      6      1.1  christos EVP_RAND_CTX_new, EVP_RAND_CTX_free, EVP_RAND_instantiate,
      7      1.1  christos EVP_RAND_uninstantiate, EVP_RAND_generate, EVP_RAND_reseed, EVP_RAND_nonce,
      8      1.1  christos EVP_RAND_enable_locking, EVP_RAND_verify_zeroization, EVP_RAND_get_strength,
      9      1.1  christos EVP_RAND_get_state,
     10      1.1  christos EVP_RAND_get0_provider, EVP_RAND_CTX_get0_rand, EVP_RAND_is_a,
     11      1.1  christos EVP_RAND_get0_name, EVP_RAND_names_do_all,
     12      1.1  christos EVP_RAND_get0_description,
     13      1.1  christos EVP_RAND_CTX_get_params,
     14      1.1  christos EVP_RAND_CTX_set_params, EVP_RAND_do_all_provided, EVP_RAND_get_params,
     15      1.1  christos EVP_RAND_gettable_ctx_params, EVP_RAND_settable_ctx_params,
     16      1.1  christos EVP_RAND_CTX_gettable_params, EVP_RAND_CTX_settable_params,
     17      1.1  christos EVP_RAND_gettable_params, EVP_RAND_STATE_UNINITIALISED, EVP_RAND_STATE_READY,
     18      1.1  christos EVP_RAND_STATE_ERROR - EVP RAND routines
     19      1.1  christos 
     20      1.1  christos =head1 SYNOPSIS
     21      1.1  christos 
     22      1.1  christos  #include <openssl/evp.h>
     23      1.1  christos 
     24      1.1  christos  typedef struct evp_rand_st EVP_RAND;
     25      1.1  christos  typedef struct evp_rand_ctx_st EVP_RAND_CTX;
     26      1.1  christos 
     27      1.1  christos  EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
     28      1.1  christos                         const char *properties);
     29      1.1  christos  int EVP_RAND_up_ref(EVP_RAND *rand);
     30      1.1  christos  void EVP_RAND_free(EVP_RAND *rand);
     31      1.1  christos  EVP_RAND_CTX *EVP_RAND_CTX_new(EVP_RAND *rand, EVP_RAND_CTX *parent);
     32      1.1  christos  void EVP_RAND_CTX_free(EVP_RAND_CTX *ctx);
     33      1.1  christos  EVP_RAND *EVP_RAND_CTX_get0_rand(EVP_RAND_CTX *ctx);
     34      1.1  christos  int EVP_RAND_get_params(EVP_RAND *rand, OSSL_PARAM params[]);
     35      1.1  christos  int EVP_RAND_CTX_get_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
     36      1.1  christos  int EVP_RAND_CTX_set_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
     37      1.1  christos  const OSSL_PARAM *EVP_RAND_gettable_params(const EVP_RAND *rand);
     38      1.1  christos  const OSSL_PARAM *EVP_RAND_gettable_ctx_params(const EVP_RAND *rand);
     39      1.1  christos  const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand);
     40      1.1  christos  const OSSL_PARAM *EVP_RAND_CTX_gettable_params(EVP_RAND_CTX *ctx);
     41      1.1  christos  const OSSL_PARAM *EVP_RAND_CTX_settable_params(EVP_RAND_CTX *ctx);
     42      1.1  christos  const char *EVP_RAND_get0_name(const EVP_RAND *rand);
     43      1.1  christos  const char *EVP_RAND_get0_description(const EVP_RAND *rand);
     44      1.1  christos  int EVP_RAND_is_a(const EVP_RAND *rand, const char *name);
     45      1.1  christos  const OSSL_PROVIDER *EVP_RAND_get0_provider(const EVP_RAND *rand);
     46      1.1  christos  void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx,
     47      1.1  christos                                void (*fn)(EVP_RAND *rand, void *arg),
     48      1.1  christos                                void *arg);
     49      1.1  christos  int EVP_RAND_names_do_all(const EVP_RAND *rand,
     50      1.1  christos                            void (*fn)(const char *name, void *data),
     51      1.1  christos                            void *data);
     52      1.1  christos 
     53      1.1  christos  int EVP_RAND_instantiate(EVP_RAND_CTX *ctx, unsigned int strength,
     54      1.1  christos                           int prediction_resistance,
     55      1.1  christos                           const unsigned char *pstr, size_t pstr_len,
     56      1.1  christos                           const OSSL_PARAM params[]);
     57      1.1  christos  int EVP_RAND_uninstantiate(EVP_RAND_CTX *ctx);
     58      1.1  christos  int EVP_RAND_generate(EVP_RAND_CTX *ctx, unsigned char *out, size_t outlen,
     59      1.1  christos                        unsigned int strength, int prediction_resistance,
     60      1.1  christos                        const unsigned char *addin, size_t addin_len);
     61      1.1  christos  int EVP_RAND_reseed(EVP_RAND_CTX *ctx, int prediction_resistance,
     62      1.1  christos                      const unsigned char *ent, size_t ent_len,
     63      1.1  christos                      const unsigned char *addin, size_t addin_len);
     64      1.1  christos  int EVP_RAND_nonce(EVP_RAND_CTX *ctx, unsigned char *out, size_t outlen);
     65      1.1  christos  int EVP_RAND_enable_locking(EVP_RAND_CTX *ctx);
     66      1.1  christos  int EVP_RAND_verify_zeroization(EVP_RAND_CTX *ctx);
     67      1.1  christos  unsigned int EVP_RAND_get_strength(EVP_RAND_CTX *ctx);
     68      1.1  christos  int EVP_RAND_get_state(EVP_RAND_CTX *ctx);
     69      1.1  christos 
     70      1.1  christos  #define EVP_RAND_STATE_UNINITIALISED    0
     71      1.1  christos  #define EVP_RAND_STATE_READY            1
     72      1.1  christos  #define EVP_RAND_STATE_ERROR            2
     73      1.1  christos 
     74      1.1  christos =head1 DESCRIPTION
     75      1.1  christos 
     76      1.1  christos The EVP RAND routines are a high-level interface to random number generators
     77      1.1  christos both deterministic and not.
     78      1.1  christos If you just want to generate random bytes then you don't need to use
     79      1.1  christos these functions: just call RAND_bytes() or RAND_priv_bytes().
     80      1.1  christos If you want to do more, these calls should be used instead of the older
     81      1.1  christos RAND and RAND_DRBG functions.
     82      1.1  christos 
     83      1.1  christos After creating a B<EVP_RAND_CTX> for the required algorithm using
     84      1.1  christos EVP_RAND_CTX_new(), inputs to the algorithm are supplied either by
     85      1.1  christos passing them as part of the EVP_RAND_instantiate() call or using calls to
     86      1.1  christos EVP_RAND_CTX_set_params() before calling EVP_RAND_instantiate().  Finally,
     87      1.1  christos call EVP_RAND_generate() to produce cryptographically secure random bytes.
     88      1.1  christos 
     89      1.1  christos =head2 Types
     90      1.1  christos 
     91      1.1  christos B<EVP_RAND> is a type that holds the implementation of a RAND.
     92      1.1  christos 
     93      1.1  christos B<EVP_RAND_CTX> is a context type that holds the algorithm inputs.
     94      1.1  christos B<EVP_RAND_CTX> structures are reference counted.
     95      1.1  christos 
     96      1.1  christos =head2 Algorithm implementation fetching
     97      1.1  christos 
     98      1.1  christos EVP_RAND_fetch() fetches an implementation of a RAND I<algorithm>, given
     99      1.1  christos a library context I<libctx> and a set of I<properties>.
    100      1.1  christos See L<crypto(7)/ALGORITHM FETCHING> for further information.
    101      1.1  christos 
    102      1.1  christos The returned value must eventually be freed with
    103      1.1  christos L<EVP_RAND_free(3)>.
    104      1.1  christos 
    105      1.1  christos EVP_RAND_up_ref() increments the reference count of an already fetched
    106      1.1  christos RAND.
    107      1.1  christos 
    108      1.1  christos EVP_RAND_free() frees a fetched algorithm.
    109      1.1  christos NULL is a valid parameter, for which this function is a no-op.
    110      1.1  christos 
    111      1.1  christos =head2 Context manipulation functions
    112      1.1  christos 
    113      1.1  christos EVP_RAND_CTX_new() creates a new context for the RAND implementation I<rand>.
    114      1.1  christos If not NULL, I<parent> specifies the seed source for this implementation.
    115      1.1  christos Not all random number generators need to have a seed source specified.
    116      1.1  christos If a parent is required, a NULL I<parent> will utilise the operating
    117      1.1  christos system entropy sources.
    118      1.1  christos It is recommended to minimise the number of random number generators that
    119      1.1  christos rely on the operating system for their randomness because this is often scarce.
    120      1.1  christos 
    121      1.1  christos EVP_RAND_CTX_free() frees up the context I<ctx>.  If I<ctx> is NULL, nothing
    122      1.1  christos is done.
    123      1.1  christos 
    124      1.1  christos EVP_RAND_CTX_get0_rand() returns the B<EVP_RAND> associated with the context
    125      1.1  christos I<ctx>.
    126      1.1  christos 
    127      1.1  christos =head2 Random Number Generator Functions
    128      1.1  christos 
    129      1.1  christos EVP_RAND_instantiate() processes any parameters in I<params> and
    130      1.1  christos then instantiates the RAND I<ctx> with a minimum security strength
    131      1.1  christos of <strength> and personalisation string I<pstr> of length <pstr_len>.
    132      1.1  christos If I<prediction_resistance> is specified, fresh entropy from a live source
    133      1.1  christos will be sought.  This call operates as per NIST SP 800-90A and SP 800-90C.
    134      1.1  christos 
    135      1.1  christos EVP_RAND_uninstantiate() uninstantiates the RAND I<ctx> as per
    136      1.1  christos NIST SP 800-90A and SP 800-90C.  Subsequent to this call, the RAND cannot
    137      1.1  christos be used to generate bytes.  It can only be freed or instantiated again.
    138      1.1  christos 
    139      1.1  christos EVP_RAND_generate() produces random bytes from the RAND I<ctx> with the
    140      1.1  christos additional input I<addin> of length I<addin_len>.  The bytes
    141      1.1  christos produced will meet the security I<strength>.
    142      1.1  christos If I<prediction_resistance> is specified, fresh entropy from a live source
    143      1.1  christos will be sought.  This call operates as per NIST SP 800-90A and SP 800-90C.
    144      1.1  christos 
    145      1.1  christos EVP_RAND_reseed() reseeds the RAND with new entropy.
    146      1.1  christos Entropy I<ent> of length I<ent_len> bytes can be supplied as can additional
    147      1.1  christos input I<addin> of length I<addin_len> bytes.  In the FIPS provider, both are
    148      1.1  christos treated as additional input as per NIST SP-800-90Ar1, Sections 9.1 and 9.2.
    149      1.1  christos Additional seed material is also drawn from the RAND's parent or the
    150      1.1  christos operating system.  If I<prediction_resistance> is specified, fresh entropy
    151      1.1  christos from a live source will be sought.  This call operates as per NIST SP 800-90A
    152      1.1  christos and SP 800-90C.
    153      1.1  christos 
    154      1.1  christos EVP_RAND_nonce() creates a nonce in I<out> of maximum length I<outlen>
    155      1.1  christos bytes from the RAND I<ctx>. The function returns the length of the generated
    156      1.1  christos nonce. If I<out> is NULL, the length is still returned but no generation
    157      1.1  christos takes place. This allows a caller to dynamically allocate a buffer of the
    158      1.1  christos appropriate size.
    159      1.1  christos 
    160      1.1  christos EVP_RAND_enable_locking() enables locking for the RAND I<ctx> and all of
    161      1.1  christos its parents.  After this I<ctx> will operate in a thread safe manner, albeit
    162      1.1  christos more slowly. This function is not itself thread safe if called with the same
    163      1.1  christos I<ctx> from multiple threads. Typically locking should be enabled before a
    164      1.1  christos I<ctx> is shared across multiple threads.
    165      1.1  christos 
    166      1.1  christos EVP_RAND_get_params() retrieves details about the implementation
    167      1.1  christos I<rand>.
    168      1.1  christos The set of parameters given with I<params> determine exactly what
    169      1.1  christos parameters should be retrieved.
    170      1.1  christos Note that a parameter that is unknown in the underlying context is
    171      1.1  christos simply ignored.
    172      1.1  christos 
    173      1.1  christos EVP_RAND_CTX_get_params() retrieves chosen parameters, given the
    174      1.1  christos context I<ctx> and its underlying context.
    175      1.1  christos The set of parameters given with I<params> determine exactly what
    176      1.1  christos parameters should be retrieved.
    177      1.1  christos Note that a parameter that is unknown in the underlying context is
    178      1.1  christos simply ignored.
    179      1.1  christos 
    180      1.1  christos EVP_RAND_CTX_set_params() passes chosen parameters to the underlying
    181      1.1  christos context, given a context I<ctx>.
    182      1.1  christos The set of parameters given with I<params> determine exactly what
    183      1.1  christos parameters are passed down.
    184      1.1  christos Note that a parameter that is unknown in the underlying context is
    185      1.1  christos simply ignored.
    186      1.1  christos Also, what happens when a needed parameter isn't passed down is
    187      1.1  christos defined by the implementation.
    188      1.1  christos 
    189      1.1  christos EVP_RAND_gettable_params() returns an L<OSSL_PARAM(3)> array that describes
    190      1.1  christos the retrievable and settable parameters.  EVP_RAND_gettable_params() returns
    191      1.1  christos parameters that can be used with EVP_RAND_get_params().
    192      1.1  christos 
    193      1.1  christos EVP_RAND_gettable_ctx_params() and EVP_RAND_CTX_gettable_params() return
    194      1.1  christos constant L<OSSL_PARAM(3)> arrays that describe the retrievable parameters that
    195      1.1  christos can be used with EVP_RAND_CTX_get_params().  EVP_RAND_gettable_ctx_params()
    196      1.1  christos returns the parameters that can be retrieved from the algorithm, whereas
    197      1.1  christos EVP_RAND_CTX_gettable_params() returns the parameters that can be retrieved
    198      1.1  christos in the context's current state.
    199      1.1  christos 
    200      1.1  christos EVP_RAND_settable_ctx_params() and EVP_RAND_CTX_settable_params() return
    201      1.1  christos constant L<OSSL_PARAM(3)> arrays that describe the settable parameters that
    202      1.1  christos can be used with EVP_RAND_CTX_set_params().  EVP_RAND_settable_ctx_params()
    203      1.1  christos returns the parameters that can be retrieved from the algorithm, whereas
    204      1.1  christos EVP_RAND_CTX_settable_params() returns the parameters that can be retrieved
    205      1.1  christos in the context's current state.
    206      1.1  christos 
    207      1.1  christos =head2 Information functions
    208      1.1  christos 
    209      1.1  christos EVP_RAND_get_strength() returns the security strength of the RAND I<ctx>.
    210      1.1  christos 
    211      1.1  christos EVP_RAND_get_state() returns the current state of the RAND I<ctx>.
    212      1.1  christos States defined by the OpenSSL RNGs are:
    213      1.1  christos 
    214      1.1  christos =over 4
    215      1.1  christos 
    216      1.1  christos =item *
    217      1.1  christos 
    218      1.1  christos EVP_RAND_STATE_UNINITIALISED: this RNG is currently uninitialised.
    219      1.1  christos The instantiate call will change this to the ready state.
    220      1.1  christos 
    221      1.1  christos =item *
    222      1.1  christos 
    223      1.1  christos EVP_RAND_STATE_READY: this RNG is currently ready to generate output.
    224      1.1  christos 
    225      1.1  christos =item *
    226      1.1  christos 
    227      1.1  christos EVP_RAND_STATE_ERROR: this RNG is in an error state.
    228      1.1  christos 
    229      1.1  christos =back
    230      1.1  christos 
    231      1.1  christos EVP_RAND_is_a() returns 1 if I<rand> is an implementation of an
    232      1.1  christos algorithm that's identifiable with I<name>, otherwise 0.
    233      1.1  christos 
    234      1.1  christos EVP_RAND_get0_provider() returns the provider that holds the implementation
    235      1.1  christos of the given I<rand>.
    236      1.1  christos 
    237      1.1  christos EVP_RAND_do_all_provided() traverses all RAND implemented by all activated
    238      1.1  christos providers in the given library context I<libctx>, and for each of the
    239      1.1  christos implementations, calls the given function I<fn> with the implementation method
    240      1.1  christos and the given I<arg> as argument.
    241      1.1  christos 
    242      1.1  christos EVP_RAND_get0_name() returns the canonical name of I<rand>.
    243      1.1  christos 
    244      1.1  christos EVP_RAND_names_do_all() traverses all names for I<rand>, and calls
    245      1.1  christos I<fn> with each name and I<data>.
    246      1.1  christos 
    247      1.1  christos EVP_RAND_get0_description() returns a description of the rand, meant for
    248      1.1  christos display and human consumption.  The description is at the discretion of
    249      1.1  christos the rand implementation.
    250      1.1  christos 
    251      1.1  christos EVP_RAND_verify_zeroization() confirms if the internal DRBG state is
    252      1.1  christos currently zeroed.  This is used by the FIPS provider to support the mandatory
    253      1.1  christos self tests.
    254      1.1  christos 
    255      1.1  christos =head1 PARAMETERS
    256      1.1  christos 
    257      1.1  christos The standard parameter names are:
    258      1.1  christos 
    259      1.1  christos =over 4
    260      1.1  christos 
    261      1.1  christos =item "state" (B<OSSL_RAND_PARAM_STATE>) <integer>
    262      1.1  christos 
    263      1.1  christos Returns the state of the random number generator.
    264      1.1  christos 
    265      1.1  christos =item "strength" (B<OSSL_RAND_PARAM_STRENGTH>) <unsigned integer>
    266      1.1  christos 
    267      1.1  christos Returns the bit strength of the random number generator.
    268      1.1  christos 
    269      1.1  christos =back
    270      1.1  christos 
    271      1.1  christos For rands that are also deterministic random bit generators (DRBGs), these
    272      1.1  christos additional parameters are recognised. Not all
    273      1.1  christos parameters are relevant to, or are understood by all DRBG rands:
    274      1.1  christos 
    275      1.1  christos =over 4
    276      1.1  christos 
    277      1.1  christos =item "reseed_requests" (B<OSSL_DRBG_PARAM_RESEED_REQUESTS>) <unsigned integer>
    278      1.1  christos 
    279      1.1  christos Reads or set the number of generate requests before reseeding the
    280      1.1  christos associated RAND ctx.
    281      1.1  christos 
    282      1.1  christos =item "reseed_time_interval" (B<OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL>) <integer>
    283      1.1  christos 
    284      1.1  christos Reads or set the number of elapsed seconds before reseeding the
    285      1.1  christos associated RAND ctx.
    286      1.1  christos 
    287  1.1.1.3  christos =item "max_request" (B<OSSL_RAND_PARAM_MAX_REQUEST>) <unsigned integer>
    288      1.1  christos 
    289      1.1  christos Specifies the maximum number of bytes that can be generated in a single
    290      1.1  christos call to OSSL_FUNC_rand_generate.
    291      1.1  christos 
    292      1.1  christos =item "min_entropylen" (B<OSSL_DRBG_PARAM_MIN_ENTROPYLEN>) <unsigned integer>
    293      1.1  christos 
    294      1.1  christos =item "max_entropylen" (B<OSSL_DRBG_PARAM_MAX_ENTROPYLEN>) <unsigned integer>
    295      1.1  christos 
    296      1.1  christos Specify the minimum and maximum number of bytes of random material that
    297      1.1  christos can be used to seed the DRBG.
    298      1.1  christos 
    299      1.1  christos =item "min_noncelen" (B<OSSL_DRBG_PARAM_MIN_NONCELEN>) <unsigned integer>
    300      1.1  christos 
    301      1.1  christos =item "max_noncelen" (B<OSSL_DRBG_PARAM_MAX_NONCELEN>) <unsigned integer>
    302      1.1  christos 
    303      1.1  christos Specify the minimum and maximum number of bytes of nonce that can be used to
    304      1.1  christos seed the DRBG.
    305      1.1  christos 
    306      1.1  christos =item "max_perslen" (B<OSSL_DRBG_PARAM_MAX_PERSLEN>) <unsigned integer>
    307      1.1  christos 
    308      1.1  christos =item "max_adinlen" (B<OSSL_DRBG_PARAM_MAX_ADINLEN>) <unsigned integer>
    309      1.1  christos 
    310      1.1  christos Specify the minimum and maximum number of bytes of personalisation string
    311      1.1  christos that can be used with the DRBG.
    312      1.1  christos 
    313      1.1  christos =item "reseed_counter" (B<OSSL_DRBG_PARAM_RESEED_COUNTER>) <unsigned integer>
    314      1.1  christos 
    315      1.1  christos Specifies the number of times the DRBG has been seeded or reseeded.
    316      1.1  christos 
    317      1.1  christos =item "properties" (B<OSSL_RAND_PARAM_PROPERTIES>) <UTF8 string>
    318      1.1  christos 
    319      1.1  christos =item "mac" (B<OSSL_RAND_PARAM_MAC>) <UTF8 string>
    320      1.1  christos 
    321      1.1  christos =item "digest" (B<OSSL_RAND_PARAM_DIGEST>) <UTF8 string>
    322      1.1  christos 
    323      1.1  christos =item "cipher" (B<OSSL_RAND_PARAM_CIPHER>) <UTF8 string>
    324      1.1  christos 
    325      1.1  christos For RAND implementations that use an underlying computation MAC, digest or
    326      1.1  christos cipher, these parameters set what the algorithm should be.
    327      1.1  christos 
    328      1.1  christos The value is always the name of the intended algorithm,
    329      1.1  christos or the properties in the case of B<OSSL_RAND_PARAM_PROPERTIES>.
    330      1.1  christos 
    331      1.1  christos =back
    332      1.1  christos 
    333      1.1  christos =head1 NOTES
    334      1.1  christos 
    335  1.1.1.2  christos The use of a nonzero value for the I<prediction_resistance> argument to
    336  1.1.1.2  christos EVP_RAND_instantiate(), EVP_RAND_generate() or EVP_RAND_reseed() should
    337  1.1.1.2  christos be used sparingly.  In the default setup, this will cause all public and
    338  1.1.1.2  christos private DRBGs to be reseeded on next use.  Since, by default, public and
    339  1.1.1.2  christos private DRBGs are allocated on a per thread basis, this can result in
    340  1.1.1.2  christos significant overhead for highly multi-threaded applications.  For normal
    341  1.1.1.2  christos use-cases, the default "reseed_requests" and "reseed_time_interval"
    342  1.1.1.2  christos thresholds ensure sufficient prediction resistance over time and you
    343  1.1.1.2  christos can reduce those values if you think they are too high.  Explicitly
    344  1.1.1.2  christos requesting prediction resistance is intended for more special use-cases
    345  1.1.1.2  christos like generating long-term secrets.
    346  1.1.1.2  christos 
    347      1.1  christos An B<EVP_RAND_CTX> needs to have locking enabled if it acts as the parent of
    348      1.1  christos more than one child and the children can be accessed concurrently.  This must
    349      1.1  christos be done by explicitly calling EVP_RAND_enable_locking().
    350      1.1  christos 
    351      1.1  christos The RAND life-cycle is described in L<life_cycle-rand(7)>.  In the future,
    352      1.1  christos the transitions described there will be enforced.  When this is done, it will
    353      1.1  christos not be considered a breaking change to the API.
    354      1.1  christos 
    355      1.1  christos =head1 RETURN VALUES
    356      1.1  christos 
    357      1.1  christos EVP_RAND_fetch() returns a pointer to a newly fetched B<EVP_RAND>, or
    358      1.1  christos NULL if allocation failed.
    359      1.1  christos 
    360      1.1  christos EVP_RAND_get0_provider() returns a pointer to the provider for the RAND, or
    361      1.1  christos NULL on error.
    362      1.1  christos 
    363      1.1  christos EVP_RAND_CTX_get0_rand() returns a pointer to the B<EVP_RAND> associated
    364      1.1  christos with the context.
    365      1.1  christos 
    366      1.1  christos EVP_RAND_get0_name() returns the name of the random number generation
    367      1.1  christos algorithm.
    368      1.1  christos 
    369      1.1  christos EVP_RAND_up_ref() returns 1 on success, 0 on error.
    370      1.1  christos 
    371      1.1  christos EVP_RAND_names_do_all() returns 1 if the callback was called for all names. A
    372      1.1  christos return value of 0 means that the callback was not called for any names.
    373      1.1  christos 
    374      1.1  christos EVP_RAND_CTX_new() returns either the newly allocated
    375      1.1  christos B<EVP_RAND_CTX> structure or NULL if an error occurred.
    376      1.1  christos 
    377      1.1  christos EVP_RAND_CTX_free() does not return a value.
    378      1.1  christos 
    379      1.1  christos EVP_RAND_nonce() returns the length of the nonce.
    380      1.1  christos 
    381      1.1  christos EVP_RAND_get_strength() returns the strength of the random number generator
    382      1.1  christos in bits.
    383      1.1  christos 
    384      1.1  christos EVP_RAND_gettable_params(), EVP_RAND_gettable_ctx_params() and
    385      1.1  christos EVP_RAND_settable_ctx_params() return an array of OSSL_PARAMs.
    386      1.1  christos 
    387      1.1  christos EVP_RAND_verify_zeroization() returns 1 if the internal DRBG state is
    388      1.1  christos currently zeroed, and 0 if not.
    389      1.1  christos 
    390      1.1  christos The remaining functions return 1 for success and 0 or a negative value for
    391      1.1  christos failure.
    392      1.1  christos 
    393      1.1  christos =head1 SEE ALSO
    394      1.1  christos 
    395      1.1  christos L<RAND_bytes(3)>,
    396      1.1  christos L<EVP_RAND-CTR-DRBG(7)>,
    397      1.1  christos L<EVP_RAND-HASH-DRBG(7)>,
    398      1.1  christos L<EVP_RAND-HMAC-DRBG(7)>,
    399      1.1  christos L<EVP_RAND-TEST-RAND(7)>,
    400      1.1  christos L<provider-rand(7)>,
    401      1.1  christos L<life_cycle-rand(7)>
    402      1.1  christos 
    403      1.1  christos =head1 HISTORY
    404      1.1  christos 
    405      1.1  christos This functionality was added to OpenSSL 3.0.
    406      1.1  christos 
    407      1.1  christos =head1 COPYRIGHT
    408      1.1  christos 
    409  1.1.1.3  christos Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
    410      1.1  christos 
    411      1.1  christos Licensed under the Apache License 2.0 (the "License").  You may not use
    412      1.1  christos this file except in compliance with the License.  You can obtain a copy
    413      1.1  christos in the file LICENSE in the source distribution or at
    414      1.1  christos L<https://www.openssl.org/source/license.html>.
    415      1.1  christos 
    416      1.1  christos =cut
    417