-
Notifications
You must be signed in to change notification settings - Fork 895
Closed
Description
Version
latest master
Description
There needs to be a more graceful fallback to software AES-192 calcs on the ESP32-S3 with hardware acceleration enabled.
As noted in #6373 (comment) and #5948 (comment) this setting may be needed on the ESP32-S3 related to AES-192, such as when turning on the OpenSSL features:
#include <sdkconfig.h>
#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES)
/* AES192 is not supported on the ESP32-S3 HW at this time */
#define NO_AES_192
#endif
Without this interim fix, the AES hardware acceleration features will fail at runtime with an error: esp_aes_hw_Set_KeyMode unsupported mode
, as seen in this wolfssl_test output:
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376b0a
pro cpu reset by JTAG
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3810,len:0x1684
load:0x403c9700,len:0xbe8
load:0x403cc700,len:0x2e98
entry 0x403c9904
I (31) boot: ESP-IDF v5.0-dirty 2nd stage bootloader
I (31) boot: compile time 13:08:54
I (31) boot: chip revision: v0.1
I (33) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (40) boot.esp32s3: Boot SPI Speed : 80MHz
I (45) boot.esp32s3: SPI Mode : DIO
I (50) boot.esp32s3: SPI Flash Size : 2MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (78) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (86) boot: 2 factory factory app 00 00 00010000 00177000
I (93) boot: End of partition table
I (97) boot_comm: chip revision: 1, min. application chip revision: 0
I (105) esp_image: segment 0: paddr=00010020 vaddr=3c060020 size=1dbc8h (121800) map
I (135) esp_image: segment 1: paddr=0002dbf0 vaddr=3fc91200 size=02428h ( 9256) load
I (137) esp_image: segment 2: paddr=00030020 vaddr=42000020 size=51d58h (335192) map
I (201) esp_image: segment 3: paddr=00081d80 vaddr=3fc93628 size=007f0h ( 2032) load
I (202) esp_image: segment 4: paddr=00082578 vaddr=40374000 size=0d190h ( 53648) load
I (219) esp_image: segment 5: paddr=0008f710 vaddr=50000000 size=00010h ( 16) load
I (225) boot: Loaded app from partition at offset 0x10000
I (225) boot: Disabling RNG early entropy source...
I (239) cpu_start: Pro cpu up.
I (239) cpu_start: Starting app cpu, entry point is 0x403751ac
I (0) cpu_start: App cpu up.
I (253) cpu_start: Pro cpu start user code
I (253) cpu_start: cpu freq: 160000000 Hz
I (253) cpu_start: Application information:
I (256) cpu_start: Project name: wolfssl_test
I (262) cpu_start: App version: v5.6.0-stable-329-g1a0a83c2e-di
I (269) cpu_start: Compile time: May 3 2023 13:08:39
I (275) cpu_start: ELF file SHA256: 9c079e560192134c...
I (281) cpu_start: ESP-IDF: v5.0-dirty
I (286) heap_init: Initializing. RAM available for dynamic allocation:
I (293) heap_init: At 3FC94880 len 00054E90 (339 KiB): D/IRAM
I (300) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (306) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (312) heap_init: At 600FE010 len 00001FF0 (7 KiB): RTCRAM
I (320) spi_flash: detected chip: generic
I (324) spi_flash: flash io: dio
W (327) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Us
ing the size in the binary image header.
I (341) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (361) wolfssl_test: --------------------------------------------------------
I (361) wolfssl_test: --------------------------------------------------------
I (371) wolfssl_test: ---------------------- BEGIN MAIN ----------------------
I (381) wolfssl_test: --------------------------------------------------------
I (391) wolfssl_test: --------------------------------------------------------
I (391) wolfssl_test: CONFIG_IDF_TARGET = esp32s3
I (401) wolfssl_test: LIBWOLFSSL_VERSION_STRING = 5.6.0
I (411) wolfssl_test: LIBWOLFSSL_VERSION_GIT_HASH = 1a0a83c2e966bc17b5cfd443ed532acf788b4a5b
I (421) wolfssl_test: LIBWOLFSSL_VERSION_GIT_SHORT_HASH = 1a0a83c2e
I (421) wolfssl_test: LIBWOLFSSL_VERSION_GIT_HASH_DATE = 'Wed May 3 09:48:47 2023 -0700'
I (431) wolfssl_test: CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ = 160 MHz
I (441) wolfssl_test: Xthal_have_ccount = 1
I (441) wolfssl_test: Stack HWM: 53456
I (451) wolfssl_test: ESP32WROOM32_CRYPT is enabled for ESP32-S3.
------------------------------------------------------------------------------
wolfSSL version 5.6.0
------------------------------------------------------------------------------
error test passed!
MEMORY test passed!
base64 test passed!
base16 test passed!
asn test passed!
RANDOM test passed!
MD5 test passed!
MD4 test passed!
SHA test passed!
SHA-224 test passed!
SHA-256 test passed!
SHA-512 test passed!
SHA-512/224 test passed!
SHA-512/256 test passed!
Hash test passed!
HMAC-MD5 test passed!
HMAC-SHA test passed!
HMAC-SHA224 test passed!
HMAC-SHA256 test passed!
HMAC-SHA512 test passed!
HMAC-KDF test passed!
TLSv1.3 KDF test passed!
GMAC test passed!
DES test passed!
DES3 test passed!
AES test passed!
E (821) wolf_hw_aes: esp_aes_hw_Set_KeyMode unsupported mode: 1
E (821) wolf_hw_aes: wc_esp32AesCbcEncrypt failed HW Set KeyMode
E (821) wolf_hw_aes: esp_aes_hw_Set_KeyMode unsupported mode: 5
E (831) wolf_hw_aes: wc_esp32AesCbcDecrypt failed HW Set KeyMode
AES192 test failed!
error L=10944
[fiducial line numbers: 7548 23027 33391 45540]
I (841) wolfcrypt_test: Exiting main with return code: -1
E (851) wolfssl_test: wolf_test_task FAIL result code = -1
See #6234 for a roadmap of Espressif updates.