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