Skip to content

Commit b9c7c8d

Browse files
committed
pq sunny day tests, and revert lib wolfssl module change for now.
1 parent 44e2593 commit b9c7c8d

File tree

6 files changed

+75
-10
lines changed

6 files changed

+75
-10
lines changed

.github/workflows/test-sunnyday-simulator.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,3 +546,15 @@ jobs:
546546
run: |
547547
tools/scripts/sim-sunnyday-update.sh
548548
549+
- name: Run sunny day LMS update test
550+
run: |
551+
tools/scripts/sim-pq-sunnyday-update.sh config/examples/sim-lms.config
552+
553+
- name: Run sunny day XMSS update test
554+
run: |
555+
tools/scripts/sim-pq-sunnyday-update.sh config/examples/sim-xmss.config
556+
557+
- name: Run sunny day ML-DSA update test
558+
run: |
559+
tools/scripts/sim-pq-sunnyday-update.sh config/examples/sim-ml-dsa.config
560+

config/examples/sim-lms.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ ARCH=sim
2727
TARGET=sim
2828
SIGN?=LMS
2929
HASH?=SHA256
30-
LMS_LEVELS=2
31-
LMS_HEIGHT=5
30+
LMS_LEVELS=1
31+
LMS_HEIGHT=10
3232
LMS_WINTERNITZ=8
33+
IMAGE_SIGNATURE_SIZE=1456
34+
IMAGE_HEADER_SIZE=4096
3335
WOLFBOOT_SMALL_STACK=0
3436
SPI_FLASH=0
3537
DEBUG=0
3638
DELTA_UPDATES=0
37-
IMAGE_SIGNATURE_SIZE=2644
38-
IMAGE_HEADER_SIZE?=5288
3939

4040
# sizes should be multiple of system page size
4141
WOLFBOOT_PARTITION_SIZE=0x40000

config/examples/sim-ml-dsa.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ DELTA_UPDATES=0
3838
# Category 2:
3939
ML_DSA_LEVEL=2
4040
IMAGE_SIGNATURE_SIZE=2420
41-
IMAGE_HEADER_SIZE?=4840
41+
IMAGE_HEADER_SIZE?=8192
4242
#
4343
# Category 3:
4444
# ML_DSA_LEVEL=3
4545
# IMAGE_SIGNATURE_SIZE=3309
46-
# IMAGE_HEADER_SIZE?=6618
46+
# IMAGE_HEADER_SIZE?=8192
4747
#
4848
# Category 5:
4949
# ML_DSA_LEVEL=5
@@ -53,7 +53,7 @@ IMAGE_HEADER_SIZE?=4840
5353

5454
# sizes should be multiple of system page size
5555
WOLFBOOT_PARTITION_SIZE=0x40000
56-
WOLFBOOT_SECTOR_SIZE=0x1000
56+
WOLFBOOT_SECTOR_SIZE=0x2000
5757
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x20000
5858
# if on external flash, it should be multiple of system page size
5959
WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x60000

config/examples/sim-xmss.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ SPI_FLASH=0
1717
DEBUG=0
1818
DELTA_UPDATES=0
1919
IMAGE_SIGNATURE_SIZE=2500
20-
IMAGE_HEADER_SIZE?=5000
20+
IMAGE_HEADER_SIZE?=8192
2121

2222
# sizes should be multiple of system page size
2323
WOLFBOOT_PARTITION_SIZE=0x40000
24-
WOLFBOOT_SECTOR_SIZE=0x1000
24+
WOLFBOOT_SECTOR_SIZE=0x2000
2525
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x20000
2626
# if on external flash, it should be multiple of system page size
2727
WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x60000

lib/wolfssl

Submodule wolfssl updated 1161 files
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
#
3+
# For PQ methods the keytools must be built to match the alg.
4+
#
5+
6+
print_usage_and_die() {
7+
echo "usage:"
8+
echo " ./tools/scripts/sim-pq-sunnyday-update.sh <path to sim-pq dot config>"
9+
echo ""
10+
echo "example:"
11+
echo " ./tools/scripts/sim-pq-sunnyday-update.sh config/examples/sim-ml-dsa.config"
12+
exit 1
13+
}
14+
15+
err_and_die() {
16+
echo "error: $1"
17+
exit 1
18+
}
19+
20+
if [ $# -ne 1 ]; then
21+
print_usage_and_die
22+
fi
23+
24+
sim_pq=$1
25+
26+
if [ ! -f $sim_pq ]; then
27+
err_and_die "file not found: $sim_pq"
28+
fi
29+
30+
cp $sim_pq .config || err_and_die "cp $sim_pq"
31+
32+
make distclean; make clean;
33+
34+
make keytools || err_and_die "keytools build failed"
35+
36+
make test-sim-internal-flash-with-update || err_and_die "make sim failed"
37+
38+
V=`./wolfboot.elf update_trigger get_version 2>/dev/null`
39+
if [ "x$V" != "x1" ]; then
40+
echo "Failed first boot with update_trigger"
41+
exit 1
42+
fi
43+
44+
V=`./wolfboot.elf success get_version 2>/dev/null`
45+
if [ "x$V" != "x2" ]; then
46+
echo "Failed update (V: $V)"
47+
exit 1
48+
fi
49+
50+
echo Test successful.
51+
exit 0
52+
53+

0 commit comments

Comments
 (0)