providers/implementations/keymgmt/ml_dsa_kmgmt.inc
providers/implementations/keymgmt/ml_kem_kmgmt.inc
providers/implementations/keymgmt/mlx_kmgmt.inc
-providers/implementations/signature/dsa_sig.c
-providers/implementations/signature/ecdsa_sig.c
+providers/implementations/signature/dsa_sig.inc
+providers/implementations/signature/ecdsa_sig.inc
providers/implementations/keymgmt/dh_kmgmt.inc
providers/implementations/keymgmt/dsa_kmgmt.inc
providers/implementations/keymgmt/ecx_kmgmt.inc
providers/implementations/keymgmt/mlx_kmgmt.inc
providers/implementations/keymgmt/slh_dsa_kmgmt.inc
providers/implementations/keymgmt/template_kmgmt.inc
-providers/implementations/signature/eddsa_sig.c
-providers/implementations/signature/ml_dsa_sig.c
-providers/implementations/signature/rsa_sig.c
-providers/implementations/signature/slh_dsa_sig.c
-providers/implementations/signature/sm2_sig.c
+providers/implementations/signature/eddsa_sig.inc
+providers/implementations/signature/ml_dsa_sig.inc
+providers/implementations/signature/rsa_sig.inc
+providers/implementations/signature/slh_dsa_sig.inc
+providers/implementations/signature/sm2_sig.inc
providers/implementations/skeymgmt/generic.inc
providers/implementations/storemgmt/file_store_any2obj.inc
providers/implementations/storemgmt/file_store.inc
providers/implementations/keymgmt/mlx_kmgmt.inc \
providers/implementations/keymgmt/slh_dsa_kmgmt.inc \
providers/implementations/keymgmt/template_kmgmt.inc \
- providers/implementations/signature/dsa_sig.c \
- providers/implementations/signature/ecdsa_sig.c \
- providers/implementations/signature/eddsa_sig.c \
- providers/implementations/signature/ml_dsa_sig.c \
- providers/implementations/signature/rsa_sig.c \
- providers/implementations/signature/slh_dsa_sig.c \
- providers/implementations/signature/sm2_sig.c \
+ providers/implementations/signature/dsa_sig.inc \
+ providers/implementations/signature/ecdsa_sig.inc \
+ providers/implementations/signature/eddsa_sig.inc \
+ providers/implementations/signature/ml_dsa_sig.inc \
+ providers/implementations/signature/rsa_sig.inc \
+ providers/implementations/signature/slh_dsa_sig.inc \
+ providers/implementations/signature/sm2_sig.inc \
providers/implementations/skeymgmt/generic.inc \
providers/implementations/storemgmt/file_store_any2obj.inc \
providers/implementations/storemgmt/file_store.inc \
providers/implementations/keymgmt/mlx_kmgmt.inc \
providers/implementations/keymgmt/slh_dsa_kmgmt.inc \
providers/implementations/keymgmt/template_kmgmt.inc \
- providers/implementations/signature/dsa_sig.c \
- providers/implementations/signature/ecdsa_sig.c \
- providers/implementations/signature/eddsa_sig.c \
- providers/implementations/signature/ml_dsa_sig.c \
- providers/implementations/signature/rsa_sig.c \
- providers/implementations/signature/slh_dsa_sig.c \
- providers/implementations/signature/sm2_sig.c \
+ providers/implementations/signature/dsa_sig.inc \
+ providers/implementations/signature/ecdsa_sig.inc \
+ providers/implementations/signature/eddsa_sig.inc \
+ providers/implementations/signature/ml_dsa_sig.inc \
+ providers/implementations/signature/rsa_sig.inc \
+ providers/implementations/signature/slh_dsa_sig.inc \
+ providers/implementations/signature/sm2_sig.inc \
providers/implementations/skeymgmt/generic.inc \
providers/implementations/storemgmt/file_store_any2obj.inc \
providers/implementations/storemgmt/file_store.inc \
providers/implementations/keymgmt/slh_dsa_kmgmt.inc.in
GENERATE[providers/implementations/keymgmt/template_kmgmt.inc]=\
providers/implementations/keymgmt/template_kmgmt.inc.in
-GENERATE[providers/implementations/signature/dsa_sig.c]=\
- providers/implementations/signature/dsa_sig.c.in
-GENERATE[providers/implementations/signature/ecdsa_sig.c]=\
- providers/implementations/signature/ecdsa_sig.c.in
-GENERATE[providers/implementations/signature/eddsa_sig.c]=\
- providers/implementations/signature/eddsa_sig.c.in
-GENERATE[providers/implementations/signature/ml_dsa_sig.c]=\
- providers/implementations/signature/ml_dsa_sig.c.in
-GENERATE[providers/implementations/signature/rsa_sig.c]=\
- providers/implementations/signature/rsa_sig.c.in
-GENERATE[providers/implementations/signature/slh_dsa_sig.c]=\
- providers/implementations/signature/slh_dsa_sig.c.in
-GENERATE[providers/implementations/signature/sm2_sig.c]=\
- providers/implementations/signature/sm2_sig.c.in
+GENERATE[providers/implementations/signature/dsa_sig.inc]=\
+ providers/implementations/signature/dsa_sig.inc.in
+GENERATE[providers/implementations/signature/ecdsa_sig.inc]=\
+ providers/implementations/signature/ecdsa_sig.inc.in
+GENERATE[providers/implementations/signature/eddsa_sig.inc]=\
+ providers/implementations/signature/eddsa_sig.inc.in
+GENERATE[providers/implementations/signature/ml_dsa_sig.inc]=\
+ providers/implementations/signature/ml_dsa_sig.inc.in
+GENERATE[providers/implementations/signature/rsa_sig.inc]=\
+ providers/implementations/signature/rsa_sig.inc.in
+GENERATE[providers/implementations/signature/slh_dsa_sig.inc]=\
+ providers/implementations/signature/slh_dsa_sig.inc.in
+GENERATE[providers/implementations/signature/sm2_sig.inc]=\
+ providers/implementations/signature/sm2_sig.inc.in
GENERATE[providers/implementations/skeymgmt/generic.inc]=\
providers/implementations/skeymgmt/generic.inc.in
GENERATE[providers/implementations/storemgmt/file_store_any2obj.inc]=\
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
/*
* DSA low level APIs are deprecated for public use, but still ok for
return NULL;
}
-{- produce_param_decoder('dsa_get_ctx_params',
- (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
- ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
+struct dsa_all_set_ctx_params_st {
+ OSSL_PARAM *digest; /* dsa_set_ctx_params */
+ OSSL_PARAM *propq; /* dsa_set_ctx_params */
+#ifdef FIPS_MODULE
+ OSSL_PARAM *ind_d;
+ OSSL_PARAM *ind_k;
+ OSSL_PARAM *ind_sign;
+#endif
+ OSSL_PARAM *nonce;
+ OSSL_PARAM *sig; /* dsa_sigalg_set_ctx_params */
+};
+
+#define dsa_set_ctx_params_st dsa_all_set_ctx_params_st
+#define dsa_sigalg_set_ctx_params_st dsa_all_set_ctx_params_st
+
+#include "providers/implementations/signature/dsa_sig.inc"
static int dsa_get_ctx_params(void *vpdsactx, OSSL_PARAM *params)
{
return dsa_get_ctx_params_list;
}
-struct dsa_all_set_ctx_params_st {
- OSSL_PARAM *digest; /* dsa_set_ctx_params */
- OSSL_PARAM *propq; /* dsa_set_ctx_params */
-#ifdef FIPS_MODULE
- OSSL_PARAM *ind_d;
- OSSL_PARAM *ind_k;
- OSSL_PARAM *ind_sign;
-#endif
- OSSL_PARAM *nonce;
- OSSL_PARAM *sig; /* dsa_sigalg_set_ctx_params */
-};
-
/**
* @brief Setup common params for dsa_set_ctx_params and dsa_sigalg_set_ctx_params
* The caller is responsible for checking |vpdsactx| is not NULL and |params|
return 1;
}
-#define dsa_set_ctx_params_st dsa_all_set_ctx_params_st
-
-{- produce_param_decoder('dsa_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
- ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK', 'ind_sign', 'int', 'fips'],
- )); -}
-
static int dsa_set_ctx_params(void *vpdsactx, const OSSL_PARAM params[])
{
PROV_DSA_CTX *pdsactx = (PROV_DSA_CTX *)vpdsactx;
return keytypes;
}
-#define dsa_sigalg_set_ctx_params_st dsa_all_set_ctx_params_st
-
-{- produce_param_decoder('dsa_sigalg_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
- ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK', 'ind_sign', 'int', 'fips'],
- )); -}
-
static const OSSL_PARAM *dsa_sigalg_settable_ctx_params(void *vpdsactx,
ossl_unused void *provctx)
{
--- /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('dsa_get_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('dsa_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK', 'ind_sign', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('dsa_sigalg_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK', 'ind_sign', '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);
--}
/*
* ECDSA low level APIs are deprecated for public use, but still ok for
#include "prov/der_ec.h"
#include "crypto/ec.h"
+struct ecdsa_all_set_ctx_params_st {
+ OSSL_PARAM *digest; /* ecdsa_set_ctx_params */
+ OSSL_PARAM *propq; /* ecdsa_set_ctx_params */
+ OSSL_PARAM *size; /* ecdsa_set_ctx_params */
+#ifdef FIPS_MODULE
+ OSSL_PARAM *ind_d;
+ OSSL_PARAM *ind_k;
+#endif
+#if !defined(OPENSSL_NO_ACVP_TESTS)
+ OSSL_PARAM *kat;
+#endif
+ OSSL_PARAM *nonce;
+ OSSL_PARAM *sig; /* ecdsa_sigalg_set_ctx_params */
+};
+
+#define ecdsa_set_ctx_params_st ecdsa_all_set_ctx_params_st
+#define ecdsa_sigalg_set_ctx_params_st ecdsa_all_set_ctx_params_st
+
+#include "providers/implementations/signature/ecdsa_sig.inc"
+
static OSSL_FUNC_signature_newctx_fn ecdsa_newctx;
static OSSL_FUNC_signature_sign_init_fn ecdsa_sign_init;
static OSSL_FUNC_signature_verify_init_fn ecdsa_verify_init;
return NULL;
}
-{- produce_param_decoder('ecdsa_get_ctx_params',
- (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size', 'size_t'],
- ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
- ['OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE', 'verify', 'uint', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static int ecdsa_get_ctx_params(void *vctx, OSSL_PARAM *params)
{
PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
return ecdsa_get_ctx_params_list;
}
-struct ecdsa_all_set_ctx_params_st {
- OSSL_PARAM *digest; /* ecdsa_set_ctx_params */
- OSSL_PARAM *propq; /* ecdsa_set_ctx_params */
- OSSL_PARAM *size; /* ecdsa_set_ctx_params */
-#ifdef FIPS_MODULE
- OSSL_PARAM *ind_d;
- OSSL_PARAM *ind_k;
-#endif
-#if !defined(OPENSSL_NO_ACVP_TESTS)
- OSSL_PARAM *kat;
-#endif
- OSSL_PARAM *nonce;
- OSSL_PARAM *sig; /* ecdsa_sigalg_set_ctx_params */
-};
-
/**
* @brief Set up common params for ecdsa_set_ctx_params and
* ecdsa_sigalg_set_ctx_params. The caller is responsible for checking |vctx| is
return 1;
}
-#define ecdsa_set_ctx_params_st ecdsa_all_set_ctx_params_st
-
-{- produce_param_decoder('ecdsa_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size', 'size_t'],
- ['OSSL_SIGNATURE_PARAM_KAT', 'kat', 'uint',
- "#if !defined(OPENSSL_NO_ACVP_TESTS)"],
- ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
- ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- )); -}
-
static int ecdsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_ECDSA_CTX *ctx = (PROV_ECDSA_CTX *)vctx;
return keytypes;
}
-#define ecdsa_sigalg_set_ctx_params_st ecdsa_all_set_ctx_params_st
-
-{- produce_param_decoder('ecdsa_sigalg_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_KAT', 'kat', 'uint',
- "#if !defined(OPENSSL_NO_ACVP_TESTS)"],
- ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
- ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- )); -}
-
static const OSSL_PARAM *ecdsa_sigalg_settable_ctx_params(void *vctx,
ossl_unused void *provctx)
{
--- /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('ecdsa_get_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size', 'size_t'],
+ ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE', 'verify', 'uint', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('ecdsa_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size', 'size_t'],
+ ['OSSL_SIGNATURE_PARAM_KAT', 'kat', 'uint',
+ "#if !defined(OPENSSL_NO_ACVP_TESTS)"],
+ ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('ecdsa_sigalg_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_KAT', 'kat', 'uint',
+ "#if !defined(OPENSSL_NO_ACVP_TESTS)"],
+ ['OSSL_SIGNATURE_PARAM_NONCE_TYPE', 'nonce', 'uint'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
+ ['OSSL_SIGNATURE_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 <openssl/crypto.h>
#include <openssl/core_dispatch.h>
#include "prov/der_ecx.h"
#include "crypto/ecx.h"
+#define eddsa_set_variant_ctx_params_st eddsa_set_ctx_params_st
+
+#include "providers/implementations/signature/eddsa_sig.inc"
+
#ifdef S390X_EC_ASM
# include "s390x_arch.h"
return keytypes;
}
-{- produce_param_decoder('eddsa_get_ctx_params',
- (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'id', 'octet_string'],
- )); -}
-
static int eddsa_get_ctx_params(void *vpeddsactx, OSSL_PARAM *params)
{
PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
return eddsa_get_ctx_params_list;
}
-{- produce_param_decoder('eddsa_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_INSTANCE', 'inst', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx', 'octet_string'],
- )); -}
-
static int eddsa_set_ctx_params_internal
(PROV_EDDSA_CTX *peddsactx, const struct eddsa_set_ctx_params_st *p)
{
return eddsa_set_ctx_params_list;
}
-
static int eddsa_set_ctx_params(void *vpeddsactx, const OSSL_PARAM params[])
{
PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
return eddsa_set_ctx_params_internal(peddsactx, &p);
}
-#define eddsa_set_variant_ctx_params_st eddsa_set_ctx_params_st
-{- produce_param_decoder('eddsa_set_variant_ctx_params',
- (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx', 'octet_string'],
- )); -}
-
static const OSSL_PARAM *
eddsa_settable_variant_ctx_params(ossl_unused void *vpeddsactx,
ossl_unused void *provctx)
--- /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('eddsa_get_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'id', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('eddsa_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_INSTANCE', 'inst', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('eddsa_set_variant_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx', 'octet_string'],
+ )); -}
* 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 "internal/deprecated.h"
#include "internal/packet.h"
#include "internal/sizes.h"
+#define ml_dsa_set_ctx_params_st ml_dsa_verifymsg_set_ctx_params_st
+#define ml_dsa_set_ctx_params_decoder ml_dsa_verifymsg_set_ctx_params_decoder
+
+#include "providers/implementations/signature/ml_dsa_sig.inc"
+
#define ML_DSA_MESSAGE_ENCODE_RAW 0
#define ML_DSA_MESSAGE_ENCODE_PURE 1
* Only need the param list for the signing case. The decoder and structure
* are shared between the sign and verify cases.
*/
-#define ml_dsa_set_ctx_params_st ml_dsa_verifymsg_set_ctx_params_st
-#define ml_dsa_set_ctx_params_decoder ml_dsa_verifymsg_set_ctx_params_decoder
-
-{- produce_param_decoder('ml_dsa_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY', 'ent', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_DETERMINISTIC', 'det', 'int'],
- ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc', 'int'],
- ['OSSL_SIGNATURE_PARAM_MU', 'mu', 'int'],
- )); -}
-
-{- produce_param_decoder('ml_dsa_verifymsg_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY', 'ent', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_DETERMINISTIC', 'det', 'int'],
- ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc', 'int'],
- ['OSSL_SIGNATURE_PARAM_MU', 'mu', 'int'],
- ['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
- )); -}
static int ml_dsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
return ml_dsa_set_ctx_params_list;
}
-{- produce_param_decoder('ml_dsa_get_ctx_params',
- (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'id', 'octet_string'],
- )); -}
-
static const OSSL_PARAM *ml_dsa_gettable_ctx_params(ossl_unused void *vctx,
ossl_unused void *provctx)
{
--- /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('ml_dsa_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY', 'ent', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_DETERMINISTIC', 'det', 'int'],
+ ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc', 'int'],
+ ['OSSL_SIGNATURE_PARAM_MU', 'mu', 'int'],
+ )); -}
+
+{- produce_param_decoder('ml_dsa_verifymsg_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'ctx', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY', 'ent', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_DETERMINISTIC', 'det', 'int'],
+ ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc', 'int'],
+ ['OSSL_SIGNATURE_PARAM_MU', 'mu', 'int'],
+ ['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('ml_dsa_get_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'id', 'octet_string'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
/*
* RSA low level APIs are deprecated for public use, but still ok for
#include "prov/der_rsa.h"
#include "prov/securitycheck.h"
+#define rsa_set_ctx_params_no_digest_st rsa_set_ctx_params_st
+
+#include "providers/implementations/signature/rsa_sig.inc"
+
#define RSA_DEFAULT_DIGEST_NAME OSSL_DIGEST_NAME_SHA1
static OSSL_FUNC_signature_newctx_fn rsa_newctx;
return NULL;
}
-{- produce_param_decoder('rsa_get_ctx_params',
- (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'int'],
- ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST', 'mgf1', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'int'],
- ['OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE', 'verify', 'uint', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
- )); -}
-
static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
{
PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
}
#endif
-{- produce_param_decoder('rsa_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'int'],
- ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST', 'mgf1', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES', 'mgf1pq', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'int'],
- ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK', 'ind_slen', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK', 'ind_xpad', 'int', 'fips'],
- )); -}
-
-#define rsa_set_ctx_params_no_digest_st rsa_set_ctx_params_st
-
-{- produce_param_decoder('rsa_set_ctx_params_no_digest',
- (['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'int'],
- ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST', 'mgf1', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES', 'mgf1pq', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'utf8_string'],
- ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'int'],
- ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK', 'ind_slen', 'int', 'fips'],
- ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK', 'ind_xpad', 'int', 'fips'],
- )); -}
-
static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
{
PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
return keytypes;
}
-{- produce_param_decoder('rsa_sigalg_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
- )); -}
-
static const OSSL_PARAM *rsa_sigalg_settable_ctx_params(void *vprsactx,
ossl_unused void *provctx)
{
--- /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('rsa_get_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'int'],
+ ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST', 'mgf1', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'int'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE', 'verify', 'uint', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR', 'ind', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('rsa_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PROPERTIES', 'propq', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'int'],
+ ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST', 'mgf1', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES', 'mgf1pq', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'int'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK', 'ind_slen', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK', 'ind_xpad', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('rsa_set_ctx_params_no_digest',
+ (['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PAD_MODE', 'pad', 'int'],
+ ['OSSL_SIGNATURE_PARAM_MGF1_DIGEST', 'mgf1', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES', 'mgf1pq', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'utf8_string'],
+ ['OSSL_SIGNATURE_PARAM_PSS_SALTLEN', 'slen', 'int'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK', 'ind_k', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK', 'ind_d', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK', 'ind_slen', 'int', 'fips'],
+ ['OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK', 'ind_xpad', 'int', 'fips'],
+ )); -}
+
+{- produce_param_decoder('rsa_sigalg_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_SIGNATURE', 'sig', 'octet_string'],
+ )); -}
* 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 <openssl/core_names.h>
#include <openssl/err.h>
#include "crypto/slh_dsa.h"
#include "internal/cryptlib.h"
#include "internal/sizes.h"
+#include "providers/implementations/signature/slh_dsa_sig.inc"
#define SLH_DSA_MAX_ADD_RANDOM_LEN 32
return slh_dsa_verify(vctx, sig, siglen, tbs, tbslen);
}
-{- produce_param_decoder('slh_dsa_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'context', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY', 'entropy', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_DETERMINISTIC', 'det', 'int'],
- ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc', 'int'],
- )); -}
-
static int slh_dsa_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_SLH_DSA_CTX *pctx = (PROV_SLH_DSA_CTX *)vctx;
return slh_dsa_set_ctx_params_list;
}
-{- produce_param_decoder('slh_dsa_get_ctx_params',
- (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
- )); -}
-
static const OSSL_PARAM *slh_dsa_gettable_ctx_params(ossl_unused void *vctx,
ossl_unused void *provctx)
{
--- /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('slh_dsa_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_CONTEXT_STRING', 'context', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_TEST_ENTROPY', 'entropy', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_DETERMINISTIC', 'det', 'int'],
+ ['OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING', 'msgenc', 'int'],
+ )); -}
+
+{- produce_param_decoder('slh_dsa_get_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
/*
* ECDSA low level APIs are deprecated for public use, but still ok for
#include "crypto/ec.h"
#include "crypto/sm2.h"
#include "prov/der_sm2.h"
+#include "providers/implementations/signature/sm2_sig.inc"
static OSSL_FUNC_signature_newctx_fn sm2sig_newctx;
static OSSL_FUNC_signature_sign_init_fn sm2sig_signature_init;
return sm2sig_sign(vpsm2ctx, sig, siglen, sigsize, digest, (size_t)dlen);
}
-
int sm2sig_digest_verify_final(void *vpsm2ctx, const unsigned char *sig,
size_t siglen)
{
return NULL;
}
-{- produce_param_decoder('sm2sig_get_ctx_params',
- (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
- ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size', 'size_t'],
- ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
- )); -}
-
static int sm2sig_get_ctx_params(void *vpsm2ctx, OSSL_PARAM *params)
{
PROV_SM2_CTX *psm2ctx = (PROV_SM2_CTX *)vpsm2ctx;
return sm2sig_get_ctx_params_list;
}
-{- produce_param_decoder('sm2sig_set_ctx_params',
- (['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size', 'size_t'],
- ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
- ['OSSL_PKEY_PARAM_DIST_ID', 'distid', 'octet_string'],
- )); -}
-
static int sm2sig_set_ctx_params(void *vpsm2ctx, const OSSL_PARAM params[])
{
PROV_SM2_CTX *psm2ctx = (PROV_SM2_CTX *)vpsm2ctx;
--- /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('sm2sig_get_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_ALGORITHM_ID', 'algid', 'octet_string'],
+ ['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size', 'size_t'],
+ ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
+ )); -}
+
+{- produce_param_decoder('sm2sig_set_ctx_params',
+ (['OSSL_SIGNATURE_PARAM_DIGEST_SIZE', 'size', 'size_t'],
+ ['OSSL_SIGNATURE_PARAM_DIGEST', 'digest', 'utf8_string'],
+ ['OSSL_PKEY_PARAM_DIST_ID', 'distid', 'octet_string'],
+ )); -}