]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
doc: update documenation with params argument on DRBG instantiate calls
authorPauli <ppzgs1@gmail.com>
Fri, 26 Feb 2021 00:56:46 +0000 (10:56 +1000)
committerPauli <ppzgs1@gmail.com>
Sun, 28 Feb 2021 07:25:49 +0000 (17:25 +1000)
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14310)

doc/man7/EVP_RAND-CTR-DRBG.pod
doc/man7/EVP_RAND-HASH-DRBG.pod
doc/man7/EVP_RAND-HMAC-DRBG.pod
doc/man7/EVP_RAND-SEED-SRC.pod
doc/man7/EVP_RAND-TEST-RAND.pod
doc/man7/provider-rand.pod

index a31b22390a86b2c14069065f20690ec0659c109c..61dfa2672e534e6ea4b5fb57778c2337b187bac7 100644 (file)
@@ -81,7 +81,7 @@ A context for CTR DRBG can be obtained by calling:
  *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
                                          SN_aes_256_ctr, 0);
  *p = OSSL_PARAM_construct_end();
- EVP_RAND_set_ctx_params(rctx, params);
+ EVP_RAND_instantiate(rctx, strength, 0, NULL, 0, params);
 
  EVP_RAND_generate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);
 
index 631383c74a3e1afc518b168e2532845197f1a50e..a212add6d2a6b94f0cfae49641aee25dec0f99e1 100644 (file)
@@ -73,7 +73,7 @@ A context for HASH DRBG can be obtained by calling:
 
  *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST, SN_sha512, 0);
  *p = OSSL_PARAM_construct_end();
- EVP_RAND_set_ctx_params(rctx, params);
+ EVP_RAND_instantiate(rctx, strength, 0, NULL, 0, params);
 
  EVP_RAND_generate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);
 
index f04ae336fcc97e2eb6b605fbe5c07a8d9a50e991..f345255efca14cac9ac508abc363feec6113ee7a 100644 (file)
@@ -76,7 +76,7 @@ A context for HMAC DRBG can be obtained by calling:
  *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_MAC, SN_hmac, 0);
  *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST, SN_sha256, 0);
  *p = OSSL_PARAM_construct_end();
- EVP_RAND_set_ctx_params(rctx, params);
+ EVP_RAND_instantiate(rctx, strength, 0, NULL, 0, params);
 
  EVP_RAND_generate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);
 
index f301ed25f9fa1dd2059a87a3eb78dd25cdcdf107..4d21e4cd6eb09ad3a92f90719a37a3d21a762a88 100644 (file)
@@ -63,7 +63,7 @@ A context for the seed source can be obtained by calling:
  *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
                                          SN_aes_256_ctr, 0);
  *p = OSSL_PARAM_construct_end();
- EVP_RAND_set_ctx_params(rctx, params);
+ EVP_RAND_instantiate(rctx, strength, 0, NULL, 0, params);
 
  EVP_RAND_generate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);
 
index 9eb7001d645886a81451cfcd0022d8441e57e4de..c5f1a4d52627035b13b66a81b728be078efb4b6c 100644 (file)
@@ -90,7 +90,7 @@ A context for a test generator can be obtained by calling:
  *p++ = OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_NONCE,
                                           nonce, sizeof(nonce));
  *p = OSSL_PARAM_construct_end();
- EVP_RAND_set_ctx_params(rctx, params);
+ EVP_RAND_instantiate(rctx, strength, 0, NULL, 0, params);
 
  EVP_RAND_generate(rctx, bytes, sizeof(bytes), strength, 0, NULL, 0);
 
index 5de3a15f38feeea0ee1850e547ac7eeb5eb50df5..157f6227e9c644703cea485019cec059b3d62e41 100644 (file)
@@ -26,7 +26,8 @@ functions
  /* Random number generator functions: NIST */
  int OSSL_FUNC_rand_instantiate(void *ctx, unsigned int strength,
                                 int prediction_resistance,
-                                const unsigned char *pstr, size_t pstr_len);
+                                const unsigned char *pstr, size_t pstr_len,
+                                const OSSL_PARAM params[]);
  int OSSL_FUNC_rand_uninstantiate(void *ctx);
  int OSSL_FUNC_rand_generate(void *ctx, unsigned char *out, size_t outlen,
                              unsigned int strength, int prediction_resistance,
@@ -97,7 +98,8 @@ These functions correspond to those defined in NIST SP 800-90A and SP 800-90C.
 OSSL_FUNC_rand_instantiate() is used to instantiate the DRBG I<ctx> at a requested
 security I<strength>.  In addition, I<prediction_resistance> can be requested.
 Additional input I<addin> of length I<addin_len> bytes can optionally
-be provided.
+be provided.  The parameters specified in I<params> configure the DRBG and these
+should be processed before instantiation.
 
 OSSL_FUNC_rand_uninstantiate() is used to uninstantiate the DRBG I<ctx>.  After being
 uninstantiated, a DRBG is unable to produce output until it is instantiated