From 3a85a27fb908ae45503ac8f460fe5451f02b69c4 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 14 Nov 2025 16:43:53 -0800 Subject: [PATCH] Unify the hdr_cpy (we don't need two) --- docs/Targets.md | 13 +++++++++++++ src/image.c | 6 ++++++ src/libwolfboot.c | 8 ++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/Targets.md b/docs/Targets.md index c7cb0816..ba832580 100644 --- a/docs/Targets.md +++ b/docs/Targets.md @@ -3654,6 +3654,19 @@ make VORAGO_SDK_DIR=$PWD../VA416xx_SDK/ 34636 4 26976 61616 f0b0 wolfboot.elf ``` +Example of wolfBoot binary sizes based on algorithms: + +| Authentication | Hash | wolfBoot Size | +|----------------|------|---------------| +| ECC256 | SHA256 | 25,836 | +| ECC384 | SHA384 | 34,652 | +| ECC521 | SHA384 | 38,608 | +| ED25519 | SHA256 | 31,448 | +| RSA2048 | SHA256 | 19,148 | +| RSA3072 | SHA384 | 28,828 | +| RSA4096 | SHA3-384 | 19,216 | +| ML-DSA 87 | SHA256 | 25,168 | + ### Flashing Vorago VA416x0 Flash using Segger JLink: `JLinkExe -CommanderScript tools/scripts/va416x0/flash_va416xx.jlink` diff --git a/src/image.c b/src/image.c index 66ee1146..2f7652bf 100644 --- a/src/image.c +++ b/src/image.c @@ -875,8 +875,14 @@ static uint8_t *get_sha_block(struct wolfBoot_image *img, uint32_t offset) } #ifdef EXT_FLASH +#ifdef UNIT_TEST static uint8_t hdr_cpy[IMAGE_HEADER_SIZE] XALIGNED(4); static int hdr_cpy_done = 0; +#else +/* use from libwolfboot.c */ +extern uint8_t hdr_cpy[IMAGE_HEADER_SIZE] XALIGNED(4); +extern int hdr_cpy_done; +#endif /** * @brief Get a copy of the image header. diff --git a/src/libwolfboot.c b/src/libwolfboot.c index 4ad30d09..ddbe0282 100644 --- a/src/libwolfboot.c +++ b/src/libwolfboot.c @@ -904,8 +904,8 @@ uint16_t wolfBoot_find_header(uint8_t *haystack, uint16_t type, uint8_t **ptr) } #ifdef EXT_FLASH -static uint8_t hdr_cpy[IMAGE_HEADER_SIZE] XALIGNED(4); -static uint32_t hdr_cpy_done = 0; +uint8_t hdr_cpy[IMAGE_HEADER_SIZE] XALIGNED(4); +uint32_t hdr_cpy_done = 0; #endif /** @@ -949,6 +949,10 @@ static inline uint16_t im2ns(uint16_t val) } #ifdef DELTA_UPDATES + +/* forward declaration */ +static uint8_t* wolfBoot_get_image_from_part(uint8_t part); + /** * @brief Get delta update information. *