Skip to content

Commit

Permalink
Remove dependency from PQC parameters. Speed up tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinux committed Dec 2, 2024
1 parent b2bf298 commit 04d2ecd
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 140 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/footprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: make clean
run: |
make keysclean && make -C tools/keytools clean && rm -f include/target.h
make keysclean && rm -f include/target.h
- name: Install wolfSSL
run: |
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Build key tools
run: |
make -C tools/keytools
make keytools
- name: Build wolfboot and test footprint
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-build-sim-tpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
with:
submodules: true

- name: make distclean
- name: make keysclean
run: |
make distclean
make keysclean
- name: Select config
run: |
Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/test-sunnyday-simulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
#
- name: make clean
run: |
make distclean
make keysclean
- name: Select config (32 bit simulator)
run: |
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (ECC384)
run: |
Expand All @@ -77,7 +77,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (ECC521)
run: |
Expand All @@ -97,7 +97,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA2048)
run: |
Expand All @@ -117,7 +117,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA3072)
run: |
Expand All @@ -137,7 +137,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA4096)
run: |
Expand All @@ -159,7 +159,7 @@ jobs:
#
- name: make clean
run: |
make distclean
make keysclean
- name: Select config (32 bit simulator)
run: |
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (ECC384, FASTMATH)
run: |
Expand All @@ -207,7 +207,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (ECC521, FASTMATH)
run: |
Expand All @@ -227,7 +227,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA2048, FASTMATH)
run: |
Expand All @@ -247,7 +247,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA3072, FASTMATH)
run: |
Expand All @@ -267,7 +267,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA4096, FASTMATH)
run: |
Expand All @@ -290,7 +290,7 @@ jobs:
#
- name: make clean
run: |
make distclean
make keysclean
- name: Select config (64 bit simulator)
run: |
Expand Down Expand Up @@ -318,7 +318,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (ECC384)
run: |
Expand All @@ -338,7 +338,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (ECC521)
run: |
Expand All @@ -358,7 +358,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA2048)
run: |
Expand All @@ -378,7 +378,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA3072)
run: |
Expand All @@ -398,7 +398,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA4096)
run: |
Expand All @@ -420,7 +420,7 @@ jobs:
#
- name: make clean
run: |
make distclean
make keysclean
- name: Select config (64 bit simulator)
run: |
Expand Down Expand Up @@ -448,7 +448,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (ECC384, FASTMATH)
run: |
Expand All @@ -468,7 +468,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (ECC521, FASTMATH)
run: |
Expand All @@ -488,7 +488,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA2048, FASTMATH)
run: |
Expand All @@ -508,7 +508,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA3072, FASTMATH)
run: |
Expand All @@ -528,7 +528,7 @@ jobs:
- name: Cleanup to change key type
run: |
make -C tools/keytools clean && make keysclean && make -C tools/keytools
make keysclean
- name: Build wolfboot.elf (RSA4096, FASTMATH)
run: |
Expand Down Expand Up @@ -562,7 +562,7 @@ jobs:
#
- name: make clean
run: |
make distclean
make keysclean
- name: Select config (64 bit simulator) Hybrid ML_DSA + ECC
run: |
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ include tools/test-renode.mk

hal/$(TARGET).o:

keytools_check: keytools FORCE
keytools_check: keytools

$(PRIVATE_KEY):
$(Q)$(MAKE) keytools_check
Expand All @@ -223,7 +223,6 @@ $(SECONDARY_PRIVATE_KEY): $(PRIVATE_KEY) keystore.der

keytools:
@echo "Building key tools"
@$(MAKE) -C tools/keytools -s clean
@$(MAKE) -C tools/keytools -j

tpmtools: include/target.h keys
Expand Down Expand Up @@ -281,7 +280,7 @@ wolfboot_stage1.bin: wolfboot.elf stage1/loader_stage1.bin

wolfboot.elf: include/target.h $(LSCRIPT) $(OBJS) $(BINASSEMBLE) FORCE
$(Q)(test $(SIGN) = NONE) || (test $(FLASH_OTP_KEYSTORE) = 1) || (grep -q $(SIGN_ALG) src/keystore.c) || \
(echo "Key mismatch: please run 'make distclean' to remove all keys if you want to change algorithm" && false)
(echo "Key mismatch: please run 'make keysclean' to remove all keys if you want to change algorithm" && false)
@echo "\t[LD] $@"
@echo $(OBJS)
$(Q)$(LD) $(LDFLAGS) $(LSCRIPT_FLAGS) $(SECURE_LDFLAGS) $(LD_START_GROUP) $(OBJS) $(LIBS) $(LD_END_GROUP) -o $@
Expand Down
10 changes: 7 additions & 3 deletions include/wolfboot/wolfboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@ extern "C" {
#define KEYSTORE_PUBKEY_SIZE_ML_DSA 1952
#elif ML_DSA_LEVEL == 5
#define KEYSTORE_PUBKEY_SIZE_ML_DSA 2592
#else
#error "Invalid ML_DSA_LEVEL!"
#endif
#endif /* ML_DSA_LEVEL */
#else
#ifdef SIGN_ML_DSA
#error "ML_DSA_LEVEL not defined"
#endif
/* Default to max size for keystore */
#define KEYSTORE_PUBKEY_SIZE_ML_DSA 2592
#endif /* defined ML_DSA_LEVEL */

/* Mask for key permissions */
#define KEY_VERIFY_ALL (0xFFFFFFFFU)
Expand Down
2 changes: 2 additions & 0 deletions test-app/app_stm32f4.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ static const char UPDATE='U';
static const char ACK='#';
static uint8_t msg[MSGSIZE];

extern void flash_set_waitstates(void);


#ifdef WOLFBOOT_NO_SIGN

Expand Down
Loading

0 comments on commit 04d2ecd

Please sign in to comment.