From: Pauli Date: Sun, 16 Feb 2025 22:53:10 +0000 (+1100) Subject: slh-dsa: change the seed parameter name from entropy to seed X-Git-Tag: openssl-3.5.0-alpha1~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73e01df48d53ea620e513d2f654892de514e9e1f;p=thirdparty%2Fopenssl.git slh-dsa: change the seed parameter name from entropy to seed This brings it inline with the same parameter for ML-KEM and ML-DSA. Reviewed-by: Tim Hudson Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/26750) --- diff --git a/doc/man7/EVP_PKEY-SLH-DSA.pod b/doc/man7/EVP_PKEY-SLH-DSA.pod index 1ebce2996c4..31709ec600f 100644 --- a/doc/man7/EVP_PKEY-SLH-DSA.pod +++ b/doc/man7/EVP_PKEY-SLH-DSA.pod @@ -35,7 +35,7 @@ elements randomly, the final public key element is computed from these values. =over 4 -=item "entropy" (B) +=item "seed" (B) Supplies values to use for the private seed, private prf and public seed instead of generating random values. This is used for testing diff --git a/providers/fips/self_test_data.inc b/providers/fips/self_test_data.inc index 73719299c2d..8ad7eff4926 100644 --- a/providers/fips/self_test_data.inc +++ b/providers/fips/self_test_data.inc @@ -2872,7 +2872,7 @@ static const uint8_t slh_dsa_sha2_128s_keygen_pub[] = { 0xca, 0xe3, 0xd1, 0x86, 0x52, 0x15, 0xe3, 0xd3, 0x85, 0x0e, 0x8c, 0x1b, 0x82, 0x92, 0xbf, 0x42, }; static const ST_KAT_PARAM slh_dsa_sha2_128s_keygen_init_params[] = { - ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_SLH_DSA_ENTROPY, + ST_KAT_PARAM_OCTET(OSSL_PKEY_PARAM_SLH_DSA_SEED, slh_dsa_sha2_128s_keygen_entropy), ST_KAT_PARAM_END() }; diff --git a/providers/implementations/keymgmt/slh_dsa_kmgmt.c b/providers/implementations/keymgmt/slh_dsa_kmgmt.c index e7ef60871b5..27fee6c2b86 100644 --- a/providers/implementations/keymgmt/slh_dsa_kmgmt.c +++ b/providers/implementations/keymgmt/slh_dsa_kmgmt.c @@ -363,7 +363,7 @@ static int slh_dsa_gen_set_params(void *genctx, const OSSL_PARAM params[]) if (gctx == NULL) return 0; - p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_SLH_DSA_ENTROPY); + p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_SLH_DSA_SEED); if (p != NULL) { void *vp = gctx->entropy; size_t len = sizeof(gctx->entropy); @@ -391,7 +391,7 @@ static const OSSL_PARAM *slh_dsa_gen_settable_params(ossl_unused void *genctx, { static OSSL_PARAM settable[] = { OSSL_PARAM_utf8_string(OSSL_PKEY_PARAM_PROPERTIES, NULL, 0), - OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_SLH_DSA_ENTROPY, NULL, 0), + OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_SLH_DSA_SEED, NULL, 0), OSSL_PARAM_END }; return settable; diff --git a/test/slh_dsa_test.c b/test/slh_dsa_test.c index 7f5a4e54d31..561a7171eff 100644 --- a/test/slh_dsa_test.c +++ b/test/slh_dsa_test.c @@ -296,15 +296,15 @@ err: } static EVP_PKEY *do_gen_key(const char *alg, - const uint8_t *entropy, size_t entropy_len) + const uint8_t *seed, size_t seed_len) { EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *ctx = NULL; OSSL_PARAM params[2], *p = params; - if (entropy_len != 0) - *p++ = OSSL_PARAM_construct_octet_string(OSSL_PKEY_PARAM_SLH_DSA_ENTROPY, - (char *)entropy, entropy_len); + if (seed_len != 0) + *p++ = OSSL_PARAM_construct_octet_string(OSSL_PKEY_PARAM_SLH_DSA_SEED, + (char *)seed, seed_len); *p = OSSL_PARAM_construct_end(); if (!TEST_ptr(ctx = EVP_PKEY_CTX_new_from_name(lib_ctx, alg, NULL)) diff --git a/util/perl/OpenSSL/paramnames.pm b/util/perl/OpenSSL/paramnames.pm index be5b8c027ac..91bff80e3fa 100644 --- a/util/perl/OpenSSL/paramnames.pm +++ b/util/perl/OpenSSL/paramnames.pm @@ -446,7 +446,7 @@ my %params = ( 'PKEY_PARAM_ML_DSA_OUTPUT_FORMATS' => "ml-dsa.output_formats", # SLH_DSA Key generation parameters - 'PKEY_PARAM_SLH_DSA_ENTROPY' => "entropy", + 'PKEY_PARAM_SLH_DSA_SEED' => "seed", # Key Exchange parameters 'EXCHANGE_PARAM_PAD' => "pad",# uint