modules: mbedTLS: Add Kconfig options for hashing

Add explicit Kconfig options to enable SHA support on mbedTLS.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2022-02-15 14:01:31 -08:00 committed by Anas Nashif
commit 26d7a929d4
2 changed files with 19 additions and 2 deletions

View file

@ -183,6 +183,21 @@ config MBEDTLS_ECP_NIST_OPTIM
endif
comment "Supported hash"
config MBEDTLS_HASH_ALL_ENABLED
bool "Enable all available hashes"
select MBEDTLS_HASH_SHA256_ENABLED
select MBEDTLS_HASH_SHA512_ENABLED
config MBEDTLS_HASH_SHA256_ENABLED
bool "Enable SHA256 hash"
default y
config MBEDTLS_HASH_SHA512_ENABLED
bool "Enable SHA512 hash"
default y
comment "Supported cipher modes"
config MBEDTLS_CIPHER_ALL_ENABLED

View file

@ -244,7 +244,8 @@
#define MBEDTLS_SHA1_C
#endif
#if defined(CONFIG_MBEDTLS_MAC_SHA256_ENABLED)
#if defined(CONFIG_MBEDTLS_MAC_SHA256_ENABLED) || \
defined(CONFIG_MBEDTLS_HASH_SHA256_ENABLED)
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA256_C
#endif
@ -253,7 +254,8 @@
#define MBEDTLS_SHA256_SMALLER
#endif
#if defined(CONFIG_MBEDTLS_MAC_SHA512_ENABLED)
#if defined(CONFIG_MBEDTLS_MAC_SHA512_ENABLED) || \
defined(CONFIG_MBEDTLS_HASH_SHA512_ENABLED)
#define MBEDTLS_SHA512_C
#endif