esp_dpa_protection.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. typedef enum {
  11. ESP_CRYPTO_DPA_SEC_LEVEL_OFF = 0, /*!< DPA protection disabled */
  12. ESP_CRYPTO_DPA_SEC_LEVEL_LOW, /*!< DPA protection level low */
  13. ESP_CRYPTO_DPA_SEC_LEVEL_MIDDLE, /*!< DPA protection level medium */
  14. ESP_CRYPTO_DPA_SEC_LEVEL_HIGH, /*!< DPA protection level high */
  15. } esp_crypto_dpa_sec_level_t;
  16. /**
  17. * @brief Enable DPA (Differential Power Analysis) related protection
  18. *
  19. * @note
  20. * Enabling the DPA protection can help to make it difficult to perform SCA
  21. * attacks on the crypto peripherals. However, based on the security level
  22. * set there will be a performance impact, higher the level higher the impact.
  23. * Please refer to the TRM for more details.
  24. *
  25. * @param level DPA Security Level of type `esp_crypto_dpa_sec_level_t`
  26. */
  27. void esp_crypto_dpa_protection_enable(esp_crypto_dpa_sec_level_t level);
  28. /**
  29. * @brief Disable DPA (Differential Power Analysis) related protection
  30. */
  31. void esp_crypto_dpa_protection_disable(void);
  32. #ifdef __cplusplus
  33. }
  34. #endif