diff --git a/components/esp_hw_support/include/soc/esp32c2/esp_crypto_lock.h b/components/esp_hw_support/include/soc/esp32c2/esp_crypto_lock.h index 1109610f37..0b39af1654 100644 --- a/components/esp_hw_support/include/soc/esp32c2/esp_crypto_lock.h +++ b/components/esp_hw_support/include/soc/esp32c2/esp_crypto_lock.h @@ -10,58 +10,9 @@ extern "C" { #endif -/** - * @brief Acquire lock for HMAC cryptography peripheral - * - * Internally also locks the SHA peripheral, as the HMAC depends on the SHA peripheral - */ -void esp_crypto_hmac_lock_acquire(void); - -/** - * @brief Release lock for HMAC cryptography peripheral - * - * Internally also releases the SHA peripheral, as the HMAC depends on the SHA peripheral - */ -void esp_crypto_hmac_lock_release(void); - -/** - * @brief Acquire lock for DS cryptography peripheral - * - * Internally also locks the HMAC (which locks SHA), AES and MPI peripheral, as the DS depends on these peripherals - */ -void esp_crypto_ds_lock_acquire(void); - -/** - * @brief Release lock for DS cryptography peripheral - * - * Internally also releases the HMAC (which locks SHA), AES and MPI peripheral, as the DS depends on these peripherals - */ -void esp_crypto_ds_lock_release(void); - -/** - * @brief Acquire lock for the SHA and AES cryptography peripheral. - * - */ -void esp_crypto_sha_aes_lock_acquire(void); - -/** - * @brief Release lock for the SHA and AES cryptography peripheral. - * - */ -void esp_crypto_sha_aes_lock_release(void); - - -/** - * @brief Acquire lock for the mpi cryptography peripheral. - * - */ -void esp_crypto_mpi_lock_acquire(void); - -/** - * @brief Release lock for the mpi/rsa cryptography peripheral. - * - */ -void esp_crypto_mpi_lock_release(void); +// Place-holder lock APIs as hardware AES is not supported in ESP32-C2 +static inline void esp_crypto_sha_aes_lock_acquire(void) {} +static inline void esp_crypto_sha_aes_lock_release(void) {} #ifdef __cplusplus } diff --git a/components/esp_hw_support/port/esp32c2/CMakeLists.txt b/components/esp_hw_support/port/esp32c2/CMakeLists.txt index 6e60b18e0b..f12789ce36 100644 --- a/components/esp_hw_support/port/esp32c2/CMakeLists.txt +++ b/components/esp_hw_support/port/esp32c2/CMakeLists.txt @@ -10,7 +10,6 @@ set(srcs "cpu_util_esp32c2.c" if(NOT BOOTLOADER_BUILD) list(APPEND srcs "../async_memcpy_impl_gdma.c" - "esp_crypto_lock.c" "dport_access.c") endif() diff --git a/components/esp_hw_support/port/esp32c2/esp_crypto_lock.c b/components/esp_hw_support/port/esp32c2/esp_crypto_lock.c deleted file mode 100644 index 33a9e33618..0000000000 --- a/components/esp_hw_support/port/esp32c2/esp_crypto_lock.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include "esp_crypto_lock.h" - -/* Lock overview: -SHA: peripheral independent, but DMA is shared with AES -AES: peripheral independent, but DMA is shared with SHA -MPI/RSA: independent -HMAC: needs SHA -DS: needs HMAC (which needs SHA), AES and MPI -*/ - -#if 0 // TODO: IDF-4229 -/* Lock for DS peripheral */ -static _lock_t s_crypto_ds_lock; - -/* Lock for HMAC peripheral */ -static _lock_t s_crypto_hmac_lock; - -/* Lock for the MPI/RSA peripheral, also used by the DS peripheral */ -static _lock_t s_crypto_mpi_lock; - -/* Single lock for SHA and AES, sharing a reserved GDMA channel */ -static _lock_t s_crypto_sha_aes_lock; -#endif - -void esp_crypto_hmac_lock_acquire(void) -{ - abort(); // TODO: IDF-4229 -} - -void esp_crypto_hmac_lock_release(void) -{ - abort(); // TODO: IDF-4229 -} - -void esp_crypto_ds_lock_acquire(void) -{ - abort(); // TODO: IDF-4229 -} - -void esp_crypto_ds_lock_release(void) -{ - abort(); // TODO: IDF-4229 -} - -void esp_crypto_sha_aes_lock_acquire(void) -{ - abort(); // TODO: IDF-4229 -} - -void esp_crypto_sha_aes_lock_release(void) -{ - abort(); // TODO: IDF-4229 -} - -void esp_crypto_mpi_lock_acquire(void) -{ - abort(); // TODO: IDF-4229 -} - -void esp_crypto_mpi_lock_release(void) -{ - abort(); // TODO: IDF-4229 -} diff --git a/components/mbedtls/port/esp_ds/esp_rsa_sign_alt.c b/components/mbedtls/port/esp_ds/esp_rsa_sign_alt.c index 0bf520fe7c..a6f9f0cde1 100644 --- a/components/mbedtls/port/esp_ds/esp_rsa_sign_alt.c +++ b/components/mbedtls/port/esp_ds/esp_rsa_sign_alt.c @@ -15,8 +15,6 @@ #include "esp32h2/rom/digital_signature.h" #elif CONFIG_IDF_TARGET_ESP32S3 #include "esp32s3/rom/digital_signature.h" -#elif CONFIG_IDF_TARGET_ESP32C2 -#include "esp32c2/rom/digital_signature.h" #else #error "Selected target does not support esp_rsa_sign_alt (for DS)" #endif