From ce8897147937b1e02e9795f009b6b9f28477d94d Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 4 May 2022 09:23:07 +0200 Subject: [PATCH 1/6] Updated submodules to wolfSSL 5.3.0 --- lib/wolfTPM | 2 +- lib/wolfssl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wolfTPM b/lib/wolfTPM index 4523d9bce..37db8576d 160000 --- a/lib/wolfTPM +++ b/lib/wolfTPM @@ -1 +1 @@ -Subproject commit 4523d9bce18d435bb83d8b1ced8f59825aa49bb4 +Subproject commit 37db8576d00883c09db717a7be57b783e9a53eac diff --git a/lib/wolfssl b/lib/wolfssl index 539219080..e722c15be 160000 --- a/lib/wolfssl +++ b/lib/wolfssl @@ -1 +1 @@ -Subproject commit 5392190807dc6d665fde6c5784fff1ace32e777a +Subproject commit e722c15be860794179082a05d09e6a90dc77ccf0 From 1d15e8c2a8c6def02b8149268c9e5c2ac4f6587e Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 4 May 2022 09:38:41 +0200 Subject: [PATCH 2/6] Fixed memory size for SMALL_STACK ECC256 --- src/xmalloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xmalloc.c b/src/xmalloc.c index 80d662b1e..135a5c7ed 100644 --- a/src/xmalloc.c +++ b/src/xmalloc.c @@ -65,13 +65,13 @@ struct xmalloc_slot { #define MP_CURVE_SPECS_SIZE (80) #ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM #define MP_POINT_SIZE (196) - #define MP_DIGITS_BUFFER_SIZE_0 (MP_DIGIT_SIZE * 16 * 8) - #define MP_DIGITS_BUFFER_SIZE_1 (MP_DIGIT_SIZE * 2 * 8 * 5) + #define MP_DIGITS_BUFFER_SIZE_0 (MP_DIGIT_SIZE * 18 * 8) + #define MP_DIGITS_BUFFER_SIZE_1 (MP_DIGIT_SIZE * 2 * 8 * 6) #else #define MP_POINT_SIZE (220) - #define MP_DIGITS_BUFFER_SIZE_0 (MP_DIGIT_SIZE * 16 * 9) + #define MP_DIGITS_BUFFER_SIZE_0 (MP_DIGIT_SIZE * 18 * 9) #define MP_DIGITS_BUFFER_SIZE_1 (MP_DIGIT_SIZE * (4 * 9 + 3)) - #define MP_DIGITS_BUFFER_SIZE_2 (MP_DIGIT_SIZE * (2 * 9 * 5)) + #define MP_DIGITS_BUFFER_SIZE_2 (MP_DIGIT_SIZE * (2 * 9 * 6)) #define MP_MONTGOMERY_SIZE (sizeof(int64_t) * 2 * 8) #endif #endif /* WOLFBOOT_SIGN_ECC256 */ From e3a9b335c8bb318185ed21cc723156ae85d40656 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 4 May 2022 12:33:20 +0200 Subject: [PATCH 3/6] Fixed memory size for SMALL_STACK ECC384 --- src/xmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xmalloc.c b/src/xmalloc.c index 135a5c7ed..a4acddc7a 100644 --- a/src/xmalloc.c +++ b/src/xmalloc.c @@ -79,12 +79,12 @@ struct xmalloc_slot { #define MP_CURVE_SPECS_SIZE (112) #ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM #define MP_POINT_SIZE (292) - #define MP_DIGITS_BUFFER_SIZE_0 (MP_DIGIT_SIZE * 16 * 12) + #define MP_DIGITS_BUFFER_SIZE_0 (MP_DIGIT_SIZE * 18 * 12) #define MP_DIGITS_BUFFER_SIZE_1 (MP_DIGIT_SIZE * 2 * 12 * 6) #define MP_MONTGOMERY_SIZE (sizeof(int64_t) * 12) #else #define MP_POINT_SIZE (364) - #define MP_DIGITS_BUFFER_SIZE_0 (MP_DIGIT_SIZE * 16 * 15) + #define MP_DIGITS_BUFFER_SIZE_0 (MP_DIGIT_SIZE * 18 * 15) #define MP_DIGITS_BUFFER_SIZE_1 (MP_DIGIT_SIZE * (4 * 15 + 3)) #define MP_DIGITS_BUFFER_SIZE_2 (MP_DIGIT_SIZE * (2 * 15 * 6)) #define MP_MONTGOMERY_SIZE (sizeof(int64_t) * 2 * 12) From 082a7b2fb24d2e9f85df73de89494fb684a09832 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 4 May 2022 14:40:27 +0200 Subject: [PATCH 4/6] Adjusted stack size for ECC256 --- options.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options.mk b/options.mk index 4d9bfa2f9..6babdf90b 100644 --- a/options.mk +++ b/options.mk @@ -43,7 +43,7 @@ ifeq ($(SIGN),ECC256) else ifneq ($(SPMATH),1) STACK_USAGE=5008 else - STACK_USAGE=3896 + STACK_USAGE=3952 endif PUBLIC_KEY_OBJS=./src/ecc256_pub_key.o ifeq ($(shell test $(IMAGE_HEADER_SIZE) -lt 256; echo $$?),0) From 0ad6033373d5b6df918867b0c48ac4aeb430da6c Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 4 May 2022 15:01:49 +0200 Subject: [PATCH 5/6] Adjust footprint watermarks for 5.3.0 --- tools/test.mk | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/test.mk b/tools/test.mk index 9776ec3d9..7d2380c2e 100644 --- a/tools/test.mk +++ b/tools/test.mk @@ -768,13 +768,13 @@ test-all: clean test-size-all: make test-size SIGN=NONE LIMIT=4610 - make test-size SIGN=ED25519 LIMIT=10670 - make test-size SIGN=ECC256 LIMIT=21538 - make test-size SIGN=ECC256 NO_ASM=1 LIMIT=13042 - make test-size SIGN=RSA2048 LIMIT=10538 - make test-size SIGN=RSA2048 NO_ASM=1 LIMIT=11626 - make test-size SIGN=RSA4096 LIMIT=10894 - make test-size SIGN=RSA4096 NO_ASM=1 LIMIT=11910 - make test-size SIGN=ECC384 LIMIT=16866 - make test-size SIGN=ECC384 NO_ASM=1 LIMIT=14294 - make test-size SIGN=ED448 LIMIT=12830 + make test-size SIGN=ED25519 LIMIT=10734 + make test-size SIGN=ECC256 LIMIT=21758 + make test-size SIGN=ECC256 NO_ASM=1 LIMIT=13266 + make test-size SIGN=RSA2048 LIMIT=10722 + make test-size SIGN=RSA2048 NO_ASM=1 LIMIT=11702 + make test-size SIGN=RSA4096 LIMIT=11074 + make test-size SIGN=RSA4096 NO_ASM=1 LIMIT=11974 + make test-size SIGN=ECC384 LIMIT=17078 + make test-size SIGN=ECC384 NO_ASM=1 LIMIT=14698 + make test-size SIGN=ED448 LIMIT=12902 From 5002e833c0a7305e059a47aaa00adb5937222dbe Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 4 May 2022 17:00:38 +0200 Subject: [PATCH 6/6] wolfSSL submodule to latest master --- lib/wolfssl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wolfssl b/lib/wolfssl index e722c15be..af8f18b63 160000 --- a/lib/wolfssl +++ b/lib/wolfssl @@ -1 +1 @@ -Subproject commit e722c15be860794179082a05d09e6a90dc77ccf0 +Subproject commit af8f18b634e1c365cbc2c769be95da60965cc8ee