Skip to content

Commit

Permalink
LMS support: cleanup build, and fix MacOS build.
Browse files Browse the repository at this point in the history
  • Loading branch information
philljj committed Aug 24, 2023
1 parent f99aef6 commit f2339e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ ifeq ($(SIGN),LMS)
LMSDIR = lib/hash-sigs
KEYGEN_OPTIONS+=--lms
SIGN_OPTIONS+=--lms
LIBS += $(LMSDIR)/hss_lib.a
WOLFCRYPT_OBJS+= \
./lib/wolfssl/wolfcrypt/src/ext_lms.o \
./lib/wolfssl/wolfcrypt/src/hash.o \
Expand All @@ -326,7 +327,6 @@ ifeq ($(SIGN),LMS)
-D"LMS_WINTERNITZ=$(LMS_WINTERNITZ)" -I"$(LMSDIR)" \
-D"IMAGE_SIGNATURE_SIZE"=$(IMAGE_SIGNATURE_SIZE) \
-D"PRINTF_ENABLED"
LD_END_GROUP+=-L./$(LMSDIR) -l:hss_lib.a
ifeq ($(WOLFBOOT_SMALL_STACK),1)
$(error WOLFBOOT_SMALL_STACK with LMS not supported)
else
Expand Down
11 changes: 6 additions & 5 deletions tools/keytools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ CFLAGS = -Wall -Wextra -Werror
CFLAGS += -I. -DWOLFSSL_USER_SETTINGS -I$(WOLFDIR) -I$(WOLFBOOTDIR)/include -DWOLFBOOT_KEYTOOLS
LDFLAGS =
OBJDIR = ./
LIBS =

ifeq ($(SIGN),LMS)
LMSDIR = $(WOLFBOOTDIR)/lib/hash-sigs/
LDFLAGS+=-L$(LMSDIR) -l:hss_lib.a
LIBS += $(LMSDIR)/hss_lib.a
CFLAGS +=-DWOLFBOOT_SIGN_LMS -DWOLFSSL_HAVE_LMS -DHAVE_LIBLMS -I$(LMSDIR) \
-D"LMS_LEVELS=$(LMS_LEVELS)" -D"LMS_HEIGHT=$(LMS_HEIGHT)" \
-D"LMS_WINTERNITZ=$(LMS_WINTERNITZ)"
Expand Down Expand Up @@ -112,13 +113,13 @@ $(OBJDIR)/%.o: $(WOLFDIR)/wolfcrypt/src/%.c
$(Q)$(CC) $(CFLAGS) -c -o $@ $<

# build templates
sign: $(OBJS_VIRT) sign.o
sign: $(OBJS_VIRT) $(LIBS) sign.o
@echo "Building signing tool"
$(Q)$(LD) -o $@ $@.o $(OBJS_VIRT) $(LDFLAGS)
$(Q)$(LD) -o $@ $@.o $(OBJS_VIRT) $(LIBS) $(LDFLAGS)

keygen: $(OBJS_VIRT) keygen.o
keygen: $(OBJS_VIRT) $(LIBS) keygen.o
@echo "Building keygen tool"
$(Q)$(LD) -o $@ $@.o $(OBJS_VIRT) $(LDFLAGS)
$(Q)$(LD) -o $@ $@.o $(OBJS_VIRT) $(LIBS) $(LDFLAGS)

clean:
rm -f sign keygen *.o

0 comments on commit f2339e1

Please sign in to comment.