diff --git a/components/esp_rom/esp32p4/include/esp32p4/rom/secure_boot.h b/components/esp_rom/esp32p4/include/esp32p4/rom/secure_boot.h index 01ebfedc98f..9feba509fca 100644 --- a/components/esp_rom/esp32p4/include/esp32p4/rom/secure_boot.h +++ b/components/esp_rom/esp32p4/include/esp32p4/rom/secure_boot.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -88,6 +88,25 @@ struct ets_secure_boot_sig_block { #elif CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME +#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS +struct __attribute((packed)) ets_secure_boot_sig_block { + uint8_t magic_byte; + uint8_t version; + uint8_t sha_version; + uint8_t _reserved2; + uint8_t image_digest[48]; + struct { + struct { + uint8_t curve_id; /* ETS_ECDSA_CURVE_P192 / ETS_ECDSA_CURVE_P256 / ETS_ECDSA_CURVE_P384 */ + uint8_t point[96]; /* X followed by Y (both little-endian), plus zero bytes if P192 */ + } key; + uint8_t signature[96]; /* r followed by s (both little-endian) */ + uint8_t padding[951]; + } ecdsa; + uint32_t block_crc; /* note: crc covers all bytes in the structure before it, regardless of version field */ + uint8_t _padding[16]; +}; +#else struct __attribute((packed)) ets_secure_boot_sig_block { uint8_t magic_byte; uint8_t version; @@ -105,6 +124,7 @@ struct __attribute((packed)) ets_secure_boot_sig_block { uint32_t block_crc; /* note: crc covers all bytes in the structure before it, regardless of version field */ uint8_t _padding[16]; }; +#endif /* CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS */ #endif ESP_STATIC_ASSERT(sizeof(ets_secure_boot_sig_block_t) == 1216, "invalid sig block size");