From 027535c8a540f69571b876f973e0ba3888d88430 Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Wed, 5 Jun 2024 11:04:23 +0100 Subject: [PATCH] Remove MBEDTLS_SHA256_ALT Signed-off-by: Thomas Daubney --- include/mbedtls/check_config.h | 4 ++-- include/mbedtls/mbedtls_config.h | 1 - tests/include/alt-dummy/sha256_alt.h | 16 ---------------- .../drivers/builtin/include/mbedtls/sha256.h | 8 -------- tf-psa-crypto/drivers/builtin/src/sha256.c | 4 ---- 5 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 tests/include/alt-dummy/sha256_alt.h diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index 178bd39f28..9f1ca2bc7d 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -750,8 +750,8 @@ #if !defined(MBEDTLS_SHA256_C) #error "MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_* defined without MBEDTLS_SHA256_C" #endif -#if defined(MBEDTLS_SHA256_ALT) || defined(MBEDTLS_SHA256_PROCESS_ALT) -#error "MBEDTLS_SHA256_*ALT can't be used with MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_*" +#if defined(MBEDTLS_SHA256_PROCESS_ALT) +#error "MBEDTLS_SHA256_PROCESS_ALT can't be used with MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_*" #endif #endif diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h index 007a22dc2d..5b972a916a 100644 --- a/include/mbedtls/mbedtls_config.h +++ b/include/mbedtls/mbedtls_config.h @@ -352,7 +352,6 @@ //#define MBEDTLS_CMAC_ALT //#define MBEDTLS_MD5_ALT -//#define MBEDTLS_SHA256_ALT //#define MBEDTLS_SHA512_ALT /** diff --git a/tests/include/alt-dummy/sha256_alt.h b/tests/include/alt-dummy/sha256_alt.h deleted file mode 100644 index b1900adee9..0000000000 --- a/tests/include/alt-dummy/sha256_alt.h +++ /dev/null @@ -1,16 +0,0 @@ -/* sha256_alt.h with dummy types for MBEDTLS_SHA256_ALT */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later - */ - -#ifndef SHA256_ALT_H -#define SHA256_ALT_H - -typedef struct mbedtls_sha256_context { - int dummy; -} -mbedtls_sha256_context; - - -#endif /* sha256_alt.h */ diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/sha256.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/sha256.h index ca568e291e..0253f7dc5d 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/sha256.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/sha256.h @@ -26,10 +26,6 @@ extern "C" { #endif -#if !defined(MBEDTLS_SHA256_ALT) -// Regular implementation -// - /** * \brief The SHA-256 context structure. * @@ -48,10 +44,6 @@ typedef struct mbedtls_sha256_context { } mbedtls_sha256_context; -#else /* MBEDTLS_SHA256_ALT */ -#include "sha256_alt.h" -#endif /* MBEDTLS_SHA256_ALT */ - /** * \brief This function initializes a SHA-256 context. * diff --git a/tf-psa-crypto/drivers/builtin/src/sha256.c b/tf-psa-crypto/drivers/builtin/src/sha256.c index 8b2c34526b..ec1e9692e2 100644 --- a/tf-psa-crypto/drivers/builtin/src/sha256.c +++ b/tf-psa-crypto/drivers/builtin/src/sha256.c @@ -216,8 +216,6 @@ static int mbedtls_a64_crypto_sha256_determine_support(void) #endif /* MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT */ -#if !defined(MBEDTLS_SHA256_ALT) - #define SHA256_BLOCK_SIZE 64 void mbedtls_sha256_init(mbedtls_sha256_context *ctx) @@ -763,8 +761,6 @@ exit: return ret; } -#endif /* !MBEDTLS_SHA256_ALT */ - /* * output = SHA-256( input buffer ) */