providers/implementations/macs/kmac_prov.inc
providers/implementations/macs/poly1305_prov.inc
providers/implementations/macs/siphash_prov.inc
-providers/implementations/rands/drbg_ctr.c
-providers/implementations/rands/drbg_hash.c
-providers/implementations/rands/drbg_hmac.c
-providers/implementations/rands/fips_crng_test.c
-providers/implementations/rands/seed_src.c
-providers/implementations/rands/seed_src_jitter.c
-providers/implementations/rands/test_rng.c
+providers/implementations/rands/drbg_ctr.inc
+providers/implementations/rands/drbg_hash.inc
+providers/implementations/rands/drbg_hmac.inc
+providers/implementations/rands/fips_crng_test.inc
+providers/implementations/rands/seed_src.inc
+providers/implementations/rands/seed_src_jitter.inc
+providers/implementations/rands/test_rng.inc
# error code files
/crypto/err/openssl.txt.old
providers/implementations/macs/kmac_prov.inc \
providers/implementations/macs/poly1305_prov.inc \
providers/implementations/macs/siphash_prov.inc \
- providers/implementations/rands/drbg_ctr.c \
- providers/implementations/rands/drbg_hash.c \
- providers/implementations/rands/drbg_hmac.c \
- providers/implementations/rands/fips_crng_test.c \
- providers/implementations/rands/seed_src.c \
- providers/implementations/rands/seed_src_jitter.c \
- providers/implementations/rands/test_rng.c
+ providers/implementations/rands/drbg_ctr.inc \
+ providers/implementations/rands/drbg_hash.inc \
+ providers/implementations/rands/drbg_hmac.inc \
+ providers/implementations/rands/fips_crng_test.inc \
+ providers/implementations/rands/seed_src.inc \
+ providers/implementations/rands/seed_src_jitter.inc \
+ providers/implementations/rands/test_rng.inc
GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in
GENERATE[include/openssl/asn1t.h]=include/openssl/asn1t.h.in
providers/implementations/macs/kmac_prov.inc \
providers/implementations/macs/poly1305_prov.inc \
providers/implementations/macs/siphash_prov.inc \
- providers/implementations/rands/drbg_ctr.c \
- providers/implementations/rands/drbg_hash.c \
- providers/implementations/rands/drbg_hmac.c \
- providers/implementations/rands/fips_crng_test.c \
- providers/implementations/rands/seed_src.c \
- providers/implementations/rands/seed_src_jitter.c \
- providers/implementations/rands/test_rng.c \
+ providers/implementations/rands/drbg_ctr.inc \
+ providers/implementations/rands/drbg_hash.inc \
+ providers/implementations/rands/drbg_hmac.inc \
+ providers/implementations/rands/fips_crng_test.inc \
+ providers/implementations/rands/seed_src.inc \
+ providers/implementations/rands/seed_src_jitter.inc \
+ providers/implementations/rands/test_rng.inc \
include/openssl/core_names.h]=util/perl|OpenSSL/paramnames.pm
GENERATE[providers/implementations/asymciphers/rsa_enc.inc]=\
providers/implementations/asymciphers/rsa_enc.inc.in
providers/implementations/macs/poly1305_prov.inc.in
GENERATE[providers/implementations/macs/siphash_prov.inc]=\
providers/implementations/macs/siphash_prov.inc.in
-GENERATE[providers/implementations/rands/drbg_ctr.c]=\
- providers/implementations/rands/drbg_ctr.c.in
-GENERATE[providers/implementations/rands/drbg_hash.c]=\
- providers/implementations/rands/drbg_hash.c.in
-GENERATE[providers/implementations/rands/drbg_hmac.c]=\
- providers/implementations/rands/drbg_hmac.c.in
-GENERATE[providers/implementations/rands/fips_crng_test.c]=\
- providers/implementations/rands/fips_crng_test.c.in
-GENERATE[providers/implementations/rands/seed_src.c]=\
- providers/implementations/rands/seed_src.c.in
-GENERATE[providers/implementations/rands/seed_src_jitter.c]=\
- providers/implementations/rands/seed_src_jitter.c.in
-GENERATE[providers/implementations/rands/test_rng.c]=\
- providers/implementations/rands/test_rng.c.in
+GENERATE[providers/implementations/rands/drbg_ctr.inc]=\
+ providers/implementations/rands/drbg_ctr.inc.in
+GENERATE[providers/implementations/rands/drbg_hash.inc]=\
+ providers/implementations/rands/drbg_hash.inc.in
+GENERATE[providers/implementations/rands/drbg_hmac.inc]=\
+ providers/implementations/rands/drbg_hmac.inc.in
+GENERATE[providers/implementations/rands/fips_crng_test.inc]=\
+ providers/implementations/rands/fips_crng_test.inc.in
+GENERATE[providers/implementations/rands/seed_src.inc]=\
+ providers/implementations/rands/seed_src.inc.in
+GENERATE[providers/implementations/rands/seed_src_jitter.inc]=\
+ providers/implementations/rands/seed_src_jitter.inc.in
+GENERATE[providers/implementations/rands/test_rng.inc]=\
+ providers/implementations/rands/test_rng.inc.in
GENERATE[include/openssl/core_names.h]=include/openssl/core_names.h.in
IF[{- defined $target{shared_defflag} -}]
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
#include <stdlib.h>
#include <string.h>
#include "internal/provider.h"
#include "internal/common.h"
+#define drbg_ctr_get_ctx_params_st drbg_get_ctx_params_st
+#define drbg_ctr_set_ctx_params_st drbg_set_ctx_params_st
+
+#include "providers/implementations/rands/drbg_ctr.inc"
+
static OSSL_FUNC_rand_newctx_fn drbg_ctr_new_wrapper;
static OSSL_FUNC_rand_freectx_fn drbg_ctr_free;
static OSSL_FUNC_rand_instantiate_fn drbg_ctr_instantiate_wrapper;
static int drbg_ctr_set_ctx_params_locked(PROV_DRBG *drbg,
const struct drbg_set_ctx_params_st *p);
-static int drbg_ctr_set_ctx_params_decoder(const OSSL_PARAM params[],
- struct drbg_set_ctx_params_st *p);
/*
* The state of a DRBG AES-CTR.
return 1;
}
-
/*
* Handle several BCC operations for as much data as we need for K and X
*/
ossl_rand_drbg_free(drbg);
}
-#define drbg_ctr_get_ctx_params_st drbg_get_ctx_params_st
-
-{- produce_param_decoder('drbg_ctr_get_ctx_params',
- (['OSSL_DRBG_PARAM_CIPHER', 'cipher', 'utf8_string'],
- ['OSSL_DRBG_PARAM_USE_DF', 'df', 'int'],
- ['OSSL_RAND_PARAM_STATE', 'state', 'int'],
- ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
- ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
- ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN', 'minentlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN', 'maxentlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MIN_NONCELEN', 'minnonlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_NONCELEN', 'maxnonlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_PERSLEN', 'maxperlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_ADINLEN', 'maxadlen', 'size_t'],
- ['OSSL_DRBG_PARAM_RESEED_COUNTER', 'reseed_cnt', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME', 'reseed_time', 'time_t'],
- ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_int', 'uint64'],
- ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static int drbg_ctr_get_ctx_params(void *vdrbg, OSSL_PARAM params[])
{
PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
return ossl_drbg_set_ctx_params(ctx, p);
}
-#define drbg_ctr_set_ctx_params_st drbg_set_ctx_params_st
-
-{- produce_param_decoder('drbg_ctr_set_ctx_params',
- (['OSSL_DRBG_PARAM_PROPERTIES', 'propq', 'utf8_string'],
- ['OSSL_DRBG_PARAM_CIPHER', 'cipher', 'utf8_string'],
- ['OSSL_DRBG_PARAM_USE_DF', 'df', 'int'],
- ['OSSL_PROV_PARAM_CORE_PROV_NAME', 'prov', 'utf8_string'],
- ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
- )); -}
-
static int drbg_ctr_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_DRBG *drbg = (PROV_DRBG *)vctx;
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('drbg_ctr_get_ctx_params',
+ (['OSSL_DRBG_PARAM_CIPHER', 'cipher', 'utf8_string'],
+ ['OSSL_DRBG_PARAM_USE_DF', 'df', 'int'],
+ ['OSSL_RAND_PARAM_STATE', 'state', 'int'],
+ ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
+ ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
+ ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN', 'minentlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN', 'maxentlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MIN_NONCELEN', 'minnonlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_NONCELEN', 'maxnonlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_PERSLEN', 'maxperlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_ADINLEN', 'maxadlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_RESEED_COUNTER', 'reseed_cnt', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME', 'reseed_time', 'time_t'],
+ ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_int', 'uint64'],
+ ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('drbg_ctr_set_ctx_params',
+ (['OSSL_DRBG_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+ ['OSSL_DRBG_PARAM_CIPHER', 'cipher', 'utf8_string'],
+ ['OSSL_DRBG_PARAM_USE_DF', 'df', 'int'],
+ ['OSSL_PROV_PARAM_CORE_PROV_NAME', 'prov', 'utf8_string'],
+ ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
#include <assert.h>
#include <stdlib.h>
#include "crypto/evp/evp_local.h"
#include "internal/provider.h"
+#define drbg_hash_get_ctx_params_st drbg_get_ctx_params_st
+#define drbg_hash_set_ctx_params_st drbg_set_ctx_params_st
+
+#include "providers/implementations/rands/drbg_hash.inc"
+
static OSSL_FUNC_rand_newctx_fn drbg_hash_new_wrapper;
static OSSL_FUNC_rand_freectx_fn drbg_hash_free;
static OSSL_FUNC_rand_instantiate_fn drbg_hash_instantiate_wrapper;
static OSSL_FUNC_rand_get_ctx_params_fn drbg_hash_get_ctx_params;
static OSSL_FUNC_rand_verify_zeroization_fn drbg_hash_verify_zeroization;
-static int drbg_hash_set_ctx_params_locked
- (PROV_DRBG *drbg, const struct drbg_set_ctx_params_st *p);
-static int drbg_hash_set_ctx_params_decoder(const OSSL_PARAM params[],
- struct drbg_set_ctx_params_st *p);
+static int drbg_hash_set_ctx_params_locked(PROV_DRBG *drbg,
+ const struct drbg_set_ctx_params_st *p);
/* 888 bits from SP800-90Ar1 10.1 table 2 */
#define HASH_PRNG_MAX_SEEDLEN (888/8)
ossl_rand_drbg_free(drbg);
}
-#define drbg_hash_get_ctx_params_st drbg_get_ctx_params_st
-
-{- produce_param_decoder('drbg_hash_get_ctx_params',
- (['OSSL_DRBG_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_RAND_PARAM_STATE', 'state', 'int'],
- ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
- ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
- ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN', 'minentlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN', 'maxentlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MIN_NONCELEN', 'minnonlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_NONCELEN', 'maxnonlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_PERSLEN', 'maxperlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_ADINLEN', 'maxadlen', 'size_t'],
- ['OSSL_DRBG_PARAM_RESEED_COUNTER', 'reseed_cnt', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME', 'reseed_time', 'time_t'],
- ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_int', 'uint64'],
- ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static int drbg_hash_get_ctx_params(void *vdrbg, OSSL_PARAM params[])
{
PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
return ossl_drbg_set_ctx_params(ctx, p);
}
-#define drbg_hash_set_ctx_params_st drbg_set_ctx_params_st
-
-{- produce_param_decoder('drbg_hash_set_ctx_params',
- (['OSSL_DRBG_PARAM_PROPERTIES', 'propq', 'utf8_string'],
- ['OSSL_ALG_PARAM_ENGINE', 'engine', 'utf8_string', 'hidden'],
- ['OSSL_DRBG_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_PROV_PARAM_CORE_PROV_NAME', 'prov', 'utf8_string'],
- ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
- ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- )); -}
-
static int drbg_hash_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_DRBG *drbg = (PROV_DRBG *)vctx;
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('drbg_hash_get_ctx_params',
+ (['OSSL_DRBG_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_RAND_PARAM_STATE', 'state', 'int'],
+ ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
+ ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
+ ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN', 'minentlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN', 'maxentlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MIN_NONCELEN', 'minnonlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_NONCELEN', 'maxnonlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_PERSLEN', 'maxperlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_ADINLEN', 'maxadlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_RESEED_COUNTER', 'reseed_cnt', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME', 'reseed_time', 'time_t'],
+ ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_int', 'uint64'],
+ ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('drbg_hash_set_ctx_params',
+ (['OSSL_DRBG_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+ ['OSSL_ALG_PARAM_ENGINE', 'engine', 'utf8_string', 'hidden'],
+ ['OSSL_DRBG_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_PROV_PARAM_CORE_PROV_NAME', 'prov', 'utf8_string'],
+ ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
+ ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
#include <stdlib.h>
#include <string.h>
#include "crypto/evp/evp_local.h"
#include "internal/provider.h"
+#define drbg_hmac_get_ctx_params_st drbg_get_ctx_params_st
+#define drbg_hmac_set_ctx_params_st drbg_set_ctx_params_st
+
+#include "providers/implementations/rands/drbg_hmac.inc"
+
static OSSL_FUNC_rand_newctx_fn drbg_hmac_new_wrapper;
static OSSL_FUNC_rand_freectx_fn drbg_hmac_free;
static OSSL_FUNC_rand_instantiate_fn drbg_hmac_instantiate_wrapper;
static OSSL_FUNC_rand_get_ctx_params_fn drbg_hmac_get_ctx_params;
static OSSL_FUNC_rand_verify_zeroization_fn drbg_hmac_verify_zeroization;
-static int drbg_hmac_set_ctx_params_locked
- (PROV_DRBG *drbg, const struct drbg_set_ctx_params_st *p);
-static int drbg_hmac_set_ctx_params_decoder(const OSSL_PARAM params[],
- struct drbg_set_ctx_params_st *p);
+static int drbg_hmac_set_ctx_params_locked(PROV_DRBG *drbg,
+ const struct drbg_set_ctx_params_st *p);
/*
* Called twice by SP800-90Ar1 10.1.2.2 HMAC_DRBG_Update_Process.
return ret;
}
-
/*
* SP800-90Ar1 10.1.2.4 HMAC_DRBG_Reseed_Process:
*
ossl_rand_drbg_free(drbg);
}
-#define drbg_hmac_get_ctx_params_st drbg_get_ctx_params_st
-
-{- produce_param_decoder('drbg_hmac_get_ctx_params',
- (['OSSL_DRBG_PARAM_MAC', 'mac', 'utf8_string'],
- ['OSSL_DRBG_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_RAND_PARAM_STATE', 'state', 'int'],
- ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
- ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
- ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN', 'minentlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN', 'maxentlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MIN_NONCELEN', 'minnonlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_NONCELEN', 'maxnonlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_PERSLEN', 'maxperlen', 'size_t'],
- ['OSSL_DRBG_PARAM_MAX_ADINLEN', 'maxadlen', 'size_t'],
- ['OSSL_DRBG_PARAM_RESEED_COUNTER', 'reseed_cnt', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME', 'reseed_time', 'time_t'],
- ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_int', 'uint64'],
- ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static int drbg_hmac_get_ctx_params(void *vdrbg, OSSL_PARAM params[])
{
PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
return ossl_drbg_set_ctx_params(ctx, p);
}
-#define drbg_hmac_set_ctx_params_st drbg_set_ctx_params_st
-
-{- produce_param_decoder('drbg_hmac_set_ctx_params',
- (['OSSL_DRBG_PARAM_PROPERTIES', 'propq', 'utf8_string'],
- ['OSSL_ALG_PARAM_ENGINE', 'engine', 'utf8_string', 'hidden'],
- ['OSSL_DRBG_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_DRBG_PARAM_MAC', 'mac', 'utf8_string'],
- ['OSSL_PROV_PARAM_CORE_PROV_NAME', 'prov', 'utf8_string'],
- ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
- ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
- ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- )); -}
-
static int drbg_hmac_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_DRBG *drbg = (PROV_DRBG *)vctx;
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('drbg_hmac_get_ctx_params',
+ (['OSSL_DRBG_PARAM_MAC', 'mac', 'utf8_string'],
+ ['OSSL_DRBG_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_RAND_PARAM_STATE', 'state', 'int'],
+ ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
+ ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
+ ['OSSL_DRBG_PARAM_MIN_ENTROPYLEN', 'minentlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_ENTROPYLEN', 'maxentlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MIN_NONCELEN', 'minnonlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_NONCELEN', 'maxnonlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_PERSLEN', 'maxperlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_MAX_ADINLEN', 'maxadlen', 'size_t'],
+ ['OSSL_DRBG_PARAM_RESEED_COUNTER', 'reseed_cnt', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME', 'reseed_time', 'time_t'],
+ ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_int', 'uint64'],
+ ['OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('drbg_hmac_set_ctx_params',
+ (['OSSL_DRBG_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+ ['OSSL_ALG_PARAM_ENGINE', 'engine', 'utf8_string', 'hidden'],
+ ['OSSL_DRBG_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_DRBG_PARAM_MAC', 'mac', 'utf8_string'],
+ ['OSSL_PROV_PARAM_CORE_PROV_NAME', 'prov', 'utf8_string'],
+ ['OSSL_DRBG_PARAM_RESEED_REQUESTS', 'reseed_req', 'uint'],
+ ['OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL', 'reseed_time', 'uint64'],
+ ['OSSL_KDF_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ )); -}
/*
* Implementation of SP 800-90B section 4.4 Approved Continuous Health Tests.
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
#include <string.h>
#include <openssl/evp.h>
#include "prov/drbg.h"
#include "prov/seeding.h"
#include "crypto/context.h"
+#include "providers/implementations/rands/fips_crng_test.inc"
static OSSL_FUNC_rand_newctx_fn crng_test_new;
static OSSL_FUNC_rand_freectx_fn crng_test_free;
CRYPTO_THREAD_unlock(crngt->lock);
}
-{- produce_param_decoder('crng_test_get_ctx_params',
- (['OSSL_RAND_PARAM_STATE', 'state', 'int'],
- ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
- ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
- ['OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static int crng_test_get_ctx_params(void *vcrngt, OSSL_PARAM params[])
{
CRNG_TEST *crngt = (CRNG_TEST *)vcrngt;
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('crng_test_get_ctx_params',
+ (['OSSL_RAND_PARAM_STATE', 'state', 'int'],
+ ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
+ ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
+ ['OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
#include <string.h>
#include <openssl/rand.h>
#include "prov/provider_ctx.h"
#include "crypto/rand.h"
#include "crypto/rand_pool.h"
+#include "providers/implementations/rands/seed_src.inc"
static OSSL_FUNC_rand_newctx_fn seed_src_new;
static OSSL_FUNC_rand_freectx_fn seed_src_free;
return 1;
}
-{- produce_param_decoder('seed_src_get_ctx_params',
- (['OSSL_RAND_PARAM_STATE', 'state', 'int'],
- ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
- ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
- )); -}
-
static int seed_src_get_ctx_params(void *vseed, OSSL_PARAM params[])
{
PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('seed_src_get_ctx_params',
+ (['OSSL_RAND_PARAM_STATE', 'state', 'int'],
+ ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
+ ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
#include <string.h>
#include <openssl/rand.h>
#ifndef OPENSSL_NO_JITTER
# include <jitterentropy.h>
+# include "providers/implementations/rands/seed_src_jitter.inc"
# define JITTER_MAX_NUM_TRIES 3
return 1;
}
-{- produce_param_decoder('jitter_get_ctx_params',
- (['OSSL_RAND_PARAM_STATE', 'state', 'int'],
- ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
- ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
- )); -}
-
static int jitter_get_ctx_params(void *vseed, OSSL_PARAM params[])
{
PROV_JITTER *s = (PROV_JITTER *)vseed;
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('jitter_get_ctx_params',
+ (['OSSL_RAND_PARAM_STATE', 'state', 'int'],
+ ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
+ ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
#include <string.h>
#include <stdlib.h>
#include "prov/provider_ctx.h"
#include "prov/provider_util.h"
#include "prov/implementations.h"
+#include "providers/implementations/rands/test_rng.inc"
static OSSL_FUNC_rand_newctx_fn test_rng_new;
static OSSL_FUNC_rand_freectx_fn test_rng_free;
return i;
}
-{- produce_param_decoder('test_rng_get_ctx_params',
- (['OSSL_RAND_PARAM_STATE', 'state', 'int'],
- ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
- ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
- ['OSSL_RAND_PARAM_GENERATE', 'gen', 'uint'],
- ['OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static int test_rng_get_ctx_params(void *vtest, OSSL_PARAM params[])
{
PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
return test_rng_get_ctx_params_list;
}
-{- produce_param_decoder('test_rng_set_ctx_params',
- (['OSSL_RAND_PARAM_TEST_ENTROPY', 'ent', 'octet_string'],
- ['OSSL_RAND_PARAM_TEST_NONCE', 'nonce', 'octet_string'],
- ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
- ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
- ['OSSL_RAND_PARAM_GENERATE', 'gen', 'uint'],
- )); -}
-
static int test_rng_set_ctx_params(void *vtest, const OSSL_PARAM params[])
{
PROV_TEST_RNG *t = (PROV_TEST_RNG *)vtest;
--- /dev/null
+/*
+ * Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the \"License\"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+{-
+use OpenSSL::paramnames qw(produce_param_decoder);
+-}
+
+{- produce_param_decoder('test_rng_get_ctx_params',
+ (['OSSL_RAND_PARAM_STATE', 'state', 'int'],
+ ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
+ ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
+ ['OSSL_RAND_PARAM_GENERATE', 'gen', 'uint'],
+ ['OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('test_rng_set_ctx_params',
+ (['OSSL_RAND_PARAM_TEST_ENTROPY', 'ent', 'octet_string'],
+ ['OSSL_RAND_PARAM_TEST_NONCE', 'nonce', 'octet_string'],
+ ['OSSL_RAND_PARAM_STRENGTH', 'str', 'uint'],
+ ['OSSL_RAND_PARAM_MAX_REQUEST', 'maxreq', 'size_t'],
+ ['OSSL_RAND_PARAM_GENERATE', 'gen', 'uint'],
+ )); -}