diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index b897c05c34..f15fd33ed8 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -119,10 +119,6 @@ if(NOT BOOTLOADER_BUILD) list(APPEND srcs "esp_etm.c") endif() - if(CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED) - list(APPEND srcs "esp_dpa_protection.c") - endif() - if(CONFIG_SOC_DIG_SIGN_SUPPORTED) list(APPEND srcs "esp_ds.c") endif() diff --git a/components/esp_security/CMakeLists.txt b/components/esp_security/CMakeLists.txt index 59bd2ea3ee..62b15c11fb 100644 --- a/components/esp_security/CMakeLists.txt +++ b/components/esp_security/CMakeLists.txt @@ -6,9 +6,19 @@ if(NOT BOOTLOADER_BUILD) list(APPEND srcs "src/crypto/${IDF_TARGET}/clk.c") endif() + if(CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED) + list(APPEND srcs "src/crypto/esp_dpa_protection.c") + endif() + list(APPEND priv_requires "soc") endif() idf_component_register(SRCS ${srcs} INCLUDE_DIRS "include" PRIV_REQUIRES ${priv_requires}) + +if(NOT BOOTLOADER_BUILD) + if(CONFIG_SOC_CRYPTO_DPA_PROTECTION_SUPPORTED) + target_link_libraries(${COMPONENT_LIB} PRIVATE "-u esp_crypto_dpa_prot_include_impl") + endif() +endif() diff --git a/components/esp_hw_support/include/esp_dpa_protection.h b/components/esp_security/include/esp_dpa_protection.h similarity index 100% rename from components/esp_hw_support/include/esp_dpa_protection.h rename to components/esp_security/include/esp_dpa_protection.h diff --git a/components/esp_hw_support/esp_dpa_protection.c b/components/esp_security/src/crypto/esp_dpa_protection.c similarity index 100% rename from components/esp_hw_support/esp_dpa_protection.c rename to components/esp_security/src/crypto/esp_dpa_protection.c