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

NAME

6       EVP_RAND-HASH-DRBG - The HASH DRBG EVP_RAND implementation
7

DESCRIPTION

9       Support for the hash deterministic random bit generator through the
10       EVP_RAND API.
11
12   Identity
13       "HASH-DRBG" is the name for this implementation; it can be used with
14       the 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       "digest" (OSSL_DRBG_PARAM_DIGEST) <UTF8 string>
33           These parameters work as described in "PARAMETERS" in EVP_RAND(3).
34

NOTES

36       A context for HASH DRBG can be obtained by calling:
37
38        EVP_RAND *rand = EVP_RAND_fetch(NULL, "HASH-DRBG", NULL);
39        EVP_RAND_CTX *rctx = EVP_RAND_CTX_new(rand);
40

EXAMPLES

42        EVP_RAND *rand;
43        EVP_RAND_CTX *rctx;
44        unsigned char bytes[100];
45        OSSL_PARAM params[2], *p = params;
46        unsigned int strength = 128;
47
48        rand = EVP_RAND_fetch(NULL, "HASH-DRBG", NULL);
49        rctx = EVP_RAND_CTX_new(rand, NULL);
50        EVP_RAND_free(rand);
51
52        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST, SN_sha512, 0);
53        *p = OSSL_PARAM_construct_end();
54        EVP_RAND_instantiate(rctx, strength, 0, NULL, 0, params);
55
56        EVP_RAND_generate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);
57
58        EVP_RAND_CTX_free(rctx);
59

CONFORMING TO

61       NIST SP 800-90A and SP 800-90B
62

SEE ALSO

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