diff --git a/library/md.c b/library/md.c index 7cd57ef883..b6e054d312 100644 --- a/library/md.c +++ b/library/md.c @@ -77,7 +77,7 @@ #endif #if defined(MBEDTLS_MD_CAN_MD5) -const mbedtls_md_info_t mbedtls_md5_info = { +static const mbedtls_md_info_t mbedtls_md5_info = { MBEDTLS_MD_MD5, 16, 64, @@ -85,7 +85,7 @@ const mbedtls_md_info_t mbedtls_md5_info = { #endif #if defined(MBEDTLS_MD_CAN_RIPEMD160) -const mbedtls_md_info_t mbedtls_ripemd160_info = { +static const mbedtls_md_info_t mbedtls_ripemd160_info = { MBEDTLS_MD_RIPEMD160, 20, 64, @@ -93,7 +93,7 @@ const mbedtls_md_info_t mbedtls_ripemd160_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA1) -const mbedtls_md_info_t mbedtls_sha1_info = { +static const mbedtls_md_info_t mbedtls_sha1_info = { MBEDTLS_MD_SHA1, 20, 64, @@ -101,7 +101,7 @@ const mbedtls_md_info_t mbedtls_sha1_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA224) -const mbedtls_md_info_t mbedtls_sha224_info = { +static const mbedtls_md_info_t mbedtls_sha224_info = { MBEDTLS_MD_SHA224, 28, 64, @@ -109,7 +109,7 @@ const mbedtls_md_info_t mbedtls_sha224_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA256) -const mbedtls_md_info_t mbedtls_sha256_info = { +static const mbedtls_md_info_t mbedtls_sha256_info = { MBEDTLS_MD_SHA256, 32, 64, @@ -117,7 +117,7 @@ const mbedtls_md_info_t mbedtls_sha256_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA384) -const mbedtls_md_info_t mbedtls_sha384_info = { +static const mbedtls_md_info_t mbedtls_sha384_info = { MBEDTLS_MD_SHA384, 48, 128, @@ -125,7 +125,7 @@ const mbedtls_md_info_t mbedtls_sha384_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA512) -const mbedtls_md_info_t mbedtls_sha512_info = { +static const mbedtls_md_info_t mbedtls_sha512_info = { MBEDTLS_MD_SHA512, 64, 128, @@ -133,7 +133,7 @@ const mbedtls_md_info_t mbedtls_sha512_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA3_224) -const mbedtls_md_info_t mbedtls_sha3_224_info = { +static const mbedtls_md_info_t mbedtls_sha3_224_info = { MBEDTLS_MD_SHA3_224, 28, 144, @@ -141,7 +141,7 @@ const mbedtls_md_info_t mbedtls_sha3_224_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA3_256) -const mbedtls_md_info_t mbedtls_sha3_256_info = { +static const mbedtls_md_info_t mbedtls_sha3_256_info = { MBEDTLS_MD_SHA3_256, 32, 136, @@ -149,7 +149,7 @@ const mbedtls_md_info_t mbedtls_sha3_256_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA3_384) -const mbedtls_md_info_t mbedtls_sha3_384_info = { +static const mbedtls_md_info_t mbedtls_sha3_384_info = { MBEDTLS_MD_SHA3_384, 48, 104, @@ -157,7 +157,7 @@ const mbedtls_md_info_t mbedtls_sha3_384_info = { #endif #if defined(MBEDTLS_MD_CAN_SHA3_512) -const mbedtls_md_info_t mbedtls_sha3_512_info = { +static const mbedtls_md_info_t mbedtls_sha3_512_info = { MBEDTLS_MD_SHA3_512, 64, 72, diff --git a/library/md_wrap.h b/library/md_wrap.h index 665ab1c5b6..71b60db76e 100644 --- a/library/md_wrap.h +++ b/library/md_wrap.h @@ -49,34 +49,6 @@ struct mbedtls_md_info_t { unsigned char block_size; }; -#if defined(MBEDTLS_MD5_C) -extern const mbedtls_md_info_t mbedtls_md5_info; -#endif -#if defined(MBEDTLS_RIPEMD160_C) -extern const mbedtls_md_info_t mbedtls_ripemd160_info; -#endif -#if defined(MBEDTLS_SHA1_C) -extern const mbedtls_md_info_t mbedtls_sha1_info; -#endif -#if defined(MBEDTLS_SHA224_C) -extern const mbedtls_md_info_t mbedtls_sha224_info; -#endif -#if defined(MBEDTLS_SHA256_C) -extern const mbedtls_md_info_t mbedtls_sha256_info; -#endif -#if defined(MBEDTLS_SHA384_C) -extern const mbedtls_md_info_t mbedtls_sha384_info; -#endif -#if defined(MBEDTLS_SHA512_C) -extern const mbedtls_md_info_t mbedtls_sha512_info; -#endif -#if defined(MBEDTLS_SHA3_C) -extern const mbedtls_md_info_t mbedtls_sha3_224_info; -extern const mbedtls_md_info_t mbedtls_sha3_256_info; -extern const mbedtls_md_info_t mbedtls_sha3_384_info; -extern const mbedtls_md_info_t mbedtls_sha3_512_info; -#endif - #ifdef __cplusplus } #endif diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 5e38c3ad6e..13b8cb0c3c 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -72,7 +72,6 @@ #include "mbedtls/gcm.h" #include "mbedtls/md5.h" #include "mbedtls/md.h" -#include "md_wrap.h" #include "mbedtls/pk.h" #include "pk_wrap.h" #include "mbedtls/platform_util.h" diff --git a/library/psa_crypto_hash.h b/library/psa_crypto_hash.h index d6bbd3feec..2dfb0115e8 100644 --- a/library/psa_crypto_hash.h +++ b/library/psa_crypto_hash.h @@ -23,8 +23,6 @@ #include -#include "md_wrap.h" - /** Calculate the hash (digest) of a message using Mbed TLS routines. * * \note The signature of this function is that of a PSA driver hash_compute