providers/implementations/storemgmt/file_store_any2obj.inc
providers/implementations/storemgmt/file_store.inc
providers/implementations/storemgmt/winstore_store.inc
-providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
-providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c
-providers/implementations/ciphers/cipher_aes_gcm_siv.c
-providers/implementations/ciphers/cipher_aes_ocb.c
-providers/implementations/ciphers/cipher_aes_siv.c
-providers/implementations/ciphers/cipher_aes_wrp.c
-providers/implementations/ciphers/cipher_aes_xts.c
-providers/implementations/ciphers/ciphercommon.c
-providers/implementations/ciphers/ciphercommon_ccm.c
-providers/implementations/ciphers/ciphercommon_gcm.c
-providers/implementations/ciphers/cipher_chacha20.c
-providers/implementations/ciphers/cipher_chacha20_poly1305.c
-providers/implementations/ciphers/cipher_null.c
-providers/implementations/ciphers/cipher_rc4_hmac_md5.c
+providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc
+providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc
+providers/implementations/ciphers/cipher_aes_gcm_siv.inc
+providers/implementations/ciphers/cipher_aes_ocb.inc
+providers/implementations/ciphers/cipher_aes_siv.inc
+providers/implementations/ciphers/cipher_aes_wrp.inc
+providers/implementations/ciphers/cipher_aes_xts.inc
+providers/implementations/ciphers/ciphercommon.inc
+providers/implementations/ciphers/ciphercommon_ccm.inc
+providers/implementations/ciphers/ciphercommon_gcm.inc
+providers/implementations/ciphers/cipher_chacha20.inc
+providers/implementations/ciphers/cipher_chacha20_poly1305.inc
+providers/implementations/ciphers/cipher_null.inc
+providers/implementations/ciphers/cipher_rc4_hmac_md5.inc
providers/implementations/ciphers/cipher_sm2_xts.c
-providers/implementations/ciphers/cipher_sm4_xts.c
+providers/implementations/ciphers/cipher_sm4_xts.inc
providers/implementations/digests/blake2_prov.c
providers/implementations/digests/digestcommon.c
providers/implementations/digests/mdc2_prov.c
providers/implementations/storemgmt/file_store_any2obj.inc \
providers/implementations/storemgmt/file_store.inc \
providers/implementations/storemgmt/winstore_store.inc \
- providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c \
- providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c \
- providers/implementations/ciphers/cipher_aes_gcm_siv.c \
- providers/implementations/ciphers/cipher_aes_ocb.c \
- providers/implementations/ciphers/cipher_aes_siv.c \
- providers/implementations/ciphers/cipher_aes_wrp.c \
- providers/implementations/ciphers/cipher_aes_xts.c \
- providers/implementations/ciphers/ciphercommon.c \
- providers/implementations/ciphers/ciphercommon_ccm.c \
- providers/implementations/ciphers/ciphercommon_gcm.c \
- providers/implementations/ciphers/cipher_chacha20.c \
- providers/implementations/ciphers/cipher_chacha20_poly1305.c \
- providers/implementations/ciphers/cipher_null.c \
- providers/implementations/ciphers/cipher_rc4_hmac_md5.c \
- providers/implementations/ciphers/cipher_sm4_xts.c \
+ providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc \
+ providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc \
+ providers/implementations/ciphers/cipher_aes_gcm_siv.inc \
+ providers/implementations/ciphers/cipher_aes_ocb.inc \
+ providers/implementations/ciphers/cipher_aes_siv.inc \
+ providers/implementations/ciphers/cipher_aes_wrp.inc \
+ providers/implementations/ciphers/cipher_aes_xts.inc \
+ providers/implementations/ciphers/ciphercommon.inc \
+ providers/implementations/ciphers/ciphercommon_ccm.inc \
+ providers/implementations/ciphers/ciphercommon_gcm.inc \
+ providers/implementations/ciphers/cipher_chacha20.inc \
+ providers/implementations/ciphers/cipher_chacha20_poly1305.inc \
+ providers/implementations/ciphers/cipher_null.inc \
+ providers/implementations/ciphers/cipher_rc4_hmac_md5.inc \
+ providers/implementations/ciphers/cipher_sm4_xts.inc \
providers/implementations/digests/blake2_prov.c \
providers/implementations/digests/digestcommon.c \
providers/implementations/digests/mdc2_prov.c \
providers/implementations/storemgmt/file_store_any2obj.inc \
providers/implementations/storemgmt/file_store.inc \
providers/implementations/storemgmt/winstore_store.inc \
- providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c \
- providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c \
- providers/implementations/ciphers/cipher_aes_gcm_siv.c \
- providers/implementations/ciphers/cipher_aes_ocb.c \
- providers/implementations/ciphers/cipher_aes_siv.c \
- providers/implementations/ciphers/cipher_aes_wrp.c \
- providers/implementations/ciphers/cipher_aes_xts.c \
- providers/implementations/ciphers/ciphercommon.c \
- providers/implementations/ciphers/ciphercommon_ccm.c \
- providers/implementations/ciphers/ciphercommon_gcm.c \
- providers/implementations/ciphers/cipher_chacha20.c \
- providers/implementations/ciphers/cipher_chacha20_poly1305.c \
- providers/implementations/ciphers/cipher_null.c \
- providers/implementations/ciphers/cipher_rc4_hmac_md5.c \
- providers/implementations/ciphers/cipher_sm4_xts.c \
+ providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc \
+ providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc \
+ providers/implementations/ciphers/cipher_aes_gcm_siv.inc \
+ providers/implementations/ciphers/cipher_aes_ocb.inc \
+ providers/implementations/ciphers/cipher_aes_siv.inc \
+ providers/implementations/ciphers/cipher_aes_wrp.inc \
+ providers/implementations/ciphers/cipher_aes_xts.inc \
+ providers/implementations/ciphers/ciphercommon.inc \
+ providers/implementations/ciphers/ciphercommon_ccm.inc \
+ providers/implementations/ciphers/ciphercommon_gcm.inc \
+ providers/implementations/ciphers/cipher_chacha20.inc \
+ providers/implementations/ciphers/cipher_chacha20_poly1305.inc \
+ providers/implementations/ciphers/cipher_null.inc \
+ providers/implementations/ciphers/cipher_rc4_hmac_md5.inc \
+ providers/implementations/ciphers/cipher_sm4_xts.inc \
providers/implementations/digests/blake2_prov.c \
providers/implementations/digests/digestcommon.c \
providers/implementations/digests/mdc2_prov.c \
providers/implementations/storemgmt/file_store.inc.in
GENERATE[providers/implementations/storemgmt/winstore_store.inc]=\
providers/implementations/storemgmt/winstore_store.inc.in
-GENERATE[providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c]=\
- providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c.in
-GENERATE[providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c]=\
- providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.c.in
-GENERATE[providers/implementations/ciphers/cipher_aes_gcm_siv.c]=\
- providers/implementations/ciphers/cipher_aes_gcm_siv.c.in
-GENERATE[providers/implementations/ciphers/cipher_aes_ocb.c]=\
- providers/implementations/ciphers/cipher_aes_ocb.c.in
-GENERATE[providers/implementations/ciphers/cipher_aes_siv.c]=\
- providers/implementations/ciphers/cipher_aes_siv.c.in
-GENERATE[providers/implementations/ciphers/cipher_aes_wrp.c]=\
- providers/implementations/ciphers/cipher_aes_wrp.c.in
-GENERATE[providers/implementations/ciphers/cipher_aes_xts.c]=\
- providers/implementations/ciphers/cipher_aes_xts.c.in
-GENERATE[providers/implementations/ciphers/ciphercommon.c]=\
- providers/implementations/ciphers/ciphercommon.c.in
-GENERATE[providers/implementations/ciphers/ciphercommon_ccm.c]=\
- providers/implementations/ciphers/ciphercommon_ccm.c.in
-GENERATE[providers/implementations/ciphers/ciphercommon_gcm.c]=\
- providers/implementations/ciphers/ciphercommon_gcm.c.in
-GENERATE[providers/implementations/ciphers/cipher_chacha20.c]=\
- providers/implementations/ciphers/cipher_chacha20.c.in
-GENERATE[providers/implementations/ciphers/cipher_chacha20_poly1305.c]=\
- providers/implementations/ciphers/cipher_chacha20_poly1305.c.in
-GENERATE[providers/implementations/ciphers/cipher_null.c]=\
- providers/implementations/ciphers/cipher_null.c.in
-GENERATE[providers/implementations/ciphers/cipher_rc4_hmac_md5.c]=\
- providers/implementations/ciphers/cipher_rc4_hmac_md5.c.in
-GENERATE[providers/implementations/ciphers/cipher_sm4_xts.c]=\
- providers/implementations/ciphers/cipher_sm4_xts.c.in
+GENERATE[providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc]=\
+ providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc]=\
+ providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_gcm_siv.inc]=\
+ providers/implementations/ciphers/cipher_aes_gcm_siv.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_ocb.inc]=\
+ providers/implementations/ciphers/cipher_aes_ocb.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_siv.inc]=\
+ providers/implementations/ciphers/cipher_aes_siv.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_wrp.inc]=\
+ providers/implementations/ciphers/cipher_aes_wrp.inc.in
+GENERATE[providers/implementations/ciphers/cipher_aes_xts.inc]=\
+ providers/implementations/ciphers/cipher_aes_xts.inc.in
+GENERATE[providers/implementations/ciphers/ciphercommon.inc]=\
+ providers/implementations/ciphers/ciphercommon.inc.in
+GENERATE[providers/implementations/ciphers/ciphercommon_ccm.inc]=\
+ providers/implementations/ciphers/ciphercommon_ccm.inc.in
+GENERATE[providers/implementations/ciphers/ciphercommon_gcm.inc]=\
+ providers/implementations/ciphers/ciphercommon_gcm.inc.in
+GENERATE[providers/implementations/ciphers/cipher_chacha20.inc]=\
+ providers/implementations/ciphers/cipher_chacha20.inc.in
+GENERATE[providers/implementations/ciphers/cipher_chacha20_poly1305.inc]=\
+ providers/implementations/ciphers/cipher_chacha20_poly1305.inc.in
+GENERATE[providers/implementations/ciphers/cipher_null.inc]=\
+ providers/implementations/ciphers/cipher_null.inc.in
+GENERATE[providers/implementations/ciphers/cipher_rc4_hmac_md5.inc]=\
+ providers/implementations/ciphers/cipher_rc4_hmac_md5.inc.in
+GENERATE[providers/implementations/ciphers/cipher_sm4_xts.inc]=\
+ providers/implementations/ciphers/cipher_sm4_xts.inc.in
GENERATE[providers/implementations/digests/blake2_prov.c]=\
providers/implementations/digests/blake2_prov.c.in
GENERATE[providers/implementations/digests/digestcommon.c]=\
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
/*
* AES low level APIs are deprecated for public use, but still ok for internal
};
#else
+# include "providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.inc"
+
# define AES_CBC_HMAC_SHA_FLAGS (PROV_CIPHER_FLAG_AEAD \
| PROV_CIPHER_FLAG_TLS1_MULTIBLOCK)
return aes_set_ctx_params(ctx, params);
}
-{- produce_param_decoder('aes_cbc_hmac_sha_set_ctx_params',
- (['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT',
- 'maxfrag', 'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD',
- 'mb_aad', 'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE',
- 'ileave', 'uint', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC',
- 'enc', 'octet_string', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN',
- 'enc_in', 'octet_string', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_AEAD_MAC_KEY', 'key', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'tlsaad', 'octet_string'],
- ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_TLS_VERSION', 'tlsver', 'uint' ],
- )); -}
-
const OSSL_PARAM *aes_settable_ctx_params(ossl_unused void *cctx,
ossl_unused void *provctx)
{
return ret;
}
-{- produce_param_decoder('aes_cbc_hmac_sha_get_ctx_params',
- (['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE',
- 'max', 'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE',
- 'inter', 'uint', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN',
- 'packlen', 'uint', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN',
- 'enclen', 'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
- ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
- ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
- )); -}
-
static int aes_get_ctx_params(void *vctx, OSSL_PARAM params[])
{
PROV_AES_HMAC_SHA_CTX *ctx = (PROV_AES_HMAC_SHA_CTX *)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('aes_cbc_hmac_sha_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT',
+ 'maxfrag', 'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD',
+ 'mb_aad', 'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE',
+ 'ileave', 'uint', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC',
+ 'enc', 'octet_string', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN',
+ 'enc_in', 'octet_string', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_AEAD_MAC_KEY', 'key', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'tlsaad', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_TLS_VERSION', 'tlsver', 'uint' ],
+ )); -}
+
+{- produce_param_decoder('aes_cbc_hmac_sha_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE',
+ 'max', 'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE',
+ 'inter', 'uint', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN',
+ 'packlen', 'uint', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN',
+ 'enclen', 'size_t', "#if !defined(OPENSSL_NO_MULTIBLOCK)"],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
+ ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', '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"
OSSL_DISPATCH_END \
};
#else
+
+# include "providers/implementations/ciphers/cipher_aes_cbc_hmac_sha_etm.inc"
+
static OSSL_FUNC_cipher_encrypt_init_fn aes_einit;
static OSSL_FUNC_cipher_decrypt_init_fn aes_dinit;
static OSSL_FUNC_cipher_gettable_ctx_params_fn aes_gettable_ctx_params;
# define aes_final ossl_cipher_generic_stream_final
# define aes_cipher ossl_cipher_generic_cipher
-{- produce_param_decoder('aes_cbc_hmac_sha_etm_set_ctx_params',
- (['OSSL_CIPHER_PARAM_AEAD_MAC_KEY', 'key', 'octet_string'],
- ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_HMAC_PARAM_MAC', 'mac', 'octet_string'],
- )); -}
-
static int aes_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)vctx;
return aes_set_ctx_params(ctx, params);
}
-{- produce_param_decoder('aes_cbc_hmac_sha_etm_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
- ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
- ['OSSL_CIPHER_HMAC_PARAM_MAC', 'mac', 'octet_string'],
- )); -}
-
static int aes_get_ctx_params(void *vctx, OSSL_PARAM params[])
{
PROV_AES_HMAC_SHA_ETM_CTX *ctx = (PROV_AES_HMAC_SHA_ETM_CTX *)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('aes_cbc_hmac_sha_etm_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_AEAD_MAC_KEY', 'key', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_HMAC_PARAM_MAC', 'mac', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('aes_cbc_hmac_sha_etm_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
+ ['OSSL_CIPHER_HMAC_PARAM_MAC', 'mac', '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);
--}
/* Dispatch functions for AES SIV mode */
#include "prov/ciphercommon_aead.h"
#include "prov/provider_ctx.h"
#include "cipher_aes_gcm_siv.h"
+#include "providers/implementations/ciphers/cipher_aes_gcm_siv.inc"
static int ossl_aes_gcm_siv_set_ctx_params(void *vctx, const OSSL_PARAM params[]);
return !error;
}
-{- produce_param_decoder('ossl_aes_gcm_siv_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- )); -}
-
static int ossl_aes_gcm_siv_get_ctx_params(void *vctx, OSSL_PARAM params[])
{
PROV_AES_GCM_SIV_CTX *ctx = (PROV_AES_GCM_SIV_CTX *)vctx;
return ossl_aes_gcm_siv_get_ctx_params_list;
}
-{- produce_param_decoder('aes_gcm_siv_set_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_SPEED', 'speed', 'uint'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- )); -}
-
static int ossl_aes_gcm_siv_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_AES_GCM_SIV_CTX *ctx = (PROV_AES_GCM_SIV_CTX *)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('ossl_aes_gcm_siv_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('aes_gcm_siv_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_SPEED', 'speed', 'uint'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', '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);
--}
/*
* AES low level APIs are deprecated for public use, but still ok for internal
#include "prov/providercommon.h"
#include "prov/ciphercommon_aead.h"
#include "prov/implementations.h"
+#include "providers/implementations/ciphers/cipher_aes_ocb.inc"
#define AES_OCB_FLAGS AEAD_FLAGS
return ret;
}
-{- produce_param_decoder('aes_ocb_set_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- )); -}
-
static const OSSL_PARAM *cipher_ocb_settable_ctx_params(ossl_unused void *cctx,
ossl_unused void *p_ctx)
{
return 1;
}
-{- produce_param_decoder('aes_ocb_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
- ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- )); -}
-
static const OSSL_PARAM *cipher_ocb_gettable_ctx_params(ossl_unused void *cctx,
ossl_unused void *p_ctx)
{
--- /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('aes_ocb_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('aes_ocb_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', '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);
--}
/* Dispatch functions for AES SIV mode */
#include "prov/providercommon.h"
#include "prov/ciphercommon_aead.h"
#include "prov/provider_ctx.h"
+#include "providers/implementations/ciphers/cipher_aes_siv.inc"
#define siv_stream_update siv_cipher
#define SIV_FLAGS AEAD_FLAGS
return 1;
}
-{- produce_param_decoder('aes_siv_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- )); -}
-
static int aes_siv_get_ctx_params(void *vctx, OSSL_PARAM params[])
{
PROV_AES_SIV_CTX *ctx = (PROV_AES_SIV_CTX *)vctx;
return aes_siv_get_ctx_params_list;
}
-
-{- produce_param_decoder('aes_siv_set_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_SPEED', 'speed', 'uint'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- )); -}
-
static int aes_siv_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_AES_SIV_CTX *ctx = (PROV_AES_SIV_CTX *)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('aes_siv_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('aes_siv_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_SPEED', 'speed', 'uint'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', '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);
--}
/*
* This file uses the low level AES functions (which are deprecated for
#include "cipher_aes.h"
#include "prov/providercommon.h"
#include "prov/implementations.h"
+#include "providers/implementations/ciphers/cipher_aes_wrp.inc"
/* AES wrap with padding has IV length of 4, without padding 8 */
#define AES_WRAP_PAD_IVLEN 4
} PROV_AES_WRAP_CTX;
-
static void *aes_wrap_newctx(size_t kbits, size_t blkbits,
size_t ivbits, unsigned int mode, uint64_t flags)
{
return 1;
}
-{- produce_param_decoder('aes_wrap_set_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- )); -}
-
static const OSSL_PARAM *aes_wrap_settable_ctx_params(ossl_unused void *cctx,
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('aes_wrap_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', '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);
--}
/*
* AES low level APIs are deprecated for public use, but still ok for internal
#include "cipher_aes_xts.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_aes_xts.inc"
#define AES_XTS_FLAGS PROV_CIPHER_FLAG_CUSTOM_IV
#define AES_XTS_IV_BITS 128
return 1;
}
-{- produce_param_decoder('aes_xts_set_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- )); -}
-
static const OSSL_PARAM *aes_xts_settable_ctx_params(ossl_unused void *cctx,
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('aes_xts_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', '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);
--}
/* Dispatch functions for chacha20 cipher */
#include "cipher_chacha20.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_chacha20.inc"
#define CHACHA20_KEYLEN (CHACHA_KEY_SIZE)
#define CHACHA20_BLKLEN (1)
CHACHA20_IVLEN * 8);
}
-{- produce_param_decoder('chacha20_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
- )); -}
-
static int chacha20_get_ctx_params(void *vctx, OSSL_PARAM params[])
{
PROV_CHACHA20_CTX *ctx = (PROV_CHACHA20_CTX *)vctx;
return chacha20_get_ctx_params_list;
}
-{- produce_param_decoder('chacha20_set_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- )); -}
-
static int chacha20_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_CHACHA20_CTX *ctx = (PROV_CHACHA20_CTX *)vctx;
(void (*)(void))chacha20_settable_ctx_params },
OSSL_DISPATCH_END
};
-
--- /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('chacha20_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_UPDATED_IV', 'upd_iv', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('chacha20_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', '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);
--}
/* Dispatch functions for chacha20_poly1305 cipher */
#include "cipher_chacha20_poly1305.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_chacha20_poly1305.inc"
#define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
#define CHACHA20_POLY1305_BLKLEN 1
CHACHA20_POLY1305_IVLEN * 8);
}
-{- produce_param_decoder('chacha20_poly1305_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
- )); -}
-
static int chacha20_poly1305_get_ctx_params(void *vctx, OSSL_PARAM params[])
{
PROV_CHACHA20_POLY1305_CTX *ctx = (PROV_CHACHA20_POLY1305_CTX *)vctx;
return chacha20_poly1305_get_ctx_params_list;
}
-{- produce_param_decoder('chacha20_poly1305_set_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED', 'fixed', 'octet_string'],
- )); -}
-
static const OSSL_PARAM *chacha20_poly1305_settable_ctx_params(
ossl_unused void *cctx, ossl_unused void *provctx
)
if (!chacha20_poly1305_set_ctx_params_decoder(params, &p))
return 0;
-
if (p.keylen != NULL) {
if (!OSSL_PARAM_get_size_t(p.keylen, &len)) {
ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
(void (*)(void))chacha20_poly1305_settable_ctx_params },
OSSL_DISPATCH_END
};
-
--- /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('chacha20_poly1305_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
+ )); -}
+
+{- produce_param_decoder('chacha20_poly1305_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED', 'fixed', '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 <string.h>
#include <openssl/crypto.h>
#include "prov/implementations.h"
#include "prov/ciphercommon.h"
#include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_null.inc"
typedef struct prov_cipher_null_ctx_st {
int enc;
return ossl_cipher_generic_get_params(params, 0, 0, 0, 8, 0);
}
-{- produce_param_decoder('null_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_TLS_MAC', 'mac', 'octet_ptr'],
- )); -}
-
static OSSL_FUNC_cipher_gettable_ctx_params_fn null_gettable_ctx_params;
static const OSSL_PARAM *null_gettable_ctx_params(ossl_unused void *cctx,
ossl_unused void *provctx)
return 1;
}
-{- produce_param_decoder('null_set_ctx_params',
- (['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'macsize', 'size_t'],
- )); -}
-
static OSSL_FUNC_cipher_settable_ctx_params_fn null_settable_ctx_params;
static const OSSL_PARAM *null_settable_ctx_params(ossl_unused void *cctx,
ossl_unused void *provctx)
return null_set_ctx_params_list;
}
-
static OSSL_FUNC_cipher_set_ctx_params_fn null_set_ctx_params;
static int null_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
--- /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('null_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_TLS_MAC', 'mac', 'octet_ptr'],
+ )); -}
+
+{- produce_param_decoder('null_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'macsize', '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);
--}
/* Dispatch functions for RC4_HMAC_MD5 cipher */
#include "cipher_rc4_hmac_md5.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_rc4_hmac_md5.inc"
#define RC4_HMAC_MD5_FLAGS (PROV_CIPHER_FLAG_VARIABLE_LENGTH \
| PROV_CIPHER_FLAG_AEAD)
return rc4_hmac_md5_set_ctx_params(ctx, params);
}
-{- produce_param_decoder('rc4_hmac_md5_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
- )); -}
-
static const OSSL_PARAM *rc4_hmac_md5_gettable_ctx_params(ossl_unused void *cctx,
ossl_unused void *provctx)
{
return 1;
}
-{- produce_param_decoder('rc4_hmac_md5_set_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_MAC_KEY', 'mackey', 'octet_string'],
- ['OSSL_CIPHER_PARAM_TLS_VERSION', 'tlsver', 'uint'],
- )); -}
-
static const OSSL_PARAM *rc4_hmac_md5_settable_ctx_params(ossl_unused void *cctx,
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('rc4_hmac_md5_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
+ )); -}
+
+{- produce_param_decoder('rc4_hmac_md5_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_MAC_KEY', 'mackey', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_TLS_VERSION', 'tlsver', 'uint'],
+ )); -}
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
-{-
-use OpenSSL::paramnames qw(produce_param_decoder);
--}
/* Dispatch functions for SM4 XTS mode */
#include "cipher_sm4_xts.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
+#include "providers/implementations/ciphers/cipher_sm4_xts.inc"
#define SM4_XTS_FLAGS PROV_CIPHER_FLAG_CUSTOM_IV
#define SM4_XTS_IV_BITS 128
return 1;
}
-{- produce_param_decoder('sm4_xts_set_ctx_params',
- (['OSSL_CIPHER_PARAM_XTS_STANDARD', 'std', 'utf8_string'],
- )); -}
-
static const OSSL_PARAM *sm4_xts_settable_ctx_params(ossl_unused void *cctx,
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('sm4_xts_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_XTS_STANDARD', 'std', 'utf8_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);
--}
/*
* Generic dispatch table functions for ciphers.
#include "internal/e_os.h"
#include "crypto/types.h"
+#define cipher_generic_get_ctx_params_st ossl_cipher_get_ctx_param_list_st
+#define cipher_generic_set_ctx_params_st ossl_cipher_set_ctx_param_list_st
+#define cipher_var_keylen_set_ctx_params_st ossl_cipher_set_ctx_param_list_st
+
+#include "providers/implementations/ciphers/ciphercommon.inc"
+
/*-
* Generic cipher functions for OSSL_PARAM gettables and settables
*/
-{- produce_param_decoder('ossl_cipher_generic_get_params',
- (['OSSL_CIPHER_PARAM_MODE', 'mode', 'uint'],
- ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_BLOCK_SIZE', 'bsize', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD', 'aead', 'int' ],
- ['OSSL_CIPHER_PARAM_CUSTOM_IV', 'custiv', 'int' ],
- ['OSSL_CIPHER_PARAM_CTS', 'cts', 'int' ],
- ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK', 'mb', 'int' ],
- ['OSSL_CIPHER_PARAM_HAS_RAND_KEY', 'rand', 'int' ],
- ['OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC', 'etm', 'int' ],
- )); -}
const OSSL_PARAM *ossl_cipher_generic_gettable_params(ossl_unused void *provctx)
{
return 1;
}
-#define cipher_generic_get_ctx_params_st ossl_cipher_get_ctx_param_list_st
-
-{- produce_param_decoder('cipher_generic_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_PADDING', 'pad', 'uint'],
- ['OSSL_CIPHER_PARAM_NUM', 'num', 'uint' ],
- ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string' ],
- ['OSSL_CIPHER_PARAM_UPDATED_IV', 'updiv', 'octet_string' ],
- ['OSSL_CIPHER_PARAM_TLS_MAC', 'tlsmac', 'octet_string' ],
- )); -}
-
const OSSL_PARAM *ossl_cipher_generic_gettable_ctx_params
(ossl_unused void *cctx, ossl_unused void *provctx)
{
return cipher_generic_get_ctx_params_list;
}
-#define cipher_generic_set_ctx_params_st ossl_cipher_set_ctx_param_list_st
-
-{- produce_param_decoder('cipher_generic_set_ctx_params',
- (['OSSL_CIPHER_PARAM_PADDING', 'pad', 'uint'],
- ['OSSL_CIPHER_PARAM_NUM', 'num', 'uint'],
- ['OSSL_CIPHER_PARAM_USE_BITS', 'bits', 'uint'],
- ['OSSL_CIPHER_PARAM_TLS_VERSION', 'tlsvers', 'uint'],
- ['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'tlsmacsize', 'size_t'],
- )); -}
-
const OSSL_PARAM *ossl_cipher_generic_settable_ctx_params
(ossl_unused void *cctx, ossl_unused void *provctx)
{
/*
* Variable key length cipher functions for OSSL_PARAM settables
*/
-#define cipher_var_keylen_set_ctx_params_st ossl_cipher_set_ctx_param_list_st
-
-{- produce_param_decoder('cipher_var_keylen_set_ctx_params',
- (['OSSL_CIPHER_PARAM_PADDING', 'pad', 'uint'],
- ['OSSL_CIPHER_PARAM_NUM', 'num', 'uint'],
- ['OSSL_CIPHER_PARAM_USE_BITS', 'bits', 'uint'],
- ['OSSL_CIPHER_PARAM_TLS_VERSION', 'tlsvers', 'uint'],
- ['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'tlsmacsize', 'size_t'],
- ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- )); -}
const OSSL_PARAM *ossl_cipher_var_keylen_settable_ctx_params
(ossl_unused void *cctx, ossl_unused void *provctx)
return 0;
}
-
/* Shouldn't normally fail */
if (!ctx->hw->cipher(ctx, out, in, inl)) {
ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
--- /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('ossl_cipher_generic_get_params',
+ (['OSSL_CIPHER_PARAM_MODE', 'mode', 'uint'],
+ ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_BLOCK_SIZE', 'bsize', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD', 'aead', 'int' ],
+ ['OSSL_CIPHER_PARAM_CUSTOM_IV', 'custiv', 'int' ],
+ ['OSSL_CIPHER_PARAM_CTS', 'cts', 'int' ],
+ ['OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK', 'mb', 'int' ],
+ ['OSSL_CIPHER_PARAM_HAS_RAND_KEY', 'rand', 'int' ],
+ ['OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC', 'etm', 'int' ],
+ )); -}
+
+{- produce_param_decoder('cipher_generic_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_PADDING', 'pad', 'uint'],
+ ['OSSL_CIPHER_PARAM_NUM', 'num', 'uint' ],
+ ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string' ],
+ ['OSSL_CIPHER_PARAM_UPDATED_IV', 'updiv', 'octet_string' ],
+ ['OSSL_CIPHER_PARAM_TLS_MAC', 'tlsmac', 'octet_string' ],
+ )); -}
+
+{- produce_param_decoder('cipher_generic_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_PADDING', 'pad', 'uint'],
+ ['OSSL_CIPHER_PARAM_NUM', 'num', 'uint'],
+ ['OSSL_CIPHER_PARAM_USE_BITS', 'bits', 'uint'],
+ ['OSSL_CIPHER_PARAM_TLS_VERSION', 'tlsvers', 'uint'],
+ ['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'tlsmacsize', 'size_t'],
+ )); -}
+
+{- produce_param_decoder('cipher_var_keylen_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_PADDING', 'pad', 'uint'],
+ ['OSSL_CIPHER_PARAM_NUM', 'num', 'uint'],
+ ['OSSL_CIPHER_PARAM_USE_BITS', 'bits', 'uint'],
+ ['OSSL_CIPHER_PARAM_TLS_VERSION', 'tlsvers', 'uint'],
+ ['OSSL_CIPHER_PARAM_TLS_MAC_SIZE', 'tlsmacsize', 'size_t'],
+ ['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', '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);
--}
/* Dispatch functions for ccm mode */
#include "prov/ciphercommon_ccm.h"
#include "prov/providercommon.h"
+#include "providers/implementations/ciphers/ciphercommon_ccm.inc"
static int ccm_cipher_internal(PROV_CCM_CTX *ctx, unsigned char *out,
size_t *padlen, const unsigned char *in,
return 15 - ctx->l;
}
-{- produce_param_decoder('ossl_cipher_ccm_set_ctx_params',
- (['OSSL_CIPHER_PARAM_AEAD_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED', 'fixed', 'octet_string'],
- )); -}
-
const OSSL_PARAM *ossl_ccm_settable_ctx_params(
ossl_unused void *cctx, ossl_unused void *provctx
)
return 1;
}
-{- produce_param_decoder('ossl_cipher_ccm_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
- ['OSSL_CIPHER_PARAM_UPDATED_IV', 'updiv', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
- )); -}
-
const OSSL_PARAM *ossl_ccm_gettable_ctx_params(
ossl_unused void *cctx, 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('ossl_cipher_ccm_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_AEAD_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED', 'fixed', 'octet_string'],
+ )); -}
+
+{- produce_param_decoder('ossl_cipher_ccm_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_UPDATED_IV', 'updiv', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', '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);
--}
/* Dispatch functions for gcm mode */
#include "prov/providercommon.h"
#include "prov/provider_ctx.h"
+#include "providers/implementations/ciphers/ciphercommon_gcm.inc"
+
static int gcm_tls_init(PROV_GCM_CTX *dat, unsigned char *aad, size_t aad_len);
static int gcm_tls_iv_set_fixed(PROV_GCM_CTX *ctx, unsigned char *iv,
size_t len);
return 1;
}
-{- produce_param_decoder('ossl_cipher_gcm_get_ctx_params',
- (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
- ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
- ['OSSL_CIPHER_PARAM_UPDATED_IV', 'updiv', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN', 'ivgen', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_IV_GENERATED', 'gen', 'uint'],
- )); -}
-
const OSSL_PARAM *ossl_gcm_gettable_ctx_params(
ossl_unused void *cctx, ossl_unused void *provctx
)
return 1;
}
-{- produce_param_decoder
- ('ossl_cipher_gcm_set_ctx_params',
- (['OSSL_CIPHER_PARAM_AEAD_IVLEN', 'ivlen', 'size_t'],
- ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED', 'fixed', 'octet_string'],
- ['OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV', 'inviv', 'octet_string'],
- )); -}
-
const OSSL_PARAM *ossl_gcm_settable_ctx_params(
ossl_unused void *cctx, 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('ossl_cipher_gcm_get_ctx_params',
+ (['OSSL_CIPHER_PARAM_KEYLEN', 'keylen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAGLEN', 'taglen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_IV', 'iv', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_UPDATED_IV', 'updiv', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD', 'pad', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN', 'ivgen', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_IV_GENERATED', 'gen', 'uint'],
+ )); -}
+
+{- produce_param_decoder
+ ('ossl_cipher_gcm_set_ctx_params',
+ (['OSSL_CIPHER_PARAM_AEAD_IVLEN', 'ivlen', 'size_t'],
+ ['OSSL_CIPHER_PARAM_AEAD_TAG', 'tag', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_AAD', 'aad', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED', 'fixed', 'octet_string'],
+ ['OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV', 'inviv', 'octet_string'],
+ )); -}