diff --git a/esp_encrypted_img/test/test.c b/esp_encrypted_img/test/test.c index 208ca10..f8224d6 100644 --- a/esp_encrypted_img/test/test.c +++ b/esp_encrypted_img/test/test.c @@ -7,7 +7,11 @@ #include #include "unity.h" -#include "esp_random.h" +#if __has_include("esp_random.h") + #include "esp_random.h" +#else + #include "esp_system.h" +#endif #include "esp_encrypted_img.h" extern const uint8_t rsa_private_pem_start[] asm("_binary_test_rsa_private_key_pem_start"); diff --git a/libsodium/port/randombytes_esp32.c b/libsodium/port/randombytes_esp32.c index b47dfba..6f57437 100644 --- a/libsodium/port/randombytes_esp32.c +++ b/libsodium/port/randombytes_esp32.c @@ -4,7 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ #include "sdkconfig.h" -#include "esp_random.h" +#if __has_include("esp_random.h") + #include "esp_random.h" +#else + #include "esp_system.h" +#endif #include "randombytes_internal.h" static const char *randombytes_esp32xx_implementation_name(void)