1EVP_RAND-CTR-DRBG(7ossl)            OpenSSL           EVP_RAND-CTR-DRBG(7ossl)
2
3
4

NAME

6       EVP_RAND-CTR-DRBG - The CTR DRBG EVP_RAND implementation
7

DESCRIPTION

9       Support for the counter deterministic random bit generator through the
10       EVP_RAND API.
11
12   Identity
13       "CTR-DRBG" is the name for this implementation; it can be used with the
14       EVP_RAND_fetch() function.
15
16   Supported parameters
17       The supported parameters are:
18
19       "state" (OSSL_RAND_PARAM_STATE) <integer>
20       "strength" (OSSL_RAND_PARAM_STRENGTH) <unsigned integer>
21       "max_request" (OSSL_RAND_PARAM_MAX_REQUEST) <unsigned integer>
22       "reseed_requests" (OSSL_DRBG_PARAM_RESEED_REQUESTS) <unsigned integer>
23       "reseed_time_interval" (OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL) <integer>
24       "min_entropylen" (OSSL_DRBG_PARAM_MIN_ENTROPYLEN) <unsigned integer>
25       "max_entropylen" (OSSL_DRBG_PARAM_MAX_ENTROPYLEN) <unsigned integer>
26       "min_noncelen" (OSSL_DRBG_PARAM_MIN_NONCELEN) <unsigned integer>
27       "max_noncelen" (OSSL_DRBG_PARAM_MAX_NONCELEN) <unsigned integer>
28       "max_perslen" (OSSL_DRBG_PARAM_MAX_PERSLEN) <unsigned integer>
29       "max_adinlen" (OSSL_DRBG_PARAM_MAX_ADINLEN) <unsigned integer>
30       "reseed_counter" (OSSL_DRBG_PARAM_RESEED_COUNTER) <unsigned integer>
31       "properties" (OSSL_DRBG_PARAM_PROPERTIES) <UTF8 string>
32       "cipher" (OSSL_DRBG_PARAM_CIPHER) <UTF8 string>
33           These parameters work as described in "PARAMETERS" in EVP_RAND(3).
34
35       "use_derivation_function" (OSSL_DRBG_PARAM_USE_DF) <integer>
36           This Boolean indicates if a derivation function should be used or
37           not.  A nonzero value (the default) uses the derivation function.
38           A zero value does not.
39

NOTES

41       A context for CTR DRBG can be obtained by calling:
42
43        EVP_RAND *rand = EVP_RAND_fetch(NULL, "CTR-DRBG", NULL);
44        EVP_RAND_CTX *rctx = EVP_RAND_CTX_new(rand);
45

EXAMPLES

47        EVP_RAND *rand;
48        EVP_RAND_CTX *rctx;
49        unsigned char bytes[100];
50        OSSL_PARAM params[2], *p = params;
51        unsigned int strength = 128;
52
53        rand = EVP_RAND_fetch(NULL, "CTR-DRBG", NULL);
54        rctx = EVP_RAND_CTX_new(rand, NULL);
55        EVP_RAND_free(rand);
56
57        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
58                                                SN_aes_256_ctr, 0);
59        *p = OSSL_PARAM_construct_end();
60        EVP_RAND_instantiate(rctx, strength, 0, NULL, 0, params);
61
62        EVP_RAND_generate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);
63
64        EVP_RAND_CTX_free(rctx);
65

CONFORMING TO

67       NIST SP 800-90A and SP 800-90B
68

SEE ALSO

70       EVP_RAND(3), "PARAMETERS" in EVP_RAND(3)
71
73       Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
74
75       Licensed under the Apache License 2.0 (the "License").  You may not use
76       this file except in compliance with the License.  You can obtain a copy
77       in the file LICENSE in the source distribution or at
78       <https://www.openssl.org/source/license.html>.
79
80
81
823.0.5                             2022-07-05          EVP_RAND-CTR-DRBG(7ossl)
Impressum