diff --git a/examples/platforms/nrf52840/openthread-core-nrf52840-config.h b/examples/platforms/nrf52840/openthread-core-nrf52840-config.h index 7e0cde4da..93080d704 100644 --- a/examples/platforms/nrf52840/openthread-core-nrf52840-config.h +++ b/examples/platforms/nrf52840/openthread-core-nrf52840-config.h @@ -256,21 +256,6 @@ #define OPENTHREAD_CONFIG_HEADER_IE_SUPPORT 1 #endif -/** - * @def NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT - * - * Define as 1 to enable AES usage in interrupt context and AES-256, by introducing a software AES under platform layer. - * - * @note This feature must be enabled to support AES-256 used by Commissioner and Joiner, and AES usage in interrupt context - * used by Header IE related features. - * - */ -#if OPENTHREAD_ENABLE_COMMISSIONER || OPENTHREAD_ENABLE_JOINER || OPENTHREAD_CONFIG_HEADER_IE_SUPPORT -#define NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT 1 -#else -#define NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT 0 -#endif - /* * Suppress the ARMCC warning on unreachable statement, * e.g. break after assert(false) or ExitNow() macro. diff --git a/third_party/NordicSemiconductor/libraries/crypto/aes_alt.h b/third_party/NordicSemiconductor/libraries/crypto/aes_alt.h index 3047a5e01..0f9e0731a 100644 --- a/third_party/NordicSemiconductor/libraries/crypto/aes_alt.h +++ b/third_party/NordicSemiconductor/libraries/crypto/aes_alt.h @@ -51,8 +51,6 @@ #include MBEDTLS_CONFIG_FILE #endif -#include - #include #include diff --git a/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h b/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h index 92a0a3e22..c9fa0d8fb 100644 --- a/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h +++ b/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h @@ -29,6 +29,8 @@ #ifndef NRF52840_MBEDTLS_CONFIG_H_ #define NRF52840_MBEDTLS_CONFIG_H_ +#include + #ifndef DISABLE_CC310 #define MBEDTLS_AES_ALT #define MBEDTLS_ECP_ALT @@ -49,4 +51,19 @@ _Pragma("diag_suppress=68") #endif +/** + * @def NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT + * + * Define as 1 to enable AES usage in interrupt context and AES-256, by introducing a software AES under platform layer. + * + * @note This feature must be enabled to support AES-256 used by Commissioner and Joiner, and AES usage in interrupt context + * used by Header IE related features. + * + */ +#if OPENTHREAD_ENABLE_COMMISSIONER || OPENTHREAD_ENABLE_JOINER || OPENTHREAD_CONFIG_HEADER_IE_SUPPORT +#define NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT 1 +#else +#define NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT 0 +#endif + #endif // NRF52840_MBEDTLS_CONFIG_H_