diff --git a/components/esp_security/CMakeLists.txt b/components/esp_security/CMakeLists.txt index 8561cf9244..af523cc28a 100644 --- a/components/esp_security/CMakeLists.txt +++ b/components/esp_security/CMakeLists.txt @@ -31,6 +31,10 @@ if(NOT non_os_build) list(APPEND srcs "src/esp_crypto_lock.c" "src/esp_crypto_periph_clk.c") list(APPEND priv_requires efuse esp_hw_support esp_system esp_timer) +elseif(esp_tee_build) + list(APPEND srcs "src/esp_crypto_periph_clk.c") + list(APPEND includes "src/${IDF_TARGET}") + list(APPEND priv_requires esp_hw_support) endif() idf_component_register(SRCS ${srcs} diff --git a/components/esp_tee/scripts/esp32c6/sec_srv_tbl_default.yml b/components/esp_tee/scripts/esp32c6/sec_srv_tbl_default.yml index a9bd42c37f..e567aca201 100644 --- a/components/esp_tee/scripts/esp32c6/sec_srv_tbl_default.yml +++ b/components/esp_tee/scripts/esp32c6/sec_srv_tbl_default.yml @@ -208,9 +208,9 @@ secure_services: type: IDF function: esp_sha_write_digest_state args: 2 - - id: 132 + - id: 98 type: IDF - function: esp_sha_enable_periph_clk + function: esp_crypto_sha_enable_periph_clk args: 1 # ID: 134-149 (16) - eFuse - family: efuse diff --git a/components/esp_tee/src/esp_secure_service_wrapper.c b/components/esp_tee/src/esp_secure_service_wrapper.c index 692bceb92c..70250d91d0 100644 --- a/components/esp_tee/src/esp_secure_service_wrapper.c +++ b/components/esp_tee/src/esp_secure_service_wrapper.c @@ -228,9 +228,9 @@ void __wrap_esp_sha_write_digest_state(esp_sha_type sha_type, void *digest_state esp_tee_service_call(3, SS_ESP_SHA_WRITE_DIGEST_STATE, sha_type, digest_state); } -void __wrap_esp_sha_enable_periph_clk(bool enable) +void __wrap_esp_crypto_sha_enable_periph_clk(bool enable) { - esp_tee_service_call(2, SS_ESP_SHA_ENABLE_PERIPH_CLK, enable); + esp_tee_service_call(2, SS_ESP_CRYPTO_SHA_ENABLE_PERIPH_CLK, enable); } /* ---------------------------------------------- MMU HAL ------------------------------------------------- */ diff --git a/components/esp_tee/subproject/main/core/esp_secure_services.c b/components/esp_tee/subproject/main/core/esp_secure_services.c index 989fc6afcf..05e9aee0b0 100644 --- a/components/esp_tee/subproject/main/core/esp_secure_services.c +++ b/components/esp_tee/subproject/main/core/esp_secure_services.c @@ -26,7 +26,7 @@ #include "soc/soc_caps.h" #include "aes/esp_aes.h" #include "sha/sha_core.h" -#include "esp_sha_internal.h" +#include "esp_crypto_periph_clk.h" #include "esp_tee.h" #include "esp_tee_memory_utils.h" @@ -326,9 +326,9 @@ void _ss_esp_sha_block(esp_sha_type sha_type, const void *data_block, bool is_fi esp_sha_block(sha_type, data_block, is_first_block); } -void _ss_esp_sha_enable_periph_clk(bool enable) +void _ss_esp_crypto_sha_enable_periph_clk(bool enable) { - esp_sha_enable_periph_clk(enable); + esp_crypto_sha_enable_periph_clk(enable); } /* ---------------------------------------------- OTA ------------------------------------------------- */ diff --git a/components/mbedtls/esp_tee/esp_tee_mbedtls.cmake b/components/mbedtls/esp_tee/esp_tee_mbedtls.cmake index be6d1b4597..9a86363c09 100644 --- a/components/mbedtls/esp_tee/esp_tee_mbedtls.cmake +++ b/components/mbedtls/esp_tee/esp_tee_mbedtls.cmake @@ -40,6 +40,8 @@ endforeach() target_link_libraries(${COMPONENT_LIB} INTERFACE ${mbedtls_targets}) +target_link_libraries(mbedcrypto PRIVATE idf::esp_security) + target_include_directories(mbedcrypto PRIVATE ${crypto_port_inc_dirs}) # Shared GDMA layer for TEE