diff --git a/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h b/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h index 737781a8ca..dd7181815d 100644 --- a/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h +++ b/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h @@ -330,7 +330,7 @@ enum { #include #endif - #if ESP_IDF_VERSION_MAJOR >= 4 + #if ESP_IDF_VERSION_MAJOR == 4 || (ESP_IDF_VERSION_MAJOR == 5 && ESP_IDF_VERSION_MINOR < 4) #include #else #include @@ -375,9 +375,7 @@ enum { #include #endif - #if ESP_IDF_VERSION_MAJOR >= 4 - /* #include */ - #else + #if ESP_IDF_VERSION_MAJOR < 4 #include #endif @@ -411,9 +409,7 @@ enum { #include #endif - #if ESP_IDF_VERSION_MAJOR >= 4 - /* #include */ - #else + #if ESP_IDF_VERSION_MAJOR < 4 #include #endif @@ -447,9 +443,7 @@ enum { #include #endif - #if ESP_IDF_VERSION_MAJOR >= 4 - /* #include */ - #else + #if ESP_IDF_VERSION_MAJOR < 4 #include #endif @@ -719,7 +713,9 @@ extern "C" */ #ifndef NO_AES - #if ESP_IDF_VERSION_MAJOR >= 4 + #if ESP_IDF_VERSION_MAJOR > 5 || (ESP_IDF_VERSION_MAJOR == 5 && ESP_IDF_VERSION_MINOR >= 4) + #include "rom/aes.h" + #elif ESP_IDF_VERSION_MAJOR >= 4 #include "esp32/rom/aes.h" #elif defined(CONFIG_IDF_TARGET_ESP8266) /* no hardware includes for ESP8266*/ @@ -780,7 +776,14 @@ extern "C" #define SHA_CTX ETS_SHAContext - #if ESP_IDF_VERSION_MAJOR >= 4 + #if ESP_IDF_VERSION_MAJOR > 5 || (ESP_IDF_VERSION_MAJOR == 5 && ESP_IDF_VERSION_MINOR >= 4) + #include "rom/sha.h" + #if defined(CONFIG_IDF_TARGET_ESP32) + #define WC_ESP_SHA_TYPE enum SHA_TYPE + #else + #define WC_ESP_SHA_TYPE SHA_TYPE + #endif + #elif ESP_IDF_VERSION_MAJOR >= 4 #if defined(CONFIG_IDF_TARGET_ESP32) #include "esp32/rom/sha.h" #define WC_ESP_SHA_TYPE enum SHA_TYPE