diff --git a/IDE/Espressif/ESP-IDF/README_32se.md b/IDE/Espressif/ESP-IDF/README_32se.md index cb5171fcca..af440a8b5a 100644 --- a/IDE/Espressif/ESP-IDF/README_32se.md +++ b/IDE/Espressif/ESP-IDF/README_32se.md @@ -15,7 +15,7 @@ Including the following examples: 2. Microchip CryptoAuthentication Library: https://github.com/MicrochipTech/cryptoauthlib ## Setup -1. Comment out `#define WOLFSSL_ESPWROOM32` in `/path/to/wolfssl/IDE/Espressif/ESP-IDF/user_settings.h`\ +1. Comment out `#define WOLFSSL_ESP32` in `/path/to/wolfssl/IDE/Espressif/ESP-IDF/user_settings.h`\ Uncomment out `#define WOLFSSL_ESPWROOM32SE` in `/path/to/wolfssl/IDE/Espressif/ESP-IDF/user_settings.h` * **Note:** crypt test will fail if enabled `WOLFSSL_ESPWROOM32SE` 3. wolfSSL under ESP-IDF. Please see [README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md) diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/components/wolfssl/include/user_settings.h b/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/components/wolfssl/include/user_settings.h index 23ad56a151..1e8c71e527 100644 --- a/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/components/wolfssl/include/user_settings.h +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/components/wolfssl/include/user_settings.h @@ -22,9 +22,9 @@ #include /* essential to chip set detection */ #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -44,12 +44,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* optionally turn off SHA512/224 SHA512/256 */ /* #define WOLFSSL_NOSHA512_224 */ @@ -116,7 +116,7 @@ #endif /* rsa primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -128,7 +128,7 @@ /* debug options */ /* #define DEBUG_WOLFSSL */ -/* #define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG */ +/* #define WOLFSSL_ESP32_CRYPT_DEBUG */ /* #define WOLFSSL_ATECC508A_DEBUG */ /* date/time */ @@ -151,7 +151,7 @@ #define WOLFSSL_SMALL_STACK -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time */ #define NO_AES_192 #endif @@ -208,40 +208,40 @@ /* Default is HW enabled unless turned off. ** Uncomment these lines for SW: */ #if defined(CONFIG_IDF_TARGET_ESP32) - /* #define NO_ESP32WROOM32_CRYPT */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */ + /* #define NO_ESP32_CRYPT */ + /* #define NO_WOLFSSL_ESP32_CRYPT_HASH */ + /* #define NO_WOLFSSL_ESP32_CRYPT_AES */ + /* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI */ #elif defined(CONFIG_IDF_TARGET_ESP32S2) - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #elif defined(CONFIG_IDF_TARGET_ESP32S3) - /* #define NO_ESP32WROOM32_CRYPT */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */ + /* #define NO_ESP32_CRYPT */ + /* #define NO_WOLFSSL_ESP32_CRYPT_HASH */ + /* #define NO_WOLFSSL_ESP32_CRYPT_AES */ + /* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI */ #elif defined(CONFIG_IDF_TARGET_ESP32C3) - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #elif defined(CONFIG_IDF_TARGET_ESP32C6) - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #elif defined(CONFIG_IDF_TARGET_ESP32H2) - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #else - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #endif /* debug options */ @@ -249,22 +249,22 @@ #define WOLFSSL_HW_METRICS /* #define DEBUG_WOLFSSL_VERBOSE */ /* #define DEBUG_WOLFSSL */ -/* #define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG */ +/* #define WOLFSSL_ESP32_CRYPT_DEBUG */ #define NO_RECOVER_SOFTWARE_CALC /* optionally turn off individual math HW acceleration features */ /* Turn off Large Number Multiplication: ** [Z = X * Y] in esp_mp_mul() */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL */ +/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL */ /* Turn off Large Number Modular Exponentiation: ** [Z = X^Y mod M] in esp_mp_exptmod() */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD */ +/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD */ /* Turn off Large Number Modular Multiplication ** [Z = X × Y mod M] in esp_mp_mulmod() */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD */ +/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD */ /* this is known to fail in TFM: */ diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_client/wolfssl/include/user_settings.h b/IDE/Espressif/ESP-IDF/examples/wolfssl_client/wolfssl/include/user_settings.h index 36ad26fa17..1932845cdc 100644 --- a/IDE/Espressif/ESP-IDF/examples/wolfssl_client/wolfssl/include/user_settings.h +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_client/wolfssl/include/user_settings.h @@ -19,9 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -40,12 +40,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* #define DEBUG_WOLFSSL_VERBOSE */ @@ -97,7 +97,7 @@ #endif /* RSA primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -109,7 +109,7 @@ /* debug options */ /* #define DEBUG_WOLFSSL */ -/* #define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG */ +/* #define WOLFSSL_ESP32_CRYPT_DEBUG */ /* #define WOLFSSL_ATECC508A_DEBUG */ /* date/time */ @@ -119,15 +119,15 @@ /* #define XTIME time */ /* when you want not to use HW acceleration */ -/* #define NO_ESP32WROOM32_CRYPT */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH*/ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */ +/* #define NO_ESP32_CRYPT */ +/* #define NO_WOLFSSL_ESP32_CRYPT_HASH*/ +/* #define NO_WOLFSSL_ESP32_CRYPT_AES */ +/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI */ /* adjust wait-timeout count if you see timeout in RSA HW acceleration */ #define ESP_RSA_TIMEOUT_CNT 0x249F00 -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time */ #define NO_AES_192 #endif diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_server/components/wolfssl/include/user_settings.h b/IDE/Espressif/ESP-IDF/examples/wolfssl_server/components/wolfssl/include/user_settings.h index fdf79894cc..1daf0fdb5d 100644 --- a/IDE/Espressif/ESP-IDF/examples/wolfssl_server/components/wolfssl/include/user_settings.h +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_server/components/wolfssl/include/user_settings.h @@ -20,9 +20,9 @@ */ #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -41,12 +41,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* #define WOLFSSL_NOSHA512_224 */ /* #define WOLFSSL_NOSHA512_256 */ @@ -108,7 +108,7 @@ #endif /* rsa primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -120,7 +120,7 @@ /* debug options */ // #define DEBUG_WOLFSSL -#define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +#define WOLFSSL_ESP32_CRYPT_DEBUG /* #define WOLFSSL_ATECC508A_DEBUG */ /* date/time */ @@ -130,10 +130,10 @@ /* #define XTIME time */ /* when you want not to use HW acceleration */ -#define NO_ESP32WROOM32_CRYPT -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI +#define NO_ESP32_CRYPT +#define NO_WOLFSSL_ESP32_CRYPT_HASH +#define NO_WOLFSSL_ESP32_CRYPT_AES +#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI /* adjust wait-timeout count if you see timeout in RSA HW acceleration */ #define ESP_RSA_TIMEOUT_CNT 0x249F00 @@ -145,7 +145,7 @@ #define USE_FAST_MATH #define WOLFSSL_SMALL_STACK -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time */ #define NO_AES_192 #endif diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl/include/user_settings.h b/IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl/include/user_settings.h index 565814c3bb..1d854a0afd 100644 --- a/IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl/include/user_settings.h +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_test/components/wolfssl/include/user_settings.h @@ -21,9 +21,9 @@ #include "sdkconfig.h" #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -43,12 +43,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* #define WOLFSSL_NOSHA512_224 */ /* #define WOLFSSL_NOSHA512_256 */ @@ -112,7 +112,7 @@ #endif /* rsa primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -138,11 +138,11 @@ /* #define HASH_SIZE_LIMIT */ /* for test.c */ #define USE_FAST_MATH -// #define SP_MATH +#define SP_MATH #define WOLFSSL_SMALL_STACK -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time */ #define NO_AES_192 #endif @@ -194,40 +194,40 @@ ** Uncomment these lines for SW: */ #if defined(CONFIG_IDF_TARGET_ESP32) - /* #define NO_ESP32WROOM32_CRYPT */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */ + /* #define NO_ESP32_CRYPT */ + /* #define NO_WOLFSSL_ESP32_CRYPT_HASH */ + /* #define NO_WOLFSSL_ESP32_CRYPT_AES */ + /* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI */ #elif defined(CONFIG_IDF_TARGET_ESP32S2) - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #elif defined(CONFIG_IDF_TARGET_ESP32S3) - /* #define NO_ESP32WROOM32_CRYPT */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES */ - /* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */ + /* #define NO_ESP32_CRYPT */ + /* #define NO_WOLFSSL_ESP32_CRYPT_HASH */ + /* #define NO_WOLFSSL_ESP32_CRYPT_AES */ + /* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI */ #elif defined(CONFIG_IDF_TARGET_ESP32C3) - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #elif defined(CONFIG_IDF_TARGET_ESP32C6) - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #elif defined(CONFIG_IDF_TARGET_ESP32H2) - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #else - #define NO_ESP32WROOM32_CRYPT - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES - #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + #define NO_ESP32_CRYPT + #define NO_WOLFSSL_ESP32_CRYPT_HASH + #define NO_WOLFSSL_ESP32_CRYPT_AES + #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI #endif /* debug options */ @@ -235,22 +235,22 @@ #define WOLFSSL_HW_METRICS //#define DEBUG_WOLFSSL_VERBOSE //#define DEBUG_WOLFSSL -//#define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +//#define WOLFSSL_ESP32_CRYPT_DEBUG #define NO_RECOVER_SOFTWARE_CALC /* optionally turn off individual math HW acceleration features */ /* Turn off Large Number Multiplication: ** [Z = X * Y] in esp_mp_mul() */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL */ +/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL */ /* Turn off Large Number Modular Exponentiation: ** [Z = X^Y mod M] in esp_mp_exptmod() */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD */ +/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD */ /* Turn off Large Number Modular Multiplication ** [Z = X × Y mod M] in esp_mp_mulmod() */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD */ +/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD */ // #define HONOR_MATH_USED_LENGTH /* this is known to fail in TFM */ diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/main.c b/IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/main.c index 0d6cb3e480..79ab03f851 100644 --- a/IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/main.c +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_test/main/main.c @@ -175,17 +175,17 @@ void app_main(void) ESP_LOGI(TAG, "Stack HWM: %d\n", uxTaskGetStackHighWaterMark(NULL)); /* check to see if we are using hardware encryption */ -#if defined(NO_ESP32WROOM32_CRYPT) - ESP_LOGI(TAG, "NO_ESP32WROOM32_CRYPT defined! HW acceleration DISABLED."); +#if defined(NO_ESP32_CRYPT) + ESP_LOGI(TAG, "NO_ESP32_CRYPT defined! HW acceleration DISABLED."); #else #if defined(CONFIG_IDF_TARGET_ESP32C3) #elif defined(CONFIG_IDF_TARGET_ESP32S2) #elif defined(CONFIG_IDF_TARGET_ESP32S3) - /* #error "ESP32WROOM32_CRYPT not yet supported on ESP32-S3" */ - ESP_LOGI(TAG, "ESP32WROOM32_CRYPT is enabled for ESP32-S3."); + /* #error "ESP32_CRYPT not yet supported on ESP32-S3" */ + ESP_LOGI(TAG, "ESP32_CRYPT is enabled for ESP32-S3."); #else - ESP_LOGI(TAG, "ESP32WROOM32_CRYPT is enabled."); + ESP_LOGI(TAG, "ESP32_CRYPT is enabled."); #endif #endif diff --git a/IDE/Espressif/ESP-IDF/examples/wolfssl_test_idf/main/main.c b/IDE/Espressif/ESP-IDF/examples/wolfssl_test_idf/main/main.c index 01538f72e3..5d3844206e 100644 --- a/IDE/Espressif/ESP-IDF/examples/wolfssl_test_idf/main/main.c +++ b/IDE/Espressif/ESP-IDF/examples/wolfssl_test_idf/main/main.c @@ -170,17 +170,17 @@ void app_main(void) ESP_LOGI(TAG, "Stack HWM: %d\n", uxTaskGetStackHighWaterMark(NULL)); /* check to see if we are using hardware encryption */ -#if defined(NO_ESP32WROOM32_CRYPT) - ESP_LOGI(TAG, "NO_ESP32WROOM32_CRYPT defined! HW acceleration DISABLED."); +#if defined(NO_ESP32_CRYPT) + ESP_LOGI(TAG, "NO_ESP32_CRYPT defined! HW acceleration DISABLED."); #else #if defined(CONFIG_IDF_TARGET_ESP32C3) - #error "ESP32WROOM32_CRYPT not yet supported on ESP32-C3" + #error "ESP32_CRYPT not yet supported on ESP32-C3" #elif defined(CONFIG_IDF_TARGET_ESP32S2) - #error "ESP32WROOM32_CRYPT not yet supported on ESP32-S2" + #error "ESP32_CRYPT not yet supported on ESP32-S2" #elif defined(CONFIG_IDF_TARGET_ESP32S3) - #error "ESP32WROOM32_CRYPT not yet supported on ESP32-S3" + #error "ESP32_CRYPT not yet supported on ESP32-S3" #else - ESP_LOGI(TAG, "ESP32WROOM32_CRYPT is enabled."); + ESP_LOGI(TAG, "ESP32_CRYPT is enabled."); #endif #endif diff --git a/IDE/Espressif/ESP-IDF/user_settings.h b/IDE/Espressif/ESP-IDF/user_settings.h index 36ad26fa17..1932845cdc 100644 --- a/IDE/Espressif/ESP-IDF/user_settings.h +++ b/IDE/Espressif/ESP-IDF/user_settings.h @@ -19,9 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -40,12 +40,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* #define DEBUG_WOLFSSL_VERBOSE */ @@ -97,7 +97,7 @@ #endif /* RSA primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -109,7 +109,7 @@ /* debug options */ /* #define DEBUG_WOLFSSL */ -/* #define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG */ +/* #define WOLFSSL_ESP32_CRYPT_DEBUG */ /* #define WOLFSSL_ATECC508A_DEBUG */ /* date/time */ @@ -119,15 +119,15 @@ /* #define XTIME time */ /* when you want not to use HW acceleration */ -/* #define NO_ESP32WROOM32_CRYPT */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH*/ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES */ -/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */ +/* #define NO_ESP32_CRYPT */ +/* #define NO_WOLFSSL_ESP32_CRYPT_HASH*/ +/* #define NO_WOLFSSL_ESP32_CRYPT_AES */ +/* #define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI */ /* adjust wait-timeout count if you see timeout in RSA HW acceleration */ #define ESP_RSA_TIMEOUT_CNT 0x249F00 -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time */ #define NO_AES_192 #endif diff --git a/IDE/Espressif/ESP-IDF5/examples/wolfssl_client/components/wolfssl/include/user_settings.h b/IDE/Espressif/ESP-IDF5/examples/wolfssl_client/components/wolfssl/include/user_settings.h index fdf79894cc..1daf0fdb5d 100644 --- a/IDE/Espressif/ESP-IDF5/examples/wolfssl_client/components/wolfssl/include/user_settings.h +++ b/IDE/Espressif/ESP-IDF5/examples/wolfssl_client/components/wolfssl/include/user_settings.h @@ -20,9 +20,9 @@ */ #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -41,12 +41,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* #define WOLFSSL_NOSHA512_224 */ /* #define WOLFSSL_NOSHA512_256 */ @@ -108,7 +108,7 @@ #endif /* rsa primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -120,7 +120,7 @@ /* debug options */ // #define DEBUG_WOLFSSL -#define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +#define WOLFSSL_ESP32_CRYPT_DEBUG /* #define WOLFSSL_ATECC508A_DEBUG */ /* date/time */ @@ -130,10 +130,10 @@ /* #define XTIME time */ /* when you want not to use HW acceleration */ -#define NO_ESP32WROOM32_CRYPT -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI +#define NO_ESP32_CRYPT +#define NO_WOLFSSL_ESP32_CRYPT_HASH +#define NO_WOLFSSL_ESP32_CRYPT_AES +#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI /* adjust wait-timeout count if you see timeout in RSA HW acceleration */ #define ESP_RSA_TIMEOUT_CNT 0x249F00 @@ -145,7 +145,7 @@ #define USE_FAST_MATH #define WOLFSSL_SMALL_STACK -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time */ #define NO_AES_192 #endif diff --git a/IDE/Espressif/ESP-IDF5/examples/wolfssl_esp_21/components/wolfssl/include/user_settings.h b/IDE/Espressif/ESP-IDF5/examples/wolfssl_esp_21/components/wolfssl/include/user_settings.h index 295602100b..4d1adc546c 100644 --- a/IDE/Espressif/ESP-IDF5/examples/wolfssl_esp_21/components/wolfssl/include/user_settings.h +++ b/IDE/Espressif/ESP-IDF5/examples/wolfssl_esp_21/components/wolfssl/include/user_settings.h @@ -20,9 +20,9 @@ */ #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -41,12 +41,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* #define WOLFSSL_NOSHA512_224 */ /* #define WOLFSSL_NOSHA512_256 */ @@ -112,7 +112,7 @@ #endif /* rsa primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -124,7 +124,7 @@ /* debug options */ #define DEBUG_WOLFSSL -#define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +#define WOLFSSL_ESP32_CRYPT_DEBUG /* #define WOLFSSL_ATECC508A_DEBUG */ @@ -137,10 +137,10 @@ /* Default is HW enabled unless turned off. ** Uncomment these lines for SW: */ -#define NO_ESP32WROOM32_CRYPT -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI +#define NO_ESP32_CRYPT +#define NO_WOLFSSL_ESP32_CRYPT_HASH +#define NO_WOLFSSL_ESP32_CRYPT_AES +#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI /* adjust wait-timeout count if you see timeout in RSA HW acceleration */ #define ESP_RSA_TIMEOUT_CNT 0x249F00 @@ -150,7 +150,7 @@ #define USE_FAST_MATH #define WOLFSSL_SMALL_STACK -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time */ #define NO_AES_192 #endif diff --git a/IDE/Espressif/ESP-IDF5/examples/wolfssl_server/components/wolfssl/include/user_settings.h b/IDE/Espressif/ESP-IDF5/examples/wolfssl_server/components/wolfssl/include/user_settings.h index fdf79894cc..1daf0fdb5d 100644 --- a/IDE/Espressif/ESP-IDF5/examples/wolfssl_server/components/wolfssl/include/user_settings.h +++ b/IDE/Espressif/ESP-IDF5/examples/wolfssl_server/components/wolfssl/include/user_settings.h @@ -20,9 +20,9 @@ */ #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -41,12 +41,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* #define WOLFSSL_NOSHA512_224 */ /* #define WOLFSSL_NOSHA512_256 */ @@ -108,7 +108,7 @@ #endif /* rsa primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -120,7 +120,7 @@ /* debug options */ // #define DEBUG_WOLFSSL -#define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +#define WOLFSSL_ESP32_CRYPT_DEBUG /* #define WOLFSSL_ATECC508A_DEBUG */ /* date/time */ @@ -130,10 +130,10 @@ /* #define XTIME time */ /* when you want not to use HW acceleration */ -#define NO_ESP32WROOM32_CRYPT -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI +#define NO_ESP32_CRYPT +#define NO_WOLFSSL_ESP32_CRYPT_HASH +#define NO_WOLFSSL_ESP32_CRYPT_AES +#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI /* adjust wait-timeout count if you see timeout in RSA HW acceleration */ #define ESP_RSA_TIMEOUT_CNT 0x249F00 @@ -145,7 +145,7 @@ #define USE_FAST_MATH #define WOLFSSL_SMALL_STACK -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time */ #define NO_AES_192 #endif diff --git a/IDE/Espressif/ESP-IDF5/examples/wolfssl_server_6205/components/wolfssl/include/user_settings.h b/IDE/Espressif/ESP-IDF5/examples/wolfssl_server_6205/components/wolfssl/include/user_settings.h index 22da4a7023..cdaff27cf1 100644 --- a/IDE/Espressif/ESP-IDF5/examples/wolfssl_server_6205/components/wolfssl/include/user_settings.h +++ b/IDE/Espressif/ESP-IDF5/examples/wolfssl_server_6205/components/wolfssl/include/user_settings.h @@ -20,9 +20,9 @@ */ #undef WOLFSSL_ESPIDF -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESPWROOM32SE -#undef WOLFSSL_ESPWROOM32 +#undef WOLFSSL_ESP32 #undef WOLFSSL_ESP8266 /* The Espressif sdkconfig will have chipset info. @@ -41,12 +41,12 @@ /* * choose ONE of these Espressif chips to define: * - * WOLFSSL_ESPWROOM32 + * WOLFSSL_ESP32 * WOLFSSL_ESPWROOM32SE * WOLFSSL_ESP8266 */ -#define WOLFSSL_ESPWROOM32 +#define WOLFSSL_ESP32 /* #define WOLFSSL_NOSHA512_224 */ /* #define WOLFSSL_NOSHA512_256 */ @@ -112,7 +112,7 @@ #endif /* rsa primitive specific definition */ -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Define USE_FAST_MATH and SMALL_STACK */ #define ESP32_USE_RSA_PRIMITIVE /* threshold for performance adjustment for HW primitive use */ @@ -124,7 +124,7 @@ /* debug options */ #define DEBUG_WOLFSSL -#define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +#define WOLFSSL_ESP32_CRYPT_DEBUG /* #define WOLFSSL_ATECC508A_DEBUG */ @@ -137,10 +137,10 @@ /* Default is HW enabled unless turned off. ** Uncomment these lines for SW: */ -//#define NO_ESP32WROOM32_CRYPT -//#define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH -//#define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES -//#define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI +//#define NO_ESP32_CRYPT +//#define NO_WOLFSSL_ESP32_CRYPT_HASH +//#define NO_WOLFSSL_ESP32_CRYPT_AES +//#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI /* adjust wait-timeout count if you see timeout in RSA HW acceleration */ #define ESP_RSA_TIMEOUT_CNT 0x249F00 @@ -151,7 +151,7 @@ #define USE_FAST_MATH #define WOLFSSL_SMALL_STACK -#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* AES192 is not supported on the ESP32-S3 HW at this time TODO #pragma warn */ #define NO_AES_192 #endif diff --git a/IDE/Espressif/ESP-IDF5/examples/wolfssl_server_6205/main/main.c b/IDE/Espressif/ESP-IDF5/examples/wolfssl_server_6205/main/main.c index e3d0eacb6f..da9db78f5a 100644 --- a/IDE/Espressif/ESP-IDF5/examples/wolfssl_server_6205/main/main.c +++ b/IDE/Espressif/ESP-IDF5/examples/wolfssl_server_6205/main/main.c @@ -191,7 +191,7 @@ int CertDemo() { strncpy(request.subject.locality, "Hamilton\0", CTC_NAME_SIZE); strncpy(request.subject.org, "Blue Leaf Software, Ltd\0", CTC_NAME_SIZE); -#if defined(NO_ESP32WROOM32_CRYPT) +#if defined(NO_ESP32_CRYPT) strncpy(request.subject.commonName, "Lumos SW, SN = BLS-001\0", CTC_NAME_SIZE); #else strncpy(request.subject.commonName, "Lumos HW, SN = BLS-002\0", CTC_NAME_SIZE); @@ -288,35 +288,35 @@ openssl x509 -req -in "./output/test_request.crt" -days 10 \ */ /* check to see if we are using hardware encryption */ -#if defined(NO_ESP32WROOM32_CRYPT) - WOLFSSL_VERSION_PRINTF("NO_ESP32WROOM32_CRYPT defined! " +#if defined(NO_ESP32_CRYPT) + WOLFSSL_VERSION_PRINTF("NO_ESP32_CRYPT defined! " "HW acceleration DISABLED."); #else /* first show what platform hardware acceleration is enabled ** (some new platforms may not be supported yet) */ #if defined(CONFIG_IDF_TARGET_ESP32) - WOLFSSL_VERSION_PRINTF("ESP32WROOM32_CRYPT is enabled for ESP32."); + WOLFSSL_VERSION_PRINTF("ESP32_CRYPT is enabled for ESP32."); #elif defined(CONFIG_IDF_TARGET_ESP32S2) - WOLFSSL_VERSION_PRINTF("ESP32WROOM32_CRYPT is enabled for ESP32-S2."); + WOLFSSL_VERSION_PRINTF("ESP32_CRYPT is enabled for ESP32-S2."); #elif defined(CONFIG_IDF_TARGET_ESP32S3) - WOLFSSL_VERSION_PRINTF("ESP32WROOM32_CRYPT is enabled for ESP32-S3."); + WOLFSSL_VERSION_PRINTF("ESP32_CRYPT is enabled for ESP32-S3."); #else - #error "ESP32WROOM32_CRYPT not yet supported on this IDF TARGET" + #error "ESP32_CRYPT not yet supported on this IDF TARGET" #endif /* Even though enabled, some specifics may be disabled */ - #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) - WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH is defined!" + #if defined(NO_WOLFSSL_ESP32_CRYPT_HASH) + WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32_CRYPT_HASH is defined!" "(disabled HW SHA)."); #endif - #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) - WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32WROOM32_CRYPT_AES is defined!" + #if defined(NO_WOLFSSL_ESP32_CRYPT_AES) + WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32_CRYPT_AES is defined!" "(disabled HW AES)."); #endif - #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI) - WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI defined!" + #if defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI) + WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32_CRYPT_RSA_PRI defined!" "(disabled HW RSA)"); #endif #endif diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 6f1b607abc..00969bb069 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -676,8 +676,8 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits #error nRF51 AES Hardware does not support decrypt #endif /* HAVE_AES_DECRYPT */ -#elif defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#elif defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_AES) #include "wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h" @@ -2865,8 +2865,8 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt( { return wc_AesSetKey(aes, userKey, keylen, iv, dir); } -#elif defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#elif defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_AES) int wc_AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv, int dir) @@ -3176,8 +3176,8 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt( rk = aes->key; XMEMCPY(rk, userKey, keylen); #if defined(LITTLE_ENDIAN_ORDER) && !defined(WOLFSSL_PIC32MZ_CRYPT) && \ - (!defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES)) + (!defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_AES)) ByteReverseWords(rk, rk, keylen); #endif @@ -4152,8 +4152,8 @@ int wc_AesSetIV(Aes* aes, const byte* iv) return ret; } #endif /* HAVE_AES_DECRYPT */ -#elif defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#elif defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_AES) int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) { @@ -4641,8 +4641,8 @@ int wc_AesSetIV(Aes* aes, const byte* iv) #elif defined(WOLFSSL_DEVCRYPTO_AES) /* implemented in wolfcrypt/src/port/devcrypt/devcrypto_aes.c */ - #elif defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) + #elif defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_AES) /* esp32 doesn't support CRT mode by hw. */ /* use aes ecnryption plus sw implementation */ #define NEED_AES_CTR_SOFT diff --git a/wolfcrypt/src/port/Espressif/README.md b/wolfcrypt/src/port/Espressif/README.md index 5722ae7801..77c096d8ac 100644 --- a/wolfcrypt/src/port/Espressif/README.md +++ b/wolfcrypt/src/port/Espressif/README.md @@ -11,19 +11,19 @@ For detail about ESP32 HW Acceleration, you can find in [Technical Reference Man To enable hw acceleration : * Uncomment out `#define WOLFSSL_ESPIDF` in `/path/to/wolfssl/wolfssl/wolfcrypt/settings.h` -* Uncomment out `#define WOLFSSL_ESPWROOM32` in `/path/to/wolfssl/wolfssl/wolfcrypt/settings.h` +* Uncomment out `#define WOLFSSL_ESP32` in `/path/to/wolfssl/wolfssl/wolfcrypt/settings.h` To disable portions of the hardware acceleration you can optionally define: ```c /* Disabled SHA, AES and RSA acceleration */ -#define NO_ESP32WROOM32_CRYPT +#define NO_ESP32_CRYPT /* Disabled AES acceleration */ -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES +#define NO_WOLFSSL_ESP32_CRYPT_AES /* Disabled SHA acceleration */ -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH +#define NO_WOLFSSL_ESP32_CRYPT_HASH /* Disabled RSA Primitive acceleration */ -#define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI +#define NO_WOLFSSL_ESP32_CRYPT_RSA_PRI ``` ### Coding diff --git a/wolfcrypt/src/port/Espressif/esp32_aes.c b/wolfcrypt/src/port/Espressif/esp32_aes.c index 09105a5110..7ed89512e4 100644 --- a/wolfcrypt/src/port/Espressif/esp32_aes.c +++ b/wolfcrypt/src/port/Espressif/esp32_aes.c @@ -33,8 +33,8 @@ #ifndef NO_AES -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_AES) #include "sdkconfig.h" /* programmatically generated from sdkconfig */ #include #include "wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h" @@ -428,5 +428,5 @@ int wc_esp32AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) return 0; } /* wc_esp32AesCbcDecrypt */ -#endif /* WOLFSSL_ESP32WROOM32_CRYPT */ +#endif /* WOLFSSL_ESP32_CRYPT */ #endif /* NO_AES */ diff --git a/wolfcrypt/src/port/Espressif/esp32_mp.c b/wolfcrypt/src/port/Espressif/esp32_mp.c index 16c04bac40..5d63de1aca 100644 --- a/wolfcrypt/src/port/Espressif/esp32_mp.c +++ b/wolfcrypt/src/port/Espressif/esp32_mp.c @@ -47,8 +47,8 @@ #if !defined(NO_RSA) || defined(HAVE_ECC) -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI) #ifdef NO_INLINE #include @@ -129,9 +129,9 @@ static const char* const TAG = "wolfssl_esp32_mp"; #ifdef DEBUG_WOLFSSL /* when debugging, we'll double-check the mutex with call depth */ - #ifndef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD + #ifndef NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD static int esp_mp_exptmod_depth_counter = 0; - #endif /* NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD */ + #endif /* NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD */ #endif /* DEBUG_WOLFSSL */ /* @@ -333,7 +333,7 @@ static int esp_mp_hw_unlock( void ) single_thread_locked = 0; #else esp_CryptHwMutexUnLock(&mp_mutex); -#endif // SINGLE_THREADED +#endif /* SINGLE_THREADED */ ESP_LOGV(TAG, "esp_mp_hw_unlock"); } @@ -346,9 +346,9 @@ static int esp_mp_hw_unlock( void ) /* mulmod and mulexp_mod HW accelerator need mongomery math prep: M' */ -#if !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) \ +#if !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) \ || \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD) + !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD) static int esp_calc_Mdash(MATH_INT_T *M, word32 k, mp_digit* md) { @@ -420,7 +420,7 @@ static int esp_calc_Mdash(MATH_INT_T *M, word32 k, mp_digit* md) ESP_LOGV(TAG, "\nEnd esp_calc_Mdash \n"); return ret; } -#endif /* !NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_[MULMOD/EXPTMOD] for M' */ +#endif /* !NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_[MULMOD/EXPTMOD] for M' */ /* the result may need to have extra bytes zeroed or used length adjusted */ static int esp_clean_result(MATH_INT_T* Z, int used_padding) @@ -573,7 +573,7 @@ static int esp_memblock_to_mpint(const uint32_t mem_address, #endif return ret; } -#ifndef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL +#ifndef NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL /* Write 0x00 to [wordSz] words of register memory starting at mem_address */ #if defined(CONFIG_IDF_TARGET_ESP32) static int esp_zero_memblock(u_int32_t mem_address, int wordSz) @@ -669,9 +669,9 @@ static word32 bits2words(word32 bits) return ((bits + (d - 1)) / d); } -#if !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) \ +#if !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) \ || \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD) + !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD) /* rinv and M' only used for mulmod and mulexp_mod */ /* get rinv */ @@ -771,9 +771,9 @@ int esp_show_mph(struct esp_mp_helper* mph) } -#if !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) \ +#if !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) \ || \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD)/* given X, Y, M - setup mp hardware and other helper values.*/ + !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD)/* given X, Y, M - setup mp hardware and other helper values.*/ int esp_mp_montgomery_init(MATH_INT_T* X, MATH_INT_T* Y, MATH_INT_T* M, struct esp_mp_helper* mph) { @@ -910,7 +910,7 @@ int esp_mp_montgomery_init(MATH_INT_T* X, MATH_INT_T* Y, MATH_INT_T* M, #endif -#ifndef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL +#ifndef NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL /* Large Number Multiplication * * See 24.3.3 of the ESP32 Technical Reference Manual @@ -1304,9 +1304,9 @@ int esp_mp_mul(MATH_INT_T* X, MATH_INT_T* Y, MATH_INT_T* Z) return ret; } /* esp_mp_mul() */ -#endif /* ! NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL*/ +#endif /* ! NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL*/ -#ifndef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD +#ifndef NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD /* Large Number Modular Multiplication * * See 24.3.3 of the ESP32 Technical Reference Manual @@ -1736,10 +1736,10 @@ int esp_mp_mulmod(MATH_INT_T* X, MATH_INT_T* Y, MATH_INT_T* M, MATH_INT_T* Z) #endif return ret; } /* esp_mp_mulmod */ -#endif /* ! NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD */ +#endif /* ! NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD */ -#ifndef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD +#ifndef NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD /* Large Number Modular Exponentiation * * Z = X^Y mod M @@ -2000,11 +2000,11 @@ int esp_mp_exptmod(MATH_INT_T* X, MATH_INT_T* Y, MATH_INT_T* M, MATH_INT_T* Z) return ret; } /* esp_mp_exptmod */ -#endif /* ! NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD +#endif /* ! NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD * (turns on/off mp_exptmod) */ -#endif /* WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI) && - * !NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */ +#endif /* WOLFSSL_ESP32_CRYPT_RSA_PRI) && + * !NO_WOLFSSL_ESP32_CRYPT_RSA_PRI */ #endif /* !NO_RSA || HAVE_ECC */ diff --git a/wolfcrypt/src/port/Espressif/esp32_sha.c b/wolfcrypt/src/port/Espressif/esp32_sha.c index 88de778642..e159a1ad04 100644 --- a/wolfcrypt/src/port/Espressif/esp32_sha.c +++ b/wolfcrypt/src/port/Espressif/esp32_sha.c @@ -34,8 +34,8 @@ /* this entire file content is excluded if not using HW hash acceleration */ -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) /* TODO this may be chip type dependent: add support for others */ #include /* ESP32-WROOM */ @@ -1364,5 +1364,5 @@ int esp_sha512_digest_process(struct wc_Sha512* sha, byte blockproc) return ret; } /* esp_sha512_digest_process */ #endif /* WOLFSSL_SHA512 || WOLFSSL_SHA384 */ -#endif /* WOLFSSL_ESP32WROOM32_CRYPT */ +#endif /* WOLFSSL_ESP32_CRYPT */ #endif /* !defined(NO_SHA) ||... */ diff --git a/wolfcrypt/src/port/Espressif/esp32_util.c b/wolfcrypt/src/port/Espressif/esp32_util.c index c75f5d9125..765d3d6a1b 100644 --- a/wolfcrypt/src/port/Espressif/esp32_util.c +++ b/wolfcrypt/src/port/Espressif/esp32_util.c @@ -23,7 +23,7 @@ #include /* needed to print MATH_INT_T value */ -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ +#if defined(WOLFSSL_ESP32_CRYPT) && \ (!defined(NO_AES) || !defined(NO_SHA) || !defined(NO_SHA256) ||\ defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512)) @@ -178,35 +178,35 @@ static int ShowExtendedSystemInfo_platform_espressif() #endif /* check to see if we are using hardware encryption */ -#if defined(NO_ESP32WROOM32_CRYPT) - WOLFSSL_VERSION_PRINTF("NO_ESP32WROOM32_CRYPT defined! " +#if defined(NO_ESP32_CRYPT) + WOLFSSL_VERSION_PRINTF("NO_ESP32_CRYPT defined! " "HW acceleration DISABLED."); #else /* first show what platform hardware acceleration is enabled ** (some new platforms may not be supported yet) */ #if defined(CONFIG_IDF_TARGET_ESP32) - WOLFSSL_VERSION_PRINTF("ESP32WROOM32_CRYPT is enabled for ESP32."); + WOLFSSL_VERSION_PRINTF("ESP32_CRYPT is enabled for ESP32."); #elif defined(CONFIG_IDF_TARGET_ESP32S2) - WOLFSSL_VERSION_PRINTF("ESP32WROOM32_CRYPT is enabled for ESP32-S2."); + WOLFSSL_VERSION_PRINTF("ESP32_CRYPT is enabled for ESP32-S2."); #elif defined(CONFIG_IDF_TARGET_ESP32S3) - WOLFSSL_VERSION_PRINTF("ESP32WROOM32_CRYPT is enabled for ESP32-S3."); + WOLFSSL_VERSION_PRINTF("ESP32_CRYPT is enabled for ESP32-S3."); #else -#error "ESP32WROOM32_CRYPT not yet supported on this IDF TARGET" +#error "ESP32_CRYPT not yet supported on this IDF TARGET" #endif /* Even though enabled, some specifics may be disabled */ -#if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) - WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH is defined!" +#if defined(NO_WOLFSSL_ESP32_CRYPT_HASH) + WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32_CRYPT_HASH is defined!" "(disabled HW SHA)."); #endif -#if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES) - WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32WROOM32_CRYPT_AES is defined!" +#if defined(NO_WOLFSSL_ESP32_CRYPT_AES) + WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32_CRYPT_AES is defined!" "(disabled HW AES)."); #endif -#if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI) - WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI defined!" +#if defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI) + WOLFSSL_VERSION_PRINTF("NO_WOLFSSL_ESP32_CRYPT_RSA_PRI defined!" "(disabled HW RSA)"); #endif #endif diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index dd76083011..8658c8e5e0 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -3431,7 +3431,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) #elif defined(WOLFSSL_ESPIDF) /* Espressif */ - #if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) + #if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) /* Espressif ESP32 */ #include @@ -3477,7 +3477,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) return 0; } - #endif /* end WOLFSSL_ESPWROOM32 */ + #endif /* end WOLFSSL_ESP32 */ #elif defined(WOLFSSL_LINUXKM) #include diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index bd51c4055a..0f6f1299b8 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -54,15 +54,15 @@ #include #endif -#undef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#undef WOLFSSL_USE_ESP32_CRYPT_HASH_HW +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) /* define a single keyword for simplicity & readability * * by default the HW acceleration is on for ESP32-WROOM32 * but individual components can be turned off. */ - #define WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #define WOLFSSL_USE_ESP32_CRYPT_HASH_HW #include "wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h" /* Although we have hardware acceleration, @@ -73,18 +73,18 @@ /* The ESP32C3 is different; HW crypto here. Not yet implemented. ** We'll be using software for RISC-V at this time */ #else - #undef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #undef WOLFSSL_USE_ESP32_CRYPT_HASH_HW #endif -#undef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#undef WOLFSSL_USE_ESP32_CRYPT_HASH_HW +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) /* define a single keyword for simplicity & readability * * by default the HW acceleration is on for ESP32-WROOM32 * but individual components can be turned off. */ - #define WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #define WOLFSSL_USE_ESP32_CRYPT_HASH_HW #include "wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h" /* Although we have hardware acceleration, @@ -96,7 +96,7 @@ ** We'll be using software for RISC-V at this time */ static const char* TAG = "wc_sha-c3"; #else - #undef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #undef WOLFSSL_USE_ESP32_CRYPT_HASH_HW #endif /* fips wrapper calls, user can call direct */ @@ -339,7 +339,7 @@ !defined(WOLFSSL_QNX_CAAM) /* wolfcrypt/src/port/caam/caam_sha.c */ -#elif defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) || \ +#elif defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) || \ defined(WOLFSSL_USE_ESP32C3_CRYPT_HASH_HW) /* This function initializes SHA. @@ -585,7 +585,7 @@ int wc_InitSha_ex(wc_Sha* sha, void* heap, int devId) sha->devCtx = NULL; #endif -#ifdef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW +#ifdef WOLFSSL_USE_ESP32_CRYPT_HASH_HW if (sha->ctx.mode != ESP32_SHA_INIT) { /* it may be interesting to see old values during debugging */ ESP_LOGV(TAG, "Set ctx mode from prior value: %d", sha->ctx.mode); @@ -669,7 +669,7 @@ int wc_ShaUpdate(wc_Sha* sha, const byte* data, word32 len) ByteReverseWords(sha->buffer, sha->buffer, WC_SHA_BLOCK_SIZE); #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha->ctx.mode == ESP32_SHA_INIT) { ESP_LOGV(TAG, "wc_ShaUpdate try hardware"); esp_sha_try_hw_lock(&sha->ctx); @@ -730,7 +730,7 @@ int wc_ShaUpdate(wc_Sha* sha, const byte* data, word32 len) ByteReverseWords(local32, local32, WC_SHA_BLOCK_SIZE); #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha->ctx.mode == ESP32_SHA_INIT){ esp_sha_try_hw_lock(&sha->ctx); } @@ -824,7 +824,7 @@ int wc_ShaFinal(wc_Sha* sha, byte* hash) ByteReverseWords(sha->buffer, sha->buffer, WC_SHA_BLOCK_SIZE); #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) /* For a fresh sha.ctx, try to use hardware acceleration */ if (sha->ctx.mode == ESP32_SHA_INIT) { esp_sha_try_hw_lock(&sha->ctx); @@ -876,7 +876,7 @@ int wc_ShaFinal(wc_Sha* sha, byte* hash) 2 * sizeof(word32)); #endif -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha->ctx.mode == ESP32_SHA_INIT) { esp_sha_try_hw_lock(&sha->ctx); } @@ -1034,7 +1034,7 @@ int wc_ShaCopy(wc_Sha* src, wc_Sha* dst) ret = se050_hash_copy(&src->se050Ctx, &dst->se050Ctx); #endif -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) esp_sha_ctx_copy(src, dst); #endif diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 37d666d3ff..13d8861b81 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -90,17 +90,17 @@ on the specific device platform. /* determine if we are using Espressif SHA hardware acceleration */ -#undef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#undef WOLFSSL_USE_ESP32_CRYPT_HASH_HW +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) /* define a single keyword for simplicity & readability * * by default the HW acceleration is on for ESP32-WROOM32 * but individual components can be turned off. */ - #define WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #define WOLFSSL_USE_ESP32_CRYPT_HASH_HW #else - #undef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #undef WOLFSSL_USE_ESP32_CRYPT_HASH_HW #endif #ifdef WOLFSSL_ESPIDF @@ -108,7 +108,7 @@ on the specific device platform. ** ** Beware of possible conflict in test.c (that one now named TEST_TAG) */ - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) static const char* TAG = "wc_sha256"; #endif #endif @@ -220,7 +220,7 @@ on the specific device platform. (!defined(WOLFSSL_IMX6_CAAM) || defined(NO_IMX6_CAAM_HASH) || \ defined(WOLFSSL_QNX_CAAM)) && \ !defined(WOLFSSL_AFALG_HASH) && !defined(WOLFSSL_DEVCRYPTO_HASH) && \ - (!defined(WOLFSSL_ESP32WROOM32_CRYPT) || defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH)) && \ + (!defined(WOLFSSL_ESP32_CRYPT) || defined(NO_WOLFSSL_ESP32_CRYPT_HASH)) && \ (!defined(WOLFSSL_RENESAS_TSIP_CRYPT) || defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)) && \ !defined(WOLFSSL_PSOC6_CRYPTO) && !defined(WOLFSSL_IMXRT_DCP) && !defined(WOLFSSL_SILABS_SE_ACCEL) && \ !defined(WOLFSSL_KCAPI_HASH) && !defined(WOLFSSL_SE050_HASH) && \ @@ -737,7 +737,7 @@ static int InitSha256(wc_Sha256* sha256) return ret; } -#elif defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#elif defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) /* HW may fail since there's only one, so we still need SW */ #define NEED_SOFT_SHA256 @@ -783,7 +783,7 @@ static int InitSha256(wc_Sha256* sha256) return BAD_FUNC_ARG; } - #ifdef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #ifdef WOLFSSL_USE_ESP32_CRYPT_HASH_HW /* We know this is a fresh, uninitialized item, so set to INIT */ if (sha256->ctx.mode != ESP32_SHA_INIT) { ESP_LOGV(TAG, "Set ctx mode from prior value: " @@ -1104,7 +1104,7 @@ static int InitSha256(wc_Sha256* sha256) } #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha256->ctx.mode == ESP32_SHA_INIT) { ESP_LOGV(TAG, "Sha256Update try hardware"); esp_sha_try_hw_lock(&sha256->ctx); @@ -1188,7 +1188,7 @@ static int InitSha256(wc_Sha256* sha256) } #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha256->ctx.mode == ESP32_SHA_INIT){ ESP_LOGV(TAG, "Sha256Update try hardware loop"); esp_sha_try_hw_lock(&sha256->ctx); @@ -1295,7 +1295,7 @@ static int InitSha256(wc_Sha256* sha256) } #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha256->ctx.mode == ESP32_SHA_INIT) { esp_sha_try_hw_lock(&sha256->ctx); } @@ -1353,7 +1353,7 @@ static int InitSha256(wc_Sha256* sha256) } #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha256->ctx.mode == ESP32_SHA_INIT) { esp_sha_try_hw_lock(&sha256->ctx); } @@ -1596,7 +1596,7 @@ static int InitSha256(wc_Sha256* sha256) sha224->used = 0; #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) /* not to be confused with HAS512_224 */ sha224->ctx.mode = ESP32_SHA_SW; /* no SHA224 HW, so always SW */ #endif @@ -1619,7 +1619,7 @@ static int InitSha256(wc_Sha256* sha256) sha224->W = NULL; #endif - #ifdef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #ifdef WOLFSSL_USE_ESP32_CRYPT_HASH_HW /* We know this is a fresh, uninitialized item, so set to INIT */ if (sha224->ctx.mode != ESP32_SHA_SW) { ESP_LOGV(TAG, "Set sha224 ctx mode init to ESP32_SHA_SW. " @@ -1644,7 +1644,7 @@ static int InitSha256(wc_Sha256* sha256) ret = wc_CAAM_HashInit(&sha224->hndl, &sha224->ctx, WC_HASH_TYPE_SHA224); #endif - #ifdef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #ifdef WOLFSSL_USE_ESP32_CRYPT_HASH_HW if (sha224->ctx.mode != ESP32_SHA_INIT) { ESP_LOGV("SHA224", "Set ctx mode from prior value: " "%d", sha224->ctx.mode); @@ -1672,7 +1672,7 @@ static int InitSha256(wc_Sha256* sha256) } #endif /* WOLFSSL_ASYNC_CRYPT */ - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) sha224->ctx.mode = ESP32_SHA_SW; /* no SHA224 HW, so always SW */ #endif @@ -1698,7 +1698,7 @@ static int InitSha256(wc_Sha256* sha256) } #endif /* WOLFSSL_ASYNC_CRYPT */ - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) sha224->ctx.mode = ESP32_SHA_SW; /* no SHA224 HW, so always SW */ #endif @@ -1834,7 +1834,7 @@ void wc_Sha256Free(wc_Sha256* sha256) #endif /* Espressif embedded hardware acceleration specific: */ -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha256->ctx.lockDepth > 0) { /* probably due to unclean shutdown, error, or other problem. * @@ -1944,7 +1944,7 @@ int wc_Sha224_Grow(wc_Sha224* sha224, const byte* in, int inSz) ret = wolfAsync_DevCopy(&src->asyncDev, &dst->asyncDev); #endif - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) ret = esp_sha224_ctx_copy(src, dst); #endif @@ -2083,7 +2083,7 @@ int wc_Sha256Copy(wc_Sha256* src, wc_Sha256* dst) ret = wc_Pic32HashCopy(&src->cache, &dst->cache); #endif -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) esp_sha256_ctx_copy(src, dst); #endif diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index 9c27ea2bc1..fcd6e6d2d7 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -34,18 +34,18 @@ #if (defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)) && !defined(WOLFSSL_ARMASM) && !defined(WOLFSSL_PSOC6_CRYPTO) /* determine if we are using Espressif SHA hardware acceleration */ -#undef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#undef WOLFSSL_USE_ESP32_CRYPT_HASH_HW +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) /* define a single keyword for simplicity & readability * * by default the HW acceleration is on for ESP32-WROOM32 * but individual components can be turned off. */ - #define WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #define WOLFSSL_USE_ESP32_CRYPT_HASH_HW static const char* TAG = "wc_sha_512"; #else - #undef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW + #undef WOLFSSL_USE_ESP32_CRYPT_HASH_HW #endif #if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2) @@ -299,7 +299,7 @@ static int InitSha512(wc_Sha512* sha512) sha512->loLen = 0; sha512->hiLen = 0; -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) /* HW needs to be carefully initialized, taking into account soft copy. ** If already in use; copy may revert to SW as needed. */ @@ -339,7 +339,7 @@ static int InitSha512_224(wc_Sha512* sha512) sha512->loLen = 0; sha512->hiLen = 0; -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) /* HW needs to be carefully initialized, taking into account soft copy. ** If already in use; copy may revert to SW as needed. ** @@ -381,7 +381,7 @@ static int InitSha512_256(wc_Sha512* sha512) sha512->loLen = 0; sha512->hiLen = 0; -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) /* HW needs to be carefully initialized, taking into account soft copy. ** If already in use; copy may revert to SW as needed. ** @@ -621,7 +621,7 @@ static int InitSha512_Family(wc_Sha512* sha512, void* heap, int devId, int wc_InitSha512_ex(wc_Sha512* sha512, void* heap, int devId) { -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha512->ctx.mode != ESP32_SHA_INIT) { ESP_LOGV(TAG, "Set ctx mode from prior value: " "%d", sha512->ctx.mode); @@ -637,7 +637,7 @@ int wc_InitSha512_ex(wc_Sha512* sha512, void* heap, int devId) (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST) int wc_InitSha512_224_ex(wc_Sha512* sha512, void* heap, int devId) { -#ifdef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW +#ifdef WOLFSSL_USE_ESP32_CRYPT_HASH_HW /* No SHA512/224 HW support is available, set to SW. */ sha512->ctx.mode = ESP32_SHA_SW; /* no SHA224 HW, so always SW */ #endif @@ -649,7 +649,7 @@ int wc_InitSha512_224_ex(wc_Sha512* sha512, void* heap, int devId) (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST) int wc_InitSha512_256_ex(wc_Sha512* sha512, void* heap, int devId) { -#ifdef WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW +#ifdef WOLFSSL_USE_ESP32_CRYPT_HASH_HW /* No SHA512/256 HW support is available on ESP32, set to SW. */ sha512->ctx.mode = ESP32_SHA_SW; #endif @@ -840,15 +840,15 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) #endif { - #if !defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) + #if !defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) ByteReverseWords64(sha512->buffer, sha512->buffer, WC_SHA512_BLOCK_SIZE); #endif } #endif - #if !defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) + #if !defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) ret = Transform_Sha512(sha512); #else if(sha512->ctx.mode == ESP32_SHA_INIT) { @@ -913,13 +913,13 @@ static WC_INLINE int Sha512Update(wc_Sha512* sha512, const byte* data, word32 le data += WC_SHA512_BLOCK_SIZE; len -= WC_SHA512_BLOCK_SIZE; - #if !defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) + #if !defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) ByteReverseWords64(sha512->buffer, sha512->buffer, WC_SHA512_BLOCK_SIZE); #endif - #if !defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) + #if !defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) ret = Transform_Sha512(sha512); #else if(sha512->ctx.mode == ESP32_SHA_INIT) { @@ -1019,15 +1019,15 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) #endif { - #if !defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) + #if !defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) ByteReverseWords64(sha512->buffer,sha512->buffer, WC_SHA512_BLOCK_SIZE); #endif } #endif /* LITTLE_ENDIAN_ORDER */ - #if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) + #if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha512->ctx.mode == ESP32_SHA_INIT) { esp_sha_try_hw_lock(&sha512->ctx); } @@ -1061,15 +1061,15 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) (defined(HAVE_INTEL_AVX1) || defined(HAVE_INTEL_AVX2)) if (!IS_INTEL_AVX1(intel_flags) && !IS_INTEL_AVX2(intel_flags)) #endif - #if !defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) + #if !defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) ByteReverseWords64(sha512->buffer, sha512->buffer, WC_SHA512_PAD_SIZE); #endif #endif /* ! length ordering dependent on digest endian type ! */ -#if !defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#if !defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) sha512->buffer[WC_SHA512_BLOCK_SIZE / sizeof(word64) - 2] = sha512->hiLen; sha512->buffer[WC_SHA512_BLOCK_SIZE / sizeof(word64) - 1] = sha512->loLen; #endif @@ -1082,8 +1082,8 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512) WC_SHA512_BLOCK_SIZE - WC_SHA512_PAD_SIZE); #endif -#if !defined(WOLFSSL_ESP32WROOM32_CRYPT) || \ - defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#if !defined(WOLFSSL_ESP32_CRYPT) || \ + defined(NO_WOLFSSL_ESP32_CRYPT_HASH) ret = Transform_Sha512(sha512); #else if(sha512->ctx.mode == ESP32_SHA_INIT) { @@ -1360,7 +1360,7 @@ static int InitSha384(wc_Sha384* sha384) sha384->loLen = 0; sha384->hiLen = 0; -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) /* HW needs to be carefully initialized, taking into account soft copy. ** If already in use; copy may revert to SW as needed. */ esp_sha_init(&(sha384->ctx), WC_HASH_TYPE_SHA384); @@ -1482,7 +1482,7 @@ int wc_InitSha384_ex(wc_Sha384* sha384, void* heap, int devId) sha384->devId = devId; sha384->devCtx = NULL; #endif -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (sha384->ctx.mode != ESP32_SHA_INIT) { ESP_LOGV(TAG, "Set ctx mode from prior value: " "%d", sha384->ctx.mode); @@ -1632,7 +1632,7 @@ int wc_Sha512Copy(wc_Sha512* src, wc_Sha512* dst) ret = wolfAsync_DevCopy(&src->asyncDev, &dst->asyncDev); #endif -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) if (ret == 0) { ret = esp_sha512_ctx_copy(src, dst); } @@ -1884,7 +1884,7 @@ int wc_Sha384Copy(wc_Sha384* src, wc_Sha384* dst) ret = wolfAsync_DevCopy(&src->asyncDev, &dst->asyncDev); #endif -#if defined(WOLFSSL_USE_ESP32WROOM32_CRYPT_HASH_HW) +#if defined(WOLFSSL_USE_ESP32_CRYPT_HASH_HW) esp_sha384_ctx_copy(src, dst); #endif diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 9b44cd3cd9..5d1bc45595 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -57,33 +57,33 @@ #include #endif -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI) static const char* TAG = "TFM"; /* esp log breadcrumb */ - #if !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI) + #if !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI) /* Each individual math HW can be turned on or off. * Listed in order of complexity and historical difficulty. */ - #define WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL - #define WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD - #define WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD + #define WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL + #define WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD + #define WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD #endif - #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL) - #undef WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL + #if defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL) + #undef WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL #endif - #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) - #undef WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD + #if defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) + #undef WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD #endif - #if defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD) - #undef WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD + #if defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD) + #undef WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD #endif /* Note with HW there's a EPS_RSA_EXPT_XBTIS setting * as for some small numbers, SW may be faster. * See ESP_LOGV messages for EPS_RSA_EXPT_XBTIS values. */ -#endif /* WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */ +#endif /* WOLFSSL_ESP32_CRYPT_RSA_PRI */ #if defined(FREESCALE_LTC_TFM) #include @@ -310,7 +310,7 @@ int fp_mul(fp_int *A, fp_int *B, fp_int *C) goto clean; } -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL) if (esp_hw_validation_active()) { ESP_LOGV(TAG, "Skipping call to esp_mp_mul " "during active validation."); @@ -338,7 +338,7 @@ int fp_mul(fp_int *A, fp_int *B, fp_int *C) } } /* fall through to software calcs */ -#endif /* WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL */ +#endif /* WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL */ /* pick a comba (unrolled 4/8/16/32 x or rolled) based on the size of the largest input. We also want to avoid doing excess mults if the @@ -3101,9 +3101,9 @@ static int _fp_exptmod_base_2(fp_int * X, int digits, fp_int * P, int fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y) { -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) int retHW = FP_OKAY; -#endif /* WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD */ +#endif /* WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD */ /* handle modulus of zero and prevent overflows */ if (fp_iszero(P) || (P->used > (FP_SIZE/2))) { @@ -3122,7 +3122,7 @@ int fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y) return FP_OKAY; } -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) if (esp_hw_validation_active()) { ESP_LOGV(TAG, "Skipping call to esp_mp_exptmod " "during active validation."); @@ -3152,7 +3152,7 @@ int fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y) } /* switch */ } /* if validation check */ /* fall through to software calcs */ -#endif /* WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD */ +#endif /* WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD */ if (X->sign == FP_NEG) { #ifndef POSITIVE_EXP_ONLY /* reduce stack if assume no negatives */ @@ -3209,7 +3209,7 @@ int fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y) int fp_exptmod_ex(fp_int * G, fp_int * X, int digits, fp_int * P, fp_int * Y) { -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) int retHW = FP_OKAY; #endif @@ -3230,7 +3230,7 @@ int fp_exptmod_ex(fp_int * G, fp_int * X, int digits, fp_int * P, fp_int * Y) return FP_OKAY; } -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) retHW = esp_mp_exptmod(G, X, P, Y); switch (retHW) { case MP_OKAY: @@ -3253,7 +3253,7 @@ int fp_exptmod_ex(fp_int * G, fp_int * X, int digits, fp_int * P, fp_int * Y) break; } /* HW result switch */ /* falling through to SW: */ -#endif /* WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD */ +#endif /* WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD */ if (X->sign == FP_NEG) { #ifndef POSITIVE_EXP_ONLY /* reduce stack if assume no negatives */ @@ -3310,7 +3310,7 @@ int fp_exptmod_ex(fp_int * G, fp_int * X, int digits, fp_int * P, fp_int * Y) int fp_exptmod_nct(fp_int * G, fp_int * X, fp_int * P, fp_int * Y) { -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) int retHW = FP_OKAY; #endif @@ -3324,7 +3324,7 @@ int fp_exptmod_nct(fp_int * G, fp_int * X, fp_int * P, fp_int * Y) return FP_VAL; } -#if defined(WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD) +#if defined(WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD) retHW = esp_mp_exptmod(G, X, P, Y); switch (retHW) { case MP_OKAY: @@ -4660,7 +4660,7 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) #endif { int ret = MP_OKAY; -#ifdef WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD +#ifdef WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD ret = esp_mp_mulmod(a, b, c, d); switch (ret) { case MP_OKAY: @@ -4683,7 +4683,7 @@ int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) } #else /* no HW */ ret = fp_mulmod(a, b, c, d); -#endif /* WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD */ +#endif /* WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD */ return ret; } diff --git a/wolfssl/openssl/sha.h b/wolfssl/openssl/sha.h index 6498231e4e..c36441498f 100644 --- a/wolfssl/openssl/sha.h +++ b/wolfssl/openssl/sha.h @@ -41,8 +41,8 @@ #define CTX_SHA_HW_ADDER sizeof(STM32_HASH_Context) #elif defined(WOLFSSL_IMXRT1170_CAAM) #define CTX_SHA_HW_ADDER (sizeof(caam_hash_ctx_t) + sizeof(caam_handle_t)) -#elif defined(WOLFSSL_ESPWROOM32) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#elif defined(WOLFSSL_ESP32) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) #define CTX_SHA_HW_ADDER sizeof(WC_ESP32SHA) #else #define CTX_SHA_HW_ADDER 0 diff --git a/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h b/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h index e025788e46..bc2d4424f7 100644 --- a/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h +++ b/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h @@ -39,14 +39,14 @@ ** ** Primary Settings: ** -** WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI +** WOLFSSL_ESP32_CRYPT_RSA_PRI ** Defined in wolfSSL settings.h: this turns on or off esp32_mp math library. ** Unless turned off, this is enabled by default for the ESP32 ** -** NO_ESP32WROOM32_CRYPT +** NO_ESP32_CRYPT ** When defined, disables all hardware acceleration on the ESP32 ** -** NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH +** NO_WOLFSSL_ESP32_CRYPT_HASH ** Used to disabled only hash hardware algorithms: SHA2, etc. ** ** WOLFSSL_NOSHA512_224 @@ -55,16 +55,16 @@ ** WOLFSSL_NOSHA512_256 ** Define to disable SHA-512/512 ** -** NO_WOLFSSL_ESP32WROOM32_CRYPT_AES +** NO_WOLFSSL_ESP32_CRYPT_AES ** Used to disable only AES hardware algorithms. Software used instead. ** -** NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL +** NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL ** Turns off hardware acceleration esp_mp_mul() ** -** NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD +** NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD ** Turns off hardware acceleration esp_mp_exptmod() ** -** NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD +** NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD ** Turns off hardware acceleration esp_mp_mulmod() ** ******************************************************************************* @@ -72,15 +72,15 @@ ******************************************************************************* ** Listed in increasing order of complexity: ** -** WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL +** WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL ** When defined, use hardware acceleration esp_mp_mul() ** for Large Number Multiplication: Z = X * Y ** -** WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD +** WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD ** When defined, use hardware acceleration esp_mp_exptmod() ** for Large Number Modular Exponentiation Z = X^Y mod M ** -** WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD +** WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD ** When defined, use hardware acceleration esp_mp_mulmod() ** for Large Number Modular Multiplication: Z = X * Y mod M ** @@ -102,7 +102,7 @@ ** Used to re-read data from registers in esp32_mp & verify written contents ** actually match the source data. ** -** WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +** WOLFSSL_ESP32_CRYPT_DEBUG ** When defined, enables hardware cryptography debugging ** ** NO_HW_MATH_TEST @@ -149,7 +149,7 @@ ** ******************************************************************************* */ -#ifdef WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +#ifdef WOLFSSL_ESP32_CRYPT_DEBUG #undef LOG_LOCAL_LEVEL #define LOG_LOCAL_LEVEL ESP_LOG_DEBUG #else @@ -272,14 +272,14 @@ extern "C" #endif /* ! NO_AES */ -#ifdef WOLFSSL_ESP32WROOM32_CRYPT_DEBUG +#ifdef WOLFSSL_ESP32_CRYPT_DEBUG void wc_esp32TimerStart(void); uint64_t wc_esp32elapsedTime(void); -#endif /* WOLFSSL_ESP32WROOM32_CRYPT_DEBUG */ +#endif /* WOLFSSL_ESP32_CRYPT_DEBUG */ -#if !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) && \ +#if !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) && \ (!defined(NO_SHA) || !defined(NO_SHA256) || \ defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512) \ ) @@ -393,7 +393,7 @@ extern "C" #define ESP_RSA_TIMEOUT_CNT 0x249F00 #endif -#ifndef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD +#ifndef NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD /* * The parameter names in the Espressif implementation are arbitrary. * @@ -411,9 +411,9 @@ extern "C" /* HW_MATH_ENABLED is typically used in wolfcrypt tests */ #undef HW_MATH_ENABLED #define HW_MATH_ENABLED - #endif /* ! NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_EXPTMOD */ + #endif /* ! NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_EXPTMOD */ - #ifndef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL + #ifndef NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL /* Z = X * Y */ int esp_mp_mul(MATH_INT_T* X, MATH_INT_T* Y, @@ -421,9 +421,9 @@ extern "C" /* HW_MATH_ENABLED is typically used in wolfcrypt tests */ #undef HW_MATH_ENABLED #define HW_MATH_ENABLED -#endif /* ! NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MP_MUL */ +#endif /* ! NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MP_MUL */ -#ifndef NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD +#ifndef NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD /* Z = X * Y (mod M) */ int esp_mp_mulmod(MATH_INT_T* X, MATH_INT_T* Y, @@ -432,7 +432,7 @@ extern "C" /* HW_MATH_ENABLED is typically used in wolfcrypt tests */ #undef HW_MATH_ENABLED #define HW_MATH_ENABLED -#endif /* ! NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI_MULMOD */ +#endif /* ! NO_WOLFSSL_ESP32_CRYPT_RSA_PRI_MULMOD */ #endif /* !NO_RSA || HAVE_ECC*/ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index a14364d4d1..a1718749d2 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -224,7 +224,7 @@ /* #define WOLFSSL_ESPIDF */ /* Uncomment next line if using Espressif ESP32-WROOM-32 */ -/* #define WOLFSSL_ESPWROOM32 */ +/* #define WOLFSSL_ESP32 */ /* Uncomment next line if using Espressif ESP32-WROOM-32SE */ /* #define WOLFSSL_ESPWROOM32SE */ @@ -350,12 +350,12 @@ #define ECC_TIMING_RESISTANT #define WC_RSA_BLINDING -#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE) - #ifndef NO_ESP32WROOM32_CRYPT - #define WOLFSSL_ESP32WROOM32_CRYPT +#if defined(WOLFSSL_ESP32) || defined(WOLFSSL_ESPWROOM32SE) + #ifndef NO_ESP32_CRYPT + #define WOLFSSL_ESP32_CRYPT #if defined(ESP32_USE_RSA_PRIMITIVE) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI) - #define WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI + !defined(NO_WOLFSSL_ESP32_CRYPT_RSA_PRI) + #define WOLFSSL_ESP32_CRYPT_RSA_PRI #define WOLFSSL_SMALL_STACK #endif #endif diff --git a/wolfssl/wolfcrypt/sha.h b/wolfssl/wolfcrypt/sha.h index 1b181f5259..5568b2e0af 100644 --- a/wolfssl/wolfcrypt/sha.h +++ b/wolfssl/wolfcrypt/sha.h @@ -78,7 +78,7 @@ #ifdef WOLFSSL_ASYNC_CRYPT #include #endif -#ifdef WOLFSSL_ESP32WROOM32_CRYPT +#ifdef WOLFSSL_ESP32_CRYPT #include #endif #if defined(WOLFSSL_SILABS_SE_ACCEL) @@ -173,8 +173,8 @@ struct wc_Sha { word32 len; #endif #endif -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) WC_ESP32SHA ctx; #endif #ifdef WOLFSSL_HASH_FLAGS diff --git a/wolfssl/wolfcrypt/sha256.h b/wolfssl/wolfcrypt/sha256.h index 51a91a0525..faebae2591 100644 --- a/wolfssl/wolfcrypt/sha256.h +++ b/wolfssl/wolfcrypt/sha256.h @@ -97,7 +97,7 @@ #if defined(WOLFSSL_DEVCRYPTO) && defined(WOLFSSL_DEVCRYPTO_HASH) #include #endif -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) +#if defined(WOLFSSL_ESP32_CRYPT) #include "wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h" #endif #if defined(WOLFSSL_CRYPTOCELL) @@ -214,8 +214,8 @@ struct wc_Sha256 { word32 used; word32 len; #endif -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) WC_ESP32SHA ctx; #endif #ifdef WOLFSSL_MAXQ10XX_CRYPTO diff --git a/wolfssl/wolfcrypt/sha512.h b/wolfssl/wolfcrypt/sha512.h index 07411b01d5..ade68d1ad0 100644 --- a/wolfssl/wolfcrypt/sha512.h +++ b/wolfssl/wolfcrypt/sha512.h @@ -75,7 +75,7 @@ #ifdef WOLFSSL_ASYNC_CRYPT #include #endif -#ifdef WOLFSSL_ESP32WROOM32_CRYPT +#ifdef WOLFSSL_ESP32_CRYPT #include #endif #if defined(WOLFSSL_SILABS_SE_ACCEL) @@ -172,8 +172,8 @@ struct wc_Sha512 { #ifdef WOLFSSL_SMALL_STACK_CACHE word64* W; #endif -#if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \ - !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH) +#if defined(WOLFSSL_ESP32_CRYPT) && \ + !defined(NO_WOLFSSL_ESP32_CRYPT_HASH) WC_ESP32SHA ctx; #endif #if defined(WOLFSSL_SILABS_SE_ACCEL)