diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h index 452889955..a3185238c 100644 --- a/include/mbedtls/mbedtls_config.h +++ b/include/mbedtls/mbedtls_config.h @@ -354,7 +354,6 @@ //#define MBEDTLS_CAMELLIA_ALT //#define MBEDTLS_CMAC_ALT //#define MBEDTLS_DES_ALT -//#define MBEDTLS_GCM_ALT //#define MBEDTLS_NIST_KW_ALT //#define MBEDTLS_MD5_ALT //#define MBEDTLS_RIPEMD160_ALT diff --git a/tests/include/alt-dummy/gcm_alt.h b/tests/include/alt-dummy/gcm_alt.h deleted file mode 100644 index cfa73d2a4..000000000 --- a/tests/include/alt-dummy/gcm_alt.h +++ /dev/null @@ -1,16 +0,0 @@ -/* gcm_alt.h with dummy types for MBEDTLS_GCM_ALT */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later - */ - -#ifndef GCM_ALT_H -#define GCM_ALT_H - -typedef struct mbedtls_gcm_context { - int dummy; -} -mbedtls_gcm_context; - - -#endif /* gcm_alt.h */ diff --git a/tests/include/test/psa_crypto_helpers.h b/tests/include/test/psa_crypto_helpers.h index 5bab8e461..062beafdd 100644 --- a/tests/include/test/psa_crypto_helpers.h +++ b/tests/include/test/psa_crypto_helpers.h @@ -293,8 +293,7 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string); * \param alg The AEAD algorithm. * \param nonce_length The nonce length in number of bytes. */ -#if defined(MBEDTLS_GCM_ALT) || \ - defined(MBEDTLS_PSA_ACCEL_ALG_GCM) +#if defined(MBEDTLS_PSA_ACCEL_ALG_GCM) #define MBEDTLS_TEST_HAVE_ALT_GCM 1 #else #define MBEDTLS_TEST_HAVE_ALT_GCM 0 diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/gcm.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/gcm.h index 98faa4361..72632fa41 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/gcm.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/gcm.h @@ -44,8 +44,6 @@ extern "C" { #endif -#if !defined(MBEDTLS_GCM_ALT) - #if defined(MBEDTLS_GCM_LARGE_TABLE) #define MBEDTLS_GCM_HTABLE_SIZE 256 #else @@ -74,10 +72,6 @@ typedef struct mbedtls_gcm_context { } mbedtls_gcm_context; -#else /* !MBEDTLS_GCM_ALT */ -#include "gcm_alt.h" -#endif /* !MBEDTLS_GCM_ALT */ - /** * \brief This function initializes the specified GCM context, * to make references valid, and prepares the context diff --git a/tf-psa-crypto/drivers/builtin/src/gcm.c b/tf-psa-crypto/drivers/builtin/src/gcm.c index bf219431a..dda1ff21f 100644 --- a/tf-psa-crypto/drivers/builtin/src/gcm.c +++ b/tf-psa-crypto/drivers/builtin/src/gcm.c @@ -39,8 +39,6 @@ #include "aesce.h" #endif -#if !defined(MBEDTLS_GCM_ALT) - /* Used to select the acceleration mechanism */ #define MBEDTLS_GCM_ACC_SMALLTABLE 0 #define MBEDTLS_GCM_ACC_LARGETABLE 1 @@ -780,8 +778,6 @@ void mbedtls_gcm_free(mbedtls_gcm_context *ctx) mbedtls_platform_zeroize(ctx, sizeof(mbedtls_gcm_context)); } -#endif /* !MBEDTLS_GCM_ALT */ - #if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_CCM_GCM_CAN_AES) /* * AES-GCM test vectors from: @@ -1024,9 +1020,6 @@ int mbedtls_gcm_self_test(int verbose) size_t olen; if (verbose != 0) { -#if defined(MBEDTLS_GCM_ALT) - mbedtls_printf(" GCM note: alternative implementation.\n"); -#else /* MBEDTLS_GCM_ALT */ #if defined(MBEDTLS_AESNI_HAVE_CODE) if (mbedtls_aesni_has_support(MBEDTLS_AESNI_CLMUL)) { mbedtls_printf(" GCM note: using AESNI.\n"); @@ -1040,7 +1033,6 @@ int mbedtls_gcm_self_test(int verbose) #endif mbedtls_printf(" GCM note: built-in implementation.\n"); -#endif /* MBEDTLS_GCM_ALT */ } static const int loop_limit = @@ -1080,14 +1072,6 @@ int mbedtls_gcm_self_test(int verbose) add_len_test_data[i], pt_test_data[pt_index_test_data[i]], buf, 16, tag_buf); -#if defined(MBEDTLS_GCM_ALT) - /* Allow alternative implementations to only support 12-byte nonces. */ - if (ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED && - iv_len_test_data[i] != 12) { - mbedtls_printf("skipped\n"); - break; - } -#endif /* defined(MBEDTLS_GCM_ALT) */ if (ret != 0) { goto exit; }