From 243417c48c1c9a96429aab5ef12626b7fc7883f2 Mon Sep 17 00:00:00 2001 From: ChenJianxing Date: Thu, 28 Jan 2021 20:29:22 +0800 Subject: [PATCH] temporarily disable hardware encryption for esp32s3 --- components/mbedtls/Kconfig | 3 +++ components/mbedtls/test/test_mbedtls_mpi.c | 3 ++- .../bluedroid/ble/blufi/sdkconfig.defaults.esp32s3 | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/mbedtls/Kconfig b/components/mbedtls/Kconfig index be7ebb1612..2dd4e6d82f 100644 --- a/components/mbedtls/Kconfig +++ b/components/mbedtls/Kconfig @@ -222,6 +222,7 @@ menu "mbedTLS" config MBEDTLS_HARDWARE_AES bool "Enable hardware AES acceleration" + default n if IDF_TARGET_ESP32S3 default y depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST help @@ -254,6 +255,7 @@ menu "mbedTLS" config MBEDTLS_HARDWARE_MPI bool "Enable hardware MPI (bignum) acceleration" + default n if IDF_TARGET_ESP32S3 default y depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST help @@ -266,6 +268,7 @@ menu "mbedTLS" config MBEDTLS_HARDWARE_SHA bool "Enable hardware SHA acceleration" + default n if IDF_TARGET_ESP32S3 default y depends on !SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST help diff --git a/components/mbedtls/test/test_mbedtls_mpi.c b/components/mbedtls/test/test_mbedtls_mpi.c index 7b2e8ae702..44d067a225 100644 --- a/components/mbedtls/test/test_mbedtls_mpi.c +++ b/components/mbedtls/test/test_mbedtls_mpi.c @@ -37,7 +37,7 @@ void mbedtls_mpi_printf(const char *name, const mbedtls_mpi *X) */ static void test_bignum_mult_variant(const char *a_str, const char *b_str, const char *e_str, size_t mod_bits, int res_operands_overlap) { - mbedtls_mpi A, B, X, E, M; + mbedtls_mpi A, B, X, E; char x_buf[2048] = {0}; size_t x_buf_len = 0; @@ -65,6 +65,7 @@ static void test_bignum_mult_variant(const char *a_str, const char *b_str, const TEST_ASSERT_EQUAL_STRING_MESSAGE(e_str, x_buf, "mbedtls_mpi_mul_mpi result wrong"); #ifdef CONFIG_MBEDTLS_HARDWARE_MPI + mbedtls_mpi M; /* if mod_bits arg is set, also do a esp_mpi_mul_mod() call */ if (mod_bits > 0 && mod_bits <= SOC_RSA_MAX_BIT_LEN) { mbedtls_mpi_init(&M); diff --git a/examples/bluetooth/bluedroid/ble/blufi/sdkconfig.defaults.esp32s3 b/examples/bluetooth/bluedroid/ble/blufi/sdkconfig.defaults.esp32s3 index 6e656764d3..89d79b1c0f 100644 --- a/examples/bluetooth/bluedroid/ble/blufi/sdkconfig.defaults.esp32s3 +++ b/examples/bluetooth/bluedroid/ble/blufi/sdkconfig.defaults.esp32s3 @@ -880,9 +880,9 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set # CONFIG_MBEDTLS_CMAC_C is not set -CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_HARDWARE_MPI=y -CONFIG_MBEDTLS_HARDWARE_SHA=y +# CONFIG_MBEDTLS_HARDWARE_AES is not set +# CONFIG_MBEDTLS_HARDWARE_MPI is not set +# CONFIG_MBEDTLS_HARDWARE_SHA is not set # CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set # CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set CONFIG_MBEDTLS_HAVE_TIME=y