mirror of https://github.com/wolfSSL/wolfBoot.git
Added 32bit simulator via TARGET=sim FORCE_32BIT=1 (#485)
* Added 32bit simulator via TARGET=sim FORCE_32BIT=1 Tests can now run on 32bit simulator (e.g. to match XMALLOC fixed sizes with sp_math and WOLFBOOT_SMALL_STACK). * Added draft for new workflow: test simulator with different memory config * Fix 64bit, SMALL_STACK xmalloc sizes * Test defaults to SPMATH * Fixed test: defaults to spmath. Added RSA tests (failing) * Fixed RSA allocation sizes for 64bit build * Added 64bit fastmath test (failing) * Fixed ecc_point size for 64bit builds (FASTMATH) * simulator config: use SPMATH by default * Attempt to fix i386 libc dep in workflow * Added HUGE_STACK to silence warning in FASTMATH+RSA4096 testspull/486/head
parent
8273575e55
commit
30a1f67e43
|
@ -0,0 +1,548 @@
|
|||
name: test with simulator targets on RSA/ECC to detect xmalloc failures
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master', 'main', 'release/**' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
jobs:
|
||||
simulator_tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Workaround for sources.list
|
||||
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list
|
||||
|
||||
- name: Update repository
|
||||
run: sudo apt-get update
|
||||
|
||||
- name: Install 32-bit libc
|
||||
run: |
|
||||
sudo apt-get install -y libc6-dev-i386
|
||||
|
||||
# 32 Bit simulator, SP_MATH
|
||||
#
|
||||
- name: make clean
|
||||
run: |
|
||||
make distclean
|
||||
|
||||
- name: Select config (32 bit simulator)
|
||||
run: |
|
||||
cp config/examples/sim32.config .config
|
||||
|
||||
- name: Build tools
|
||||
run: |
|
||||
make -C tools/keytools && make -C tools/bin-assemble
|
||||
|
||||
- name: Build wolfboot.elf (ECC256)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC256 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC256, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC256 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (ECC384)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC384 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC384, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC384 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (ECC521)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC521 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC521, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC521 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA2048)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA2048, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA3072)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA3072, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA4096)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA4096, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
# 32 Bit simulator, FASTMATH
|
||||
#
|
||||
- name: make clean
|
||||
run: |
|
||||
make distclean
|
||||
|
||||
- name: Select config (32 bit simulator)
|
||||
run: |
|
||||
cp config/examples/sim32.config .config
|
||||
|
||||
- name: Build tools
|
||||
run: |
|
||||
make -C tools/keytools && make -C tools/bin-assemble
|
||||
|
||||
- name: Build wolfboot.elf (ECC256, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC256 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC256, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC256 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (ECC384, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC384 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC384, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC384 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (ECC521, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC521 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC521, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC521 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA2048, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA2048, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA3072, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA3072, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA4096, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 SPMATH=0 WOLFBOOT_HUGE_STACK=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA4096, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
|
||||
# 64 Bit simulator, SP_MATH
|
||||
#
|
||||
- name: make clean
|
||||
run: |
|
||||
make distclean
|
||||
|
||||
- name: Select config (64 bit simulator)
|
||||
run: |
|
||||
cp config/examples/sim.config .config
|
||||
|
||||
- name: Build tools
|
||||
run: |
|
||||
make -C tools/keytools && make -C tools/bin-assemble
|
||||
|
||||
- name: Build wolfboot.elf (ECC256)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC256 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC256, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC256 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (ECC384)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC384 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC384, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC384 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (ECC521)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC521 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC521, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC521 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA2048)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA2048, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA3072)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA3072, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA4096)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA4096, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 WOLFBOOT_SMALL_STACK=1 SPMATH=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
# 64 Bit simulator, FASTMATH
|
||||
#
|
||||
- name: make clean
|
||||
run: |
|
||||
make distclean
|
||||
|
||||
- name: Select config (64 bit simulator)
|
||||
run: |
|
||||
cp config/examples/sim.config .config
|
||||
|
||||
- name: Build tools
|
||||
run: |
|
||||
make -C tools/keytools && make -C tools/bin-assemble
|
||||
|
||||
- name: Build wolfboot.elf (ECC256, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC256 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC256, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC256 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (ECC384, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC384 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC384, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC384 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (ECC521, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC521 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (ECC521, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=ECC521 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA2048, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA2048, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA2048 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA3072, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA3072, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA3072 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Cleanup to change key type
|
||||
run: |
|
||||
make -C tools/keytools clean && make keysclean && make -C tools/keytools
|
||||
|
||||
- name: Build wolfboot.elf (RSA4096, FASTMATH)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 SPMATH=0 WOLFBOOT_HUGE_STACK=1
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
||||
- name: Build wolfboot.elf (RSA4096, FASTMATH, WOLFBOOT_SMALL_STACK)
|
||||
run: |
|
||||
make clean && make test-sim-internal-flash-with-update SIGN=RSA4096 WOLFBOOT_SMALL_STACK=1 SPMATH=0
|
||||
|
||||
- name: Run sunny day update test
|
||||
run: |
|
||||
tools/scripts/sim-sunnyday-update.sh
|
||||
|
4
arch.mk
4
arch.mk
|
@ -964,6 +964,10 @@ ifeq ($(TARGET),sim)
|
|||
LD_END_GROUP=
|
||||
BOOT_IMG=test-app/image.elf
|
||||
CFLAGS+=-DARCH_SIM
|
||||
ifeq ($(FORCE_32BIT),1)
|
||||
CFLAGS+=-m32
|
||||
LDFLAGS+=-m32
|
||||
endif
|
||||
ifeq ($(SPMATH),1)
|
||||
MATH_OBJS += ./lib/wolfssl/wolfcrypt/src/sp_c32.o
|
||||
CFLAGS+=-DWOLFSSL_SP_DIV_WORD_HALF
|
||||
|
|
|
@ -5,7 +5,6 @@ HASH?=SHA256
|
|||
WOLFBOOT_SMALL_STACK?=1
|
||||
SPI_FLASH=0
|
||||
DEBUG=1
|
||||
SPMATH?=0
|
||||
DISABLE_BACKUP=1
|
||||
FLAGS_HOME=1
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ HASH?=SHA256
|
|||
WOLFBOOT_SMALL_STACK?=1
|
||||
SPI_FLASH=0
|
||||
DEBUG=1
|
||||
SPMATH?=0
|
||||
DISABLE_BACKUP=1
|
||||
NVM_FLASH_WRITEONCE=1
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ HASH?=SHA256
|
|||
WOLFBOOT_SMALL_STACK?=1
|
||||
SPI_FLASH=0
|
||||
DEBUG=1
|
||||
SPMATH?=0
|
||||
DISABLE_BACKUP=1
|
||||
|
||||
# sizes should be multiple of system page size
|
||||
|
|
|
@ -2,10 +2,9 @@ ARCH=sim
|
|||
TARGET=sim
|
||||
SIGN?=ED25519
|
||||
HASH?=SHA256
|
||||
WOLFBOOT_SMALL_STACK?=1
|
||||
WOLFBOOT_SMALL_STACK?=0
|
||||
SPI_FLASH=0
|
||||
DEBUG=1
|
||||
SPMATH?=0
|
||||
|
||||
# sizes should be multiple of system page size
|
||||
WOLFBOOT_PARTITION_SIZE=0x40000
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
ARCH=sim
|
||||
TARGET=sim
|
||||
SIGN?=ECC256
|
||||
HASH?=SHA256
|
||||
WOLFBOOT_SMALL_STACK?=0
|
||||
SPI_FLASH=0
|
||||
DEBUG=1
|
||||
FORCE_32BIT=1
|
||||
|
||||
# sizes should be multiple of system page size
|
||||
WOLFBOOT_PARTITION_SIZE=0x40000
|
||||
WOLFBOOT_SECTOR_SIZE=0x1000
|
||||
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x80000
|
||||
# if on external flash, it should be multiple of system page size
|
||||
WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x100000
|
||||
WOLFBOOT_PARTITION_SWAP_ADDRESS=0x180000
|
||||
|
||||
# required for keytools
|
||||
WOLFBOOT_FIXED_PARTITIONS=1
|
||||
|
||||
# For debugging XMALLOC/XFREE
|
||||
#CFLAGS_EXTRA+=-DWOLFBOOT_DEBUG_MALLOC
|
|
@ -63,6 +63,7 @@ struct xmalloc_slot {
|
|||
# error "No hash mechanism selected."
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(WOLFBOOT_SIGN_ECC256) || defined(WOLFBOOT_SIGN_ECC384) || defined(WOLFBOOT_SIGN_ECC521)
|
||||
|
||||
#ifndef USE_FAST_MATH
|
||||
|
@ -135,7 +136,12 @@ struct xmalloc_slot {
|
|||
#define MP_SCHEME "TFM ECC256"
|
||||
#define MP_CURVE_SPECS_SIZE (MP_INT_TYPE_SIZE)
|
||||
#define MP_CURVE_FIELD_COUNT_SIZE (380)
|
||||
#define ECC_POINT_SIZE (228)
|
||||
#ifndef _LP64
|
||||
#define ECC_POINT_SIZE (228)
|
||||
#else
|
||||
#define ECC_POINT_SIZE (312)
|
||||
#define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 5)
|
||||
#endif
|
||||
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6)
|
||||
#define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
|
||||
#endif
|
||||
|
@ -143,7 +149,11 @@ struct xmalloc_slot {
|
|||
#define MP_SCHEME "TFM ECC384"
|
||||
#define MP_CURVE_SPECS_SIZE (MP_INT_TYPE_SIZE)
|
||||
#define MP_CURVE_FIELD_COUNT_SIZE (380)
|
||||
#define ECC_POINT_SIZE (408)
|
||||
#ifndef _LP64
|
||||
#define ECC_POINT_SIZE (408)
|
||||
#else
|
||||
#define ECC_POINT_SIZE (504)
|
||||
#endif
|
||||
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 5)
|
||||
#define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6)
|
||||
#define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
|
||||
|
@ -152,7 +162,11 @@ struct xmalloc_slot {
|
|||
#define MP_SCHEME "TFM ECC521"
|
||||
#define MP_CURVE_SPECS_SIZE (MP_INT_TYPE_SIZE)
|
||||
#define MP_CURVE_FIELD_COUNT_SIZE (380)
|
||||
#define ECC_POINT_SIZE (516)
|
||||
#ifndef _LP64
|
||||
#define ECC_POINT_SIZE (516)
|
||||
#else
|
||||
#define ECC_POINT_SIZE (600)
|
||||
#endif
|
||||
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 5)
|
||||
#define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6)
|
||||
#define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
|
||||
|
@ -280,7 +294,11 @@ static struct xmalloc_slot xmalloc_pool[] = {
|
|||
|
||||
static uint32_t sha_block[HASH_BLOCK_SIZE];
|
||||
|
||||
#ifndef _LP64
|
||||
#define ASNCHECK_BUF_SIZE (224)
|
||||
#else
|
||||
#define ASNCHECK_BUF_SIZE (320)
|
||||
#endif
|
||||
static uint8_t asncheck_buf[ASNCHECK_BUF_SIZE];
|
||||
|
||||
#ifndef USE_FAST_MATH
|
||||
|
@ -326,7 +344,7 @@ static uint8_t asncheck_buf[ASNCHECK_BUF_SIZE];
|
|||
#endif
|
||||
{ NULL, 0, 0}
|
||||
};
|
||||
#else
|
||||
#else /* FAST MATH */
|
||||
#define MP_SCHEME "TFM RSA"
|
||||
#define MP_INT_TYPE_SIZE (sizeof(mp_int))
|
||||
#define MP_MONT_REDUCE_BUF_SIZE (sizeof(fp_digit)*(FP_SIZE + 1))
|
||||
|
|
|
@ -215,6 +215,10 @@ ifeq ($(TARGET),sim)
|
|||
# LD on MacOS does not support "-Map="
|
||||
LDMAPSUPPORTED=$(shell $(CC) -Wl,-Map=image.map 2>&1 | grep 'unknown option')
|
||||
LDFLAGS=
|
||||
ifeq ($(FORCE_32BIT),1)
|
||||
LDFLAGS+=-m32
|
||||
CFLAGS+=-m32
|
||||
endif
|
||||
ifeq ($(LDMAPSUPPORTED),)
|
||||
# Override linker flags
|
||||
LDFLAGS+=-Wl,-Map=image.map
|
||||
|
|
Loading…
Reference in New Issue