mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
esp32h2: enable DS peripheral support in driver and test application
This commit is contained in:
parent
13c8407a19
commit
e4e4ffa3f4
@ -48,6 +48,10 @@
|
||||
#include "esp32h4/rom/digital_signature.h"
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32H2
|
||||
#include "esp32h2/rom/digital_signature.h"
|
||||
#endif
|
||||
|
||||
|
||||
struct esp_ds_context {
|
||||
const ets_ds_data_t *data;
|
||||
|
@ -29,6 +29,11 @@
|
||||
#include "esp32c6/rom/digital_signature.h"
|
||||
#include "esp32c6/rom/aes.h"
|
||||
#include "esp32c6/rom/sha.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||
#include "esp32h2/rom/efuse.h"
|
||||
#include "esp32h2/rom/digital_signature.h"
|
||||
#include "esp32h2/rom/aes.h"
|
||||
#include "esp32h2/rom/sha.h"
|
||||
#endif
|
||||
|
||||
#include "esp_ds.h"
|
||||
|
@ -16,11 +16,12 @@ from cryptography.hazmat.primitives.asymmetric.rsa import _modinv as modinv # t
|
||||
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
||||
from cryptography.utils import int_to_bytes
|
||||
|
||||
supported_targets = {'esp32s2', 'esp32c3', 'esp32s3', 'esp32c6'}
|
||||
supported_targets = {'esp32s2', 'esp32c3', 'esp32s3', 'esp32c6', 'esp32h2'}
|
||||
supported_key_size = {'esp32s2':[4096, 3072, 2048, 1024],
|
||||
'esp32c3':[3072, 2048, 1024],
|
||||
'esp32s3':[4096, 3072, 2048, 1024],
|
||||
'esp32c6':[3072, 2048, 1024]}
|
||||
'esp32c6':[3072, 2048, 1024],
|
||||
'esp32h2':[3072, 2048, 1024]}
|
||||
|
||||
NUM_HMAC_KEYS = 3
|
||||
NUM_MESSAGES = 10
|
||||
|
@ -29,6 +29,11 @@
|
||||
#include "esp32c6/rom/digital_signature.h"
|
||||
#include "esp32c6/rom/aes.h"
|
||||
#include "esp32c6/rom/sha.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||
#include "esp32h2/rom/efuse.h"
|
||||
#include "esp32h2/rom/digital_signature.h"
|
||||
#include "esp32h2/rom/aes.h"
|
||||
#include "esp32h2/rom/sha.h"
|
||||
#endif
|
||||
|
||||
#include "esp_ds.h"
|
||||
|
@ -159,6 +159,16 @@ if(NOT BOOTLOADER_BUILD)
|
||||
list(APPEND srcs "apm_hal.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_HMAC_SUPPORTED AND NOT CONFIG_IDF_TARGET_ESP32S2)
|
||||
# For ESP32-S2 we do not have HMAC HAL layer implementation yet
|
||||
list(APPEND srcs "hmac_hal.c")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_DIG_SIGN_SUPPORTED AND NOT CONFIG_IDF_TARGET_ESP32S2)
|
||||
# For ESP32-S2 we do not have DS HAL layer implementation yet
|
||||
list(APPEND srcs "ds_hal.c")
|
||||
endif()
|
||||
|
||||
if(${target} STREQUAL "esp32")
|
||||
list(APPEND srcs
|
||||
"touch_sensor_hal.c"
|
||||
@ -180,13 +190,11 @@ if(NOT BOOTLOADER_BUILD)
|
||||
|
||||
if(${target} STREQUAL "esp32s3")
|
||||
list(APPEND srcs
|
||||
"ds_hal.c"
|
||||
"spi_flash_hal_gpspi.c"
|
||||
"touch_sensor_hal.c"
|
||||
"usb_hal.c"
|
||||
"usb_phy_hal.c"
|
||||
"xt_wdt_hal.c"
|
||||
"hmac_hal.c"
|
||||
"esp32s3/touch_sensor_hal.c"
|
||||
"esp32s3/rtc_cntl_hal.c"
|
||||
"usb_dwc_hal.c")
|
||||
@ -194,19 +202,15 @@ if(NOT BOOTLOADER_BUILD)
|
||||
|
||||
if(${target} STREQUAL "esp32c3")
|
||||
list(APPEND srcs
|
||||
"ds_hal.c"
|
||||
"spi_flash_hal_gpspi.c"
|
||||
"xt_wdt_hal.c"
|
||||
"hmac_hal.c"
|
||||
"esp32c3/rtc_cntl_hal.c")
|
||||
endif()
|
||||
|
||||
if(${target} STREQUAL "esp32h4")
|
||||
list(APPEND srcs
|
||||
"ds_hal.c"
|
||||
"spi_flash_hal_gpspi.c"
|
||||
"aes_hal.c"
|
||||
"hmac_hal.c"
|
||||
"esp32h4/rtc_cntl_hal.c")
|
||||
endif()
|
||||
|
||||
@ -218,9 +222,7 @@ if(NOT BOOTLOADER_BUILD)
|
||||
|
||||
if(${target} STREQUAL "esp32c6")
|
||||
list(APPEND srcs
|
||||
"spi_flash_hal_gpspi.c"
|
||||
"hmac_hal.c"
|
||||
"ds_hal.c")
|
||||
"spi_flash_hal_gpspi.c")
|
||||
|
||||
endif()
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include "esp32s3/rom/digital_signature.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C6
|
||||
#include "esp32c6/rom/digital_signature.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32H2
|
||||
#include "esp32h2/rom/digital_signature.h"
|
||||
#else
|
||||
#error "Selected target does not support esp_rsa_sign_alt (for DS)"
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user