From b4914cfeb51dfee8a644ef2535d60d6da28dbc0b Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Tue, 4 Jun 2024 12:05:20 +0100 Subject: [PATCH] Remove MBEDTLS_CCM_ALT Signed-off-by: Thomas Daubney --- include/mbedtls/mbedtls_config.h | 1 - tests/include/alt-dummy/ccm_alt.h | 16 ---------------- tests/suites/test_suite_ccm.data | 1 - .../drivers/builtin/include/mbedtls/ccm.h | 8 -------- tf-psa-crypto/drivers/builtin/src/ccm.c | 4 ---- 5 files changed, 30 deletions(-) delete mode 100644 tests/include/alt-dummy/ccm_alt.h diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h index c217cf79d5..452889955f 100644 --- a/include/mbedtls/mbedtls_config.h +++ b/include/mbedtls/mbedtls_config.h @@ -352,7 +352,6 @@ //#define MBEDTLS_ARIA_ALT //#define MBEDTLS_CAMELLIA_ALT -//#define MBEDTLS_CCM_ALT //#define MBEDTLS_CMAC_ALT //#define MBEDTLS_DES_ALT //#define MBEDTLS_GCM_ALT diff --git a/tests/include/alt-dummy/ccm_alt.h b/tests/include/alt-dummy/ccm_alt.h deleted file mode 100644 index c25f42b4a0..0000000000 --- a/tests/include/alt-dummy/ccm_alt.h +++ /dev/null @@ -1,16 +0,0 @@ -/* ccm_alt.h with dummy types for MBEDTLS_CCM_ALT */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later - */ - -#ifndef CCM_ALT_H -#define CCM_ALT_H - -typedef struct mbedtls_ccm_context { - int dummy; -} -mbedtls_ccm_context; - - -#endif /* ccm_alt.h */ diff --git a/tests/suites/test_suite_ccm.data b/tests/suites/test_suite_ccm.data index 22150f7a71..e6818e7403 100644 --- a/tests/suites/test_suite_ccm.data +++ b/tests/suites/test_suite_ccm.data @@ -36,7 +36,6 @@ CCM lengths #6 tag length not even ccm_lengths:5:10:5:7:MBEDTLS_ERR_CCM_BAD_INPUT CCM lengths #7 AD too long (2^16 - 2^8) -depends_on:!MBEDTLS_CCM_ALT ccm_lengths:5:10:65280:8:MBEDTLS_ERR_CCM_BAD_INPUT CCM lengths #8 msg too long for this IV length (2^16, q = 2) diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/ccm.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/ccm.h index 1da57c921b..67d173d7fc 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/ccm.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/ccm.h @@ -58,10 +58,6 @@ extern "C" { #endif -#if !defined(MBEDTLS_CCM_ALT) -// Regular implementation -// - /** * \brief The CCM context-type definition. The CCM context is passed * to the APIs called. @@ -94,10 +90,6 @@ typedef struct mbedtls_ccm_context { } mbedtls_ccm_context; -#else /* MBEDTLS_CCM_ALT */ -#include "ccm_alt.h" -#endif /* MBEDTLS_CCM_ALT */ - /** * \brief This function initializes the specified CCM context, * to make references valid, and prepare the context diff --git a/tf-psa-crypto/drivers/builtin/src/ccm.c b/tf-psa-crypto/drivers/builtin/src/ccm.c index 45ed697dd3..2503e9f6ac 100644 --- a/tf-psa-crypto/drivers/builtin/src/ccm.c +++ b/tf-psa-crypto/drivers/builtin/src/ccm.c @@ -38,9 +38,6 @@ #endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */ #endif /* MBEDTLS_PLATFORM_C */ -#if !defined(MBEDTLS_CCM_ALT) - - /* * Initialize context */ @@ -626,7 +623,6 @@ int mbedtls_ccm_auth_decrypt(mbedtls_ccm_context *ctx, size_t length, iv, iv_len, add, add_len, input, output, tag, tag_len); } -#endif /* !MBEDTLS_CCM_ALT */ #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_CCM_GCM_CAN_AES) /*