From e1cd5b909e61214df029a80692e937bb9c3cc11a Mon Sep 17 00:00:00 2001 From: "harshal.patil" Date: Wed, 4 Sep 2024 13:22:07 +0530 Subject: [PATCH] fix(esp_security): Fix build failure when dpa protection at startup is disabled --- components/esp_security/src/esp_dpa_protection.c | 2 ++ components/esp_security/src/esp_security_priv.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/components/esp_security/src/esp_dpa_protection.c b/components/esp_security/src/esp_dpa_protection.c index 19e9435373..f9f5e19714 100644 --- a/components/esp_security/src/esp_dpa_protection.c +++ b/components/esp_security/src/esp_dpa_protection.c @@ -16,10 +16,12 @@ static inline void esp_crypto_dpa_set_level(esp_crypto_dpa_sec_level_t level) REG_SET_FIELD(HP_SYSTEM_SEC_DPA_CONF_REG, HP_SYSTEM_SEC_DPA_LEVEL, level); } +#if CONFIG_ESP_CRYPTO_DPA_PROTECTION_AT_STARTUP void esp_crypto_dpa_protection_startup(void) { esp_crypto_dpa_set_level(CONFIG_ESP_CRYPTO_DPA_PROTECTION_LEVEL); } +#endif void esp_crypto_dpa_protection_enable(esp_crypto_dpa_sec_level_t level) { diff --git a/components/esp_security/src/esp_security_priv.h b/components/esp_security/src/esp_security_priv.h index 18cba2c90f..f17d6c4e4d 100644 --- a/components/esp_security/src/esp_security_priv.h +++ b/components/esp_security/src/esp_security_priv.h @@ -5,7 +5,10 @@ */ #pragma once +#include "sdkconfig.h" /* Private interface file */ +#if CONFIG_ESP_CRYPTO_DPA_PROTECTION_AT_STARTUP void esp_crypto_dpa_protection_startup(void); +#endif