1=pod
2
3=head1 NAME
4
5RAND_set_DRBG_type,
6RAND_set_seed_source_type
7- specify the global random number generator types
8
9=head1 SYNOPSIS
10
11 #include <openssl/rand.h>
12
13 int RAND_set_DRBG_type(OSSL_LIB_CTX *ctx, const char *drbg, const char *propq,
14                        const char *cipher, const char *digest);
15 int RAND_set_seed_source_type(OSSL_LIB_CTX *ctx, const char *seed,
16                               const char *propq);
17
18=head1 DESCRIPTION
19
20RAND_set_DRBG_type() specifies the random bit generator that will be
21used within the library context I<ctx>.  A generator of name I<drbg>
22with properties I<propq> will be fetched.  It will be instantiated with
23either I<cipher> or I<digest> as its underlying cryptographic algorithm.
24This specifies the type that will be used for the primary, public and
25private random instances.
26
27RAND_set_seed_source_type() specifies the seed source that will be used
28within the library context I<ctx>.  The seed source of name I<seed>
29with properties I<propq> will be fetched and used to seed the primary
30random big generator.
31
32=head1 RETURN VALUES
33
34These function return 1 on success and 0 on failure.
35
36=head1 NOTES
37
38These functions must be called before the random bit generators are first
39created in the library context.  They will return an error if the call
40is made too late.
41
42The default DRBG is "CTR-DRBG" using the "AES-256-CTR" cipher.
43
44The default seed source is "SEED-SRC".
45
46=head1 SEE ALSO
47
48L<EVP_RAND(3)>,
49L<RAND_get0_primary(3)>
50
51=head1 HISTORY
52
53These functions were added in OpenSSL 3.0.
54
55=head1 COPYRIGHT
56
57Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
58
59Licensed under the Apache License 2.0 (the "License").  You may not use
60this file except in compliance with the License.  You can obtain a copy
61in the file LICENSE in the source distribution or at
62L<https://www.openssl.org/source/license.html>.
63
64=cut
65