Skip to content

Commit f3e63d8

Browse files
committed
Remove external ext_lms, ext_xmss pq integrations.
1 parent 5fc2a50 commit f3e63d8

File tree

7 files changed

+12
-182
lines changed

7 files changed

+12
-182
lines changed

.github/workflows/test-renode-nrf52.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,14 @@ jobs:
5858
- name: Renode Tests RSA4096
5959
run: ./tools/renode/docker-test.sh "SIGN=RSA4096"
6060

61-
#
62-
# LMS and ext_LMS tests
63-
#
6461
# LMS TEST
6562
- name: Renode Tests LMS-8-5-5
6663
run: ./tools/renode/docker-test.sh "SIGN=LMS LMS_LEVELS=2 LMS_HEIGHT=5 LMS_WINTERNITZ=8 WOLFBOOT_SMALL_STACK=0 IMAGE_SIGNATURE_SIZE=2644 IMAGE_HEADER_SIZE=5288"
6764

68-
# ext_LMS TEST
69-
- name: Renode Tests ext_LMS-8-5-5
70-
run: ./tools/renode/docker-test.sh "SIGN=ext_LMS LMS_LEVELS=2 LMS_HEIGHT=5 LMS_WINTERNITZ=8 WOLFBOOT_SMALL_STACK=0 IMAGE_SIGNATURE_SIZE=2644 IMAGE_HEADER_SIZE=5288"
71-
72-
#
73-
# XMSS and ext_XMSS tests
74-
#
7565
# XMSS TEST
7666
- name: Renode Tests XMSS-SHA2_10_256
7767
run: ./tools/renode/docker-test.sh "SIGN=XMSS XMSS_PARAMS='XMSS-SHA2_10_256' WOLFBOOT_SMALL_STACK=0 IMAGE_SIGNATURE_SIZE=2500 IMAGE_HEADER_SIZE=5000"
7868

79-
# ext_XMSS TEST
80-
- name: Renode Tests ext_XMSS-SHA2_10_256
81-
run: ./tools/renode/docker-test.sh "SIGN=ext_XMSS XMSS_PARAMS='XMSS-SHA2_10_256' WOLFBOOT_SMALL_STACK=0 IMAGE_SIGNATURE_SIZE=2500 IMAGE_HEADER_SIZE=5000"
82-
8369
# ML-DSA TEST
8470
- name: Renode Tests ML-DSA-44
8571
run: ./tools/renode/docker-test.sh "SIGN=ML_DSA ML_DSA_LEVEL=2 WOLFBOOT_SMALL_STACK=0 IMAGE_SIGNATURE_SIZE=2420 IMAGE_HEADER_SIZE=4840"

docs/PQ.md

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,9 @@ See these links for more info on stateful HBS support and wolfSSL/wolfCrypt:
103103

104104
### Supported PQ HBS Options
105105

106-
These four PQ signature options are supported:
106+
These two hash-based PQ signature options are supported:
107107
- LMS: uses wolfcrypt implementation from `wc_lms.c`, and `wc_lms_impl.c`.
108108
- XMSS: uses wolfcrypt implementation from `wc_xmss.c`, and `wc_xmss_impl.c`.
109-
- ext_LMS: uses external integration from `ext_lms.c`.
110-
- ext_XMSS: uses external integration from `ext_xmss.c`.
111109

112110
The wolfcrypt implementations are more performant and are recommended.
113111
The external integrations are experimental and for testing interoperability.
@@ -281,58 +279,3 @@ Creating hybrid signature
281279

282280
The resulting image `image_v1_signed.bin` contains both signatures, and can be verified using a wolfBoot with hybrid signature support.
283281

284-
## Building the external PQ Integrations
285-
286-
### ext_LMS Support
287-
288-
The external LMS/HSS support in wolfCrypt requires the hash-sigs library ( https://github.com/cisco/hash-sigs ).
289-
Use the following procedure to prepare hash-sigs for building with wolfBoot:
290-
291-
```
292-
$ cd lib
293-
$ mkdir hash-sigs
294-
$ls
295-
CMakeLists.txt hash-sigs wolfssl wolfTPM
296-
$ cd hash-sigs
297-
$ mkdir lib
298-
$ git clone https://github.com/cisco/hash-sigs.git src
299-
$ cd src
300-
$ git checkout b0631b8891295bf2929e68761205337b7c031726
301-
$ git apply ../../../tools/lms/0001-Patch-to-support-wolfBoot-LMS-build.patch
302-
```
303-
304-
Nothing more is needed, as wolfBoot will automatically produce the required
305-
hash-sigs build artifacts.
306-
307-
Note: the hash-sigs project only builds static libraries:
308-
- hss_verify.a: a single-threaded verify-only static lib.
309-
- hss_lib.a: a single-threaded static lib.
310-
- hss_lib_thread.a: a multi-threaded static lib.
311-
312-
The keytools utility links against `hss_lib.a`, as it needs full
313-
keygen, signing, and verifying functionality. However wolfBoot
314-
links directly with the subset of objects in the `hss_verify.a`
315-
build rule, as it only requires verify functionality.
316-
317-
318-
### ext_XMSS Support
319-
320-
The external XMSS/XMSS^MT support in wolfCrypt requires a patched version of the
321-
xmss-reference library ( https://github.com/XMSS/xmss-reference.git ).
322-
Use the following procedure to prepare xmss-reference for building with
323-
wolfBoot:
324-
325-
```
326-
$ cd lib
327-
$ git clone https://github.com/XMSS/xmss-reference.git xmss
328-
$ ls
329-
CMakeLists.txt wolfPKCS11 wolfTPM wolfssl xmss
330-
$ cd xmss
331-
$ git checkout 171ccbd26f098542a67eb5d2b128281c80bd71a6
332-
$ git apply ../../tools/xmss/0001-Patch-to-support-wolfSSL-xmss-reference-integration.patch
333-
```
334-
335-
The patch creates an addendum readme, `patch_readme.md`, with further comments.
336-
337-
Nothing more is needed beyond the patch step, as wolfBoot will handle building
338-
the xmss build artifacts it requires.

include/image.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ int wolfBot_get_dts_size(void *dts_addr);
122122
defined (WOLFBOOT_SIGN_ECC521)
123123
#define wolfBoot_verify_signature_primary wolfBoot_verify_signature_ecc
124124
#endif
125-
#if defined(WOLFBOOT_SIGN_LMS) || defined(WOLFBOOT_SIGN_ext_LMS)
125+
#if defined(WOLFBOOT_SIGN_LMS)
126126
#define wolfBoot_verify_signature_primary wolfBoot_verify_signature_lms
127127
#endif
128-
#if defined(WOLFBOOT_SIGN_XMSS ) || defined(WOLFBOOT_SIGN_ext_XMSS)
128+
#if defined(WOLFBOOT_SIGN_XMSS )
129129
#define wolfBoot_verify_signature_primary wolfBoot_verify_signature_xmss
130130
#endif
131131
#ifdef WOLFBOOT_SIGN_ML_DSA

options.mk

Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ ifneq ($(findstring RSA4096,$(SIGN)),)
338338
endif
339339
endif
340340

341-
ifneq (,$(filter $(SIGN), LMS ext_LMS))
341+
ifeq ($(SIGN),LMS)
342342
# For LMS the signature size is a function of the LMS parameters.
343343
# All five of these parms must be set in the LMS .config file:
344344
# LMS_LEVELS, LMS_HEIGHT, LMS_WINTERNITZ, IMAGE_SIGNATURE_SIZE,
@@ -377,38 +377,7 @@ ifeq ($(SIGN),LMS)
377377
endif
378378
endif
379379

380-
ifeq ($(SIGN),ext_LMS)
381-
LMSDIR = lib/hash-sigs
382-
KEYGEN_OPTIONS+=--lms
383-
SIGN_OPTIONS+=--lms
384-
CFLAGS+=-D"LMS_IMAGE_SIGNATURE_SIZE"=$(IMAGE_SIGNATURE_SIZE)
385-
WOLFCRYPT_OBJS+= \
386-
./$(LMSDIR)/src/hss_verify.o \
387-
./$(LMSDIR)/src/hss_verify_inc.o \
388-
./$(LMSDIR)/src/hss_common.o \
389-
./$(LMSDIR)/src/hss_thread_single.o \
390-
./$(LMSDIR)/src/hss_zeroize.o \
391-
./$(LMSDIR)/src/lm_common.o \
392-
./$(LMSDIR)/src/lm_ots_common.o \
393-
./$(LMSDIR)/src/lm_ots_verify.o \
394-
./$(LMSDIR)/src/lm_verify.o \
395-
./$(LMSDIR)/src/endian.o \
396-
./$(LMSDIR)/src/hash.o \
397-
./$(LMSDIR)/src/sha256.o \
398-
./lib/wolfssl/wolfcrypt/src/ext_lms.o
399-
CFLAGS+=-D"WOLFBOOT_SIGN_LMS" -D"WOLFSSL_HAVE_LMS" -D"HAVE_LIBLMS" \
400-
-D"LMS_LEVELS=$(LMS_LEVELS)" -D"LMS_HEIGHT=$(LMS_HEIGHT)" \
401-
-D"LMS_WINTERNITZ=$(LMS_WINTERNITZ)" -I$(LMSDIR)/src \
402-
-D"IMAGE_SIGNATURE_SIZE"=$(IMAGE_SIGNATURE_SIZE) \
403-
-D"WOLFSSL_LMS_VERIFY_ONLY"
404-
ifeq ($(WOLFBOOT_SMALL_STACK),1)
405-
$(error WOLFBOOT_SMALL_STACK with LMS not supported)
406-
else
407-
STACK_USAGE=1024
408-
endif
409-
endif
410-
411-
ifneq (,$(filter $(SIGN), XMSS ext_XMSS))
380+
ifeq ($(SIGN),XMSS)
412381
ifndef XMSS_PARAMS
413382
$(error XMSS_PARAMS not set)
414383
endif
@@ -436,39 +405,6 @@ ifeq ($(SIGN),XMSS)
436405
endif
437406
endif
438407

439-
ifeq ($(SIGN),ext_XMSS)
440-
# Use ext_xmss implementation.
441-
XMSSDIR = lib/xmss
442-
KEYGEN_OPTIONS+=--xmss
443-
SIGN_OPTIONS+=--xmss
444-
CFLAGS+=-D"XMSS_IMAGE_SIGNATURE_SIZE"=$(IMAGE_SIGNATURE_SIZE)
445-
WOLFCRYPT_OBJS+= \
446-
./$(XMSSDIR)/params.o \
447-
./$(XMSSDIR)/thash.o \
448-
./$(XMSSDIR)/hash_address.o \
449-
./$(XMSSDIR)/wots.o \
450-
./$(XMSSDIR)/xmss.o \
451-
./$(XMSSDIR)/xmss_core_fast.o \
452-
./$(XMSSDIR)/xmss_commons.o \
453-
./$(XMSSDIR)/utils.o \
454-
./lib/wolfssl/wolfcrypt/src/ext_xmss.o
455-
CFLAGS+=-D"WOLFBOOT_SIGN_XMSS" -D"WOLFSSL_HAVE_XMSS" -D"HAVE_LIBXMSS" \
456-
-DWOLFBOOT_XMSS_PARAMS=\"$(XMSS_PARAMS)\" -I$(XMSSDIR) \
457-
-D"IMAGE_SIGNATURE_SIZE"=$(IMAGE_SIGNATURE_SIZE) \
458-
-D"WOLFSSL_XMSS_VERIFY_ONLY" -D"XMSS_VERIFY_ONLY"
459-
ifeq ($(WOLFBOOT_SMALL_STACK),1)
460-
$(error WOLFBOOT_SMALL_STACK with XMSS not supported)
461-
else
462-
STACK_USAGE=2712
463-
endif
464-
endif
465-
466-
# Only needed if using 3rd party integration. This can be
467-
# removed if ext_lms and ext_xmss are deprecated.
468-
ifneq (,$(filter $(SIGN), ext_LMS ext_XMSS))
469-
CFLAGS +=-DWOLFSSL_EXPERIMENTAL_SETTINGS
470-
endif
471-
472408
ifeq ($(SIGN),ML_DSA)
473409
# Use wolfcrypt ML-DSA dilithium implementation.
474410
KEYGEN_OPTIONS+=--ml_dsa
@@ -901,14 +837,6 @@ ifeq ($(SIGN_ALG),)
901837
SIGN_ALG=$(SIGN)
902838
endif
903839

904-
ifeq ($(SIGN_ALG),ext_XMSS)
905-
SIGN_ALG=XMSS
906-
endif
907-
908-
ifeq ($(SIGN_ALG),ext_LMS)
909-
SIGN_ALG=LMS
910-
endif
911-
912840
ifneq ($(KEYVAULT_OBJ_SIZE),)
913841
CFLAGS+=-DKEYVAULT_OBJ_SIZE=$(KEYVAULT_OBJ_SIZE)
914842
endif

tools/scripts/renode-test-update.sh

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,6 @@ quit_renode() {
2020

2121
rm -f $RENODE_UART
2222

23-
# external LMS test
24-
if (echo $TEST_OPTIONS | grep "ext_LMS" &>/dev/null); then
25-
# Need git.
26-
apt install -y git
27-
28-
# Extra steps needed for external LMS support.
29-
# Need to clone the hash-sigs repo, and patch it for wolfBoot build.
30-
mkdir -p lib/hash-sigs/lib || exit 2
31-
git clone https://github.com/cisco/hash-sigs.git lib/hash-sigs/src || exit 2
32-
cd lib/hash-sigs/src && git checkout b0631b8891295bf2929e68761205337b7c031726 && \
33-
git apply ../../../tools/lms/0001-Patch-to-support-wolfBoot-LMS-build.patch &&\
34-
cd ../../.. || exit 2
35-
fi
36-
37-
# external XMSS test
38-
if (echo $TEST_OPTIONS | grep "ext_XMSS" &>/dev/null); then
39-
# Need git.
40-
apt install -y git
41-
42-
# Extra steps needed for external XMSS support.
43-
# Need to clone the xmss-reference repo, and patch it for wolfBoot build.
44-
cd lib || exit 2
45-
git clone https://github.com/XMSS/xmss-reference.git xmss || exit 2
46-
cd xmss && git checkout 171ccbd26f098542a67eb5d2b128281c80bd71a6 && \
47-
git apply ../../tools/xmss/0001-Patch-to-support-wolfSSL-xmss-reference-integration.patch &&\
48-
cd ../../ || exit 2
49-
fi
50-
5123
make keysclean
5224
make keytools
5325
make -C tools/test-expect-version

tools/test-renode.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ ifeq ($(SIGN),RSA4096)
8686
SIGN_ARGS+= --rsa4096
8787
endif
8888

89-
ifneq (,$(filter $(SIGN), LMS ext_LMS))
90-
SIGN_ARGS+= --lms
89+
ifeq ($(SIGN),LMS)
90+
SIGN_ARGS+= --lms
9191
endif
92-
ifneq (,$(filter $(SIGN), XMSS ext_XMSS))
93-
SIGN_ARGS+= --xmss
92+
93+
ifeq ($(SIGN),XMSS)
94+
SIGN_ARGS+= --xmss
9495
endif
9596

9697
ifeq ($(SIGN),ML_DSA)

tools/test.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ endif
4343
ifeq ($(SIGN),RSA4096)
4444
SIGN_ARGS+= --rsa4096
4545
endif
46-
ifneq (,$(filter $(SIGN), LMS ext_LMS))
46+
ifeq ($(SIGN),LMS)
4747
SIGN_ARGS+= --lms
4848
endif
49-
ifneq (,$(filter $(SIGN), XMSS ext_XMSS))
49+
ifeq ($(SIGN),XMSS)
5050
SIGN_ARGS+= --xmss
5151
endif
5252
ifeq ($(SIGN),ML_DSA)

0 commit comments

Comments
 (0)