diff --git a/include/mbedtls/entropy.h b/include/mbedtls/entropy.h index 20fd6872b8..6c64e3e4e1 100644 --- a/include/mbedtls/entropy.h +++ b/include/mbedtls/entropy.h @@ -17,12 +17,13 @@ #include "md.h" -#if defined(MBEDTLS_MD_CAN_SHA512) && !defined(MBEDTLS_ENTROPY_FORCE_SHA256) +#if (defined(MBEDTLS_MD_CAN_SHA512) || defined(PSA_WANT_ALG_SHA_512)) && \ + !defined(MBEDTLS_ENTROPY_FORCE_SHA256) #define MBEDTLS_ENTROPY_SHA512_ACCUMULATOR #define MBEDTLS_ENTROPY_MD MBEDTLS_MD_SHA512 #define MBEDTLS_ENTROPY_BLOCK_SIZE 64 /**< Block size of entropy accumulator (SHA-512) */ #else -#if defined(MBEDTLS_MD_CAN_SHA256) +#if (defined(MBEDTLS_MD_CAN_SHA256) || defined(PSA_WANT_ALG_SHA_256)) #define MBEDTLS_ENTROPY_SHA256_ACCUMULATOR #define MBEDTLS_ENTROPY_MD MBEDTLS_MD_SHA256 #define MBEDTLS_ENTROPY_BLOCK_SIZE 32 /**< Block size of entropy accumulator (SHA-256) */ diff --git a/tests/include/test/psa_crypto_helpers.h b/tests/include/test/psa_crypto_helpers.h index 195f871d43..bf0707d429 100644 --- a/tests/include/test/psa_crypto_helpers.h +++ b/tests/include/test/psa_crypto_helpers.h @@ -471,7 +471,7 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string); /* A couple of helper macros to verify if MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE is * large enough to contain an RSA key pair of the given size. This is meant to be * used in test cases where MBEDTLS_PSA_STATIC_KEY_SLOTS is enabled. */ -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) +#if defined(MBEDTLS_PSA_CRYPTO_C) #if (MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE >= PSA_KEY_EXPORT_RSA_KEY_PAIR_MAX_SIZE(4096)) #define MBEDTLS_TEST_STATIC_KEY_SLOTS_SUPPORT_RSA_4096 @@ -481,7 +481,7 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string); #define MBEDTLS_TEST_STATIC_KEY_SLOTS_SUPPORT_RSA_2048 #endif -#endif /* MBEDTLS_PSA_CRYPTO_CLIENT */ +#endif /* MBEDTLS_PSA_CRYPTO_C */ /* Helper macro to get the size of the each key slot buffer. */ #if defined(MBEDTLS_PSA_STATIC_KEY_SLOTS)