params->data_size = sizeof(buf);
}
params->return_size = 0;
- if (EVP_RAND_get_ctx_params(drbg, params))
+ if (EVP_RAND_CTX_get_params(drbg, params))
print_param_value(params, 2);
}
}
return ctx->meth->get_ctx_params(ctx->data, params);
}
-int EVP_RAND_get_ctx_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[])
+int EVP_RAND_CTX_get_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[])
{
int res;
return 1;
}
-int EVP_RAND_set_ctx_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[])
+int EVP_RAND_CTX_set_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[])
{
int res;
int state;
params[0] = OSSL_PARAM_construct_int(OSSL_RAND_PARAM_STATE, &state);
- if (!EVP_RAND_get_ctx_params(ctx, params))
+ if (!EVP_RAND_CTX_get_params(ctx, params))
state = EVP_RAND_STATE_ERROR;
return state;
}
EVP_RAND_state,
EVP_RAND_provider, EVP_RAND_CTX_rand, EVP_RAND_is_a, EVP_RAND_number,
EVP_RAND_name, EVP_RAND_names_do_all, EVP_RAND_description,
-EVP_RAND_get_ctx_params,
-EVP_RAND_set_ctx_params, EVP_RAND_do_all_provided, EVP_RAND_get_params,
+EVP_RAND_CTX_get_params,
+EVP_RAND_CTX_set_params, EVP_RAND_do_all_provided, EVP_RAND_get_params,
EVP_RAND_gettable_ctx_params, EVP_RAND_settable_ctx_params,
EVP_RAND_CTX_gettable_params, EVP_RAND_CTX_settable_params,
EVP_RAND_gettable_params, EVP_RAND_STATE_UNINITIALISED, EVP_RAND_STATE_READY,
void EVP_RAND_CTX_free(EVP_RAND_CTX *ctx);
EVP_RAND *EVP_RAND_CTX_rand(EVP_RAND_CTX *ctx);
int EVP_RAND_get_params(EVP_RAND *rand, OSSL_PARAM params[]);
- int EVP_RAND_get_ctx_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
- int EVP_RAND_set_ctx_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
+ int EVP_RAND_CTX_get_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
+ int EVP_RAND_CTX_set_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM *EVP_RAND_gettable_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_gettable_ctx_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand);
After creating a B<EVP_RAND_CTX> for the required algorithm using
EVP_RAND_CTX_new(), inputs to the algorithm are supplied either by
passing them as part of the EVP_RAND_instantiate() call or using calls to
-EVP_RAND_set_ctx_params() before calling EVP_RAND_instantiate(). Finally,
+EVP_RAND_CTX_set_params() before calling EVP_RAND_instantiate(). Finally,
call EVP_RAND_generate() to produce cryptographically secure random bytes.
=head2 Types
Note that a parameter that is unknown in the underlying context is
simply ignored.
-EVP_RAND_get_ctx_params() retrieves chosen parameters, given the
+EVP_RAND_CTX_get_params() retrieves chosen parameters, given the
context I<ctx> and its underlying context.
The set of parameters given with I<params> determine exactly what
parameters should be retrieved.
Note that a parameter that is unknown in the underlying context is
simply ignored.
-EVP_RAND_set_ctx_params() passes chosen parameters to the underlying
+EVP_RAND_CTX_set_params() passes chosen parameters to the underlying
context, given a context I<ctx>.
The set of parameters given with I<params> determine exactly what
parameters are passed down.
EVP_RAND_generate instantiated
EVP_RAND_uninstantiate uninstantiated
EVP_RAND_CTX_free freed freed freed freed
- EVP_RAND_get_ctx_params newed instantiated uninstantiated freed
- EVP_RAND_set_ctx_params newed instantiated uninstantiated freed
+ EVP_RAND_CTX_get_params newed instantiated uninstantiated freed
+ EVP_RAND_CTX_set_params newed instantiated uninstantiated freed
EVP_RAND_CTX_gettable_params newed instantiated uninstantiated freed
EVP_RAND_CTX_settable_params newed instantiated uninstantiated freed
<td style="border:1px solid" align="center">freed</td>
<td style="border:1px solid" align="center">freed</td>
<td style="border:1px solid" align="center"></td></tr>
-<tr><th style="border:1px solid" align="left">EVP_RAND_get_ctx_params</th>
+<tr><th style="border:1px solid" align="left">EVP_RAND_CTX_get_params</th>
<td style="border:1px solid" align="center"></td>
<td style="border:1px solid" align="center">newed</td>
<td style="border:1px solid" align="center">instantiated</td>
<td style="border:1px solid" align="center">uninstantiated</td>
<td style="border:1px solid" align="center"></td></tr>
-<tr><th style="border:1px solid" align="left">EVP_RAND_set_ctx_params</th>
+<tr><th style="border:1px solid" align="left">EVP_RAND_CTX_set_params</th>
<td style="border:1px solid" align="center"></td>
<td style="border:1px solid" align="center">newed</td>
<td style="border:1px solid" align="center">instantiated</td>
EVP_RAND_CTX *EVP_RAND_CTX_new(EVP_RAND *rand, EVP_RAND_CTX *parent);
void EVP_RAND_CTX_free(EVP_RAND_CTX *ctx);
EVP_RAND *EVP_RAND_CTX_rand(EVP_RAND_CTX *ctx);
-int EVP_RAND_get_ctx_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
-int EVP_RAND_set_ctx_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
+int EVP_RAND_CTX_get_params(EVP_RAND_CTX *ctx, OSSL_PARAM params[]);
+int EVP_RAND_CTX_set_params(EVP_RAND_CTX *ctx, const OSSL_PARAM params[]);
const OSSL_PARAM *EVP_RAND_gettable_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_gettable_ctx_params(const EVP_RAND *rand);
const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand);
drbg_params[0] = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH,
&strength);
- if (!EVP_RAND_set_ctx_params(test, drbg_params))
+ if (!EVP_RAND_CTX_set_params(test, drbg_params))
goto err;
rand = EVP_RAND_fetch(libctx, t->algorithm, NULL);
/* This is only used by HMAC-DRBG but it is ignored by the others */
drbg_params[1] =
OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_MAC, "HMAC", 0);
- if (!EVP_RAND_set_ctx_params(drbg, drbg_params))
+ if (!EVP_RAND_CTX_set_params(drbg, drbg_params))
goto err;
drbg_params[0] =
OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY,
(void *)t->entropyinpr1,
t->entropyinpr1len);
- if (!EVP_RAND_set_ctx_params(test, drbg_params))
+ if (!EVP_RAND_CTX_set_params(test, drbg_params))
goto err;
if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength,
OSSL_PARAM_construct_octet_string(OSSL_RAND_PARAM_TEST_ENTROPY,
(void *)t->entropyinpr2,
t->entropyinpr2len);
- if (!EVP_RAND_set_ctx_params(test, drbg_params))
+ if (!EVP_RAND_CTX_set_params(test, drbg_params))
goto err;
/*
params[0] = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH, &strength);
params[1] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(parent, params)))
goto err;
/* Get the DRBG */
params[1] = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
(char *)tst->cipher, 0);
params[2] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(ctx, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(ctx, params)))
goto err;
/* Feed in the entropy and nonce */
(void *)tst->nonce,
tst->nonce_len);
params[2] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(parent, params)))
goto err;
/*
unsigned int n;
*params = OSSL_PARAM_construct_uint(name, &n);
- if (EVP_RAND_get_ctx_params(drbg, params))
+ if (EVP_RAND_CTX_get_params(drbg, params))
return n;
return 0;
}
time_t t;
*params = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME, &t);
- if (EVP_RAND_get_ctx_params(drbg, params))
+ if (EVP_RAND_CTX_get_params(drbg, params))
return t;
return 0;
}
params[0] = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
&t);
params[1] = OSSL_PARAM_construct_end();
- return EVP_RAND_set_ctx_params(drbg, params);
+ return EVP_RAND_CTX_set_params(drbg, params);
}
static void run_multi_thread_test(void)
if (!TEST_ptr(rand = EVP_RAND_fetch(NULL, "CTR-DRBG", NULL))
|| !TEST_ptr(drbg = EVP_RAND_CTX_new(rand, parent))
- || !TEST_true(EVP_RAND_set_ctx_params(drbg, params))) {
+ || !TEST_true(EVP_RAND_CTX_set_params(drbg, params))) {
EVP_RAND_CTX_free(drbg);
drbg = NULL;
}
seed, sizeof(seed));
*p++ = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_MAX_REQUEST, &step);
*p = OSSL_PARAM_construct_end();
- res = TEST_true(EVP_RAND_set_ctx_params(ctx, params))
+ res = TEST_true(EVP_RAND_CTX_set_params(ctx, params))
&& TEST_true(EVP_RAND_generate(ctx, out, sizeof(out), 0, 1, NULL, 0))
&& TEST_mem_eq(seed, sizeof(seed), out, sizeof(out));
EVP_RAND_CTX_free(ctx);
goto err;
*params = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH, &strength);
- if (!EVP_RAND_set_ctx_params(rdata->parent, params))
+ if (!EVP_RAND_CTX_set_params(rdata->parent, params))
goto err;
rand = EVP_RAND_fetch(libctx, name, NULL);
expected->digest, 0);
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_MAC, "HMAC", 0);
*p = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(expected->ctx, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(expected->ctx, params)))
goto err;
strength = EVP_RAND_strength(expected->ctx);
(OSSL_RAND_PARAM_TEST_ENTROPY, item->reseed_entropy,
item->reseed_entropy_len);
params[1] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(expected->parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(expected->parent, params)))
goto err;
if (!TEST_true(EVP_RAND_reseed
(OSSL_RAND_PARAM_TEST_ENTROPY, item->pr_entropyA,
item->pr_entropyA_len);
params[1] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(expected->parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(expected->parent, params)))
goto err;
}
if (!TEST_true(EVP_RAND_generate
(OSSL_RAND_PARAM_TEST_ENTROPY, item->pr_entropyB,
item->pr_entropyB_len);
params[1] = OSSL_PARAM_construct_end();
- if (!TEST_true(EVP_RAND_set_ctx_params(expected->parent, params)))
+ if (!TEST_true(EVP_RAND_CTX_set_params(expected->parent, params)))
return 0;
}
if (!TEST_true(EVP_RAND_generate
EVP_RAND_CTX_new ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_CTX_free ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_CTX_rand ? 3_0_0 EXIST::FUNCTION:
-EVP_RAND_get_ctx_params ? 3_0_0 EXIST::FUNCTION:
-EVP_RAND_set_ctx_params ? 3_0_0 EXIST::FUNCTION:
+EVP_RAND_CTX_get_params ? 3_0_0 EXIST::FUNCTION:
+EVP_RAND_CTX_set_params ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_gettable_params ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_gettable_ctx_params ? 3_0_0 EXIST::FUNCTION:
EVP_RAND_settable_ctx_params ? 3_0_0 EXIST::FUNCTION: