From 2cd12de61496895b9249621504dc6fb330556b09 Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Wed, 5 Jun 2024 09:59:44 +0100 Subject: [PATCH] Remove MBEDTLS_SHA1_ALT Signed-off-by: Thomas Daubney --- include/mbedtls/mbedtls_config.h | 1 - tests/include/alt-dummy/sha1_alt.h | 16 ---------------- .../drivers/builtin/include/mbedtls/sha1.h | 8 -------- tf-psa-crypto/drivers/builtin/src/sha1.c | 4 ---- 4 files changed, 29 deletions(-) delete mode 100644 tests/include/alt-dummy/sha1_alt.h diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h index 33b89ef469..a2d57fcceb 100644 --- a/include/mbedtls/mbedtls_config.h +++ b/include/mbedtls/mbedtls_config.h @@ -353,7 +353,6 @@ //#define MBEDTLS_CMAC_ALT //#define MBEDTLS_MD5_ALT //#define MBEDTLS_RIPEMD160_ALT -//#define MBEDTLS_SHA1_ALT //#define MBEDTLS_SHA256_ALT //#define MBEDTLS_SHA512_ALT diff --git a/tests/include/alt-dummy/sha1_alt.h b/tests/include/alt-dummy/sha1_alt.h deleted file mode 100644 index d8ac971913..0000000000 --- a/tests/include/alt-dummy/sha1_alt.h +++ /dev/null @@ -1,16 +0,0 @@ -/* sha1_alt.h with dummy types for MBEDTLS_SHA1_ALT */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later - */ - -#ifndef SHA1_ALT_H -#define SHA1_ALT_H - -typedef struct mbedtls_sha1_context { - int dummy; -} -mbedtls_sha1_context; - - -#endif /* sha1_alt.h */ diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/sha1.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/sha1.h index 592ffd13f2..4b31c02504 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/sha1.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/sha1.h @@ -30,10 +30,6 @@ extern "C" { #endif -#if !defined(MBEDTLS_SHA1_ALT) -// Regular implementation -// - /** * \brief The SHA-1 context structure. * @@ -49,10 +45,6 @@ typedef struct mbedtls_sha1_context { } mbedtls_sha1_context; -#else /* MBEDTLS_SHA1_ALT */ -#include "sha1_alt.h" -#endif /* MBEDTLS_SHA1_ALT */ - /** * \brief This function initializes a SHA-1 context. * diff --git a/tf-psa-crypto/drivers/builtin/src/sha1.c b/tf-psa-crypto/drivers/builtin/src/sha1.c index dfbe481f39..c8d2852d45 100644 --- a/tf-psa-crypto/drivers/builtin/src/sha1.c +++ b/tf-psa-crypto/drivers/builtin/src/sha1.c @@ -22,8 +22,6 @@ #include "mbedtls/platform.h" -#if !defined(MBEDTLS_SHA1_ALT) - void mbedtls_sha1_init(mbedtls_sha1_context *ctx) { memset(ctx, 0, sizeof(mbedtls_sha1_context)); @@ -346,8 +344,6 @@ exit: return ret; } -#endif /* !MBEDTLS_SHA1_ALT */ - /* * output = SHA-1( input buffer ) */