Adjust BIGINT limits for new wolfSSL ECC+SMALLSTACK

pull/744/head
Daniele Lacamera 2026-04-07 14:14:44 +02:00
parent c710fe9078
commit 201c2c5c7e
4 changed files with 18 additions and 8 deletions

View File

@ -261,6 +261,8 @@ ifeq ($(TARGET),raspi3)
endif
ifeq ($(TARGET),sim)
CFLAGS+=-fno-pie
LDFLAGS+=-no-pie
MAIN_TARGET:=wolfboot.bin tools/bin-assemble/bin-assemble test-app/image_v1_signed.bin internal_flash.dd
endif

View File

@ -185,6 +185,7 @@ struct xmalloc_slot {
#define MP_CURVE_FIELD_COUNT_SIZE (380)
#ifndef _LP64
#define ECC_POINT_SIZE (412)
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6)
#else
#define ECC_POINT_SIZE (512)
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6)
@ -201,6 +202,7 @@ struct xmalloc_slot {
#define MP_CURVE_FIELD_COUNT_SIZE (380)
#ifndef _LP64
#define ECC_POINT_SIZE (520)
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6)
#else
#define ECC_POINT_SIZE (608)
#define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6)

View File

@ -53,7 +53,10 @@ ifeq ($(HASH),SHA3_384)
CFLAGS+=-D"WOLFBOOT_HASH_SHA3_384"
endif
STACK_USAGE_LIMIT:=1024
ifeq ($(TARGET),sim)
STACK_USAGE_LIMIT:=4608
endif
ifeq ($(TARGET),ti_hercules)
APP_OBJS:=app_$(TARGET).o ../test-app/libwolfboot.o
@ -63,7 +66,7 @@ else
# Stack usage computation not supported on TriCore
ifneq ($(ARCH),AURIX_TC3)
ifneq ($(USE_CLANG),1)
CFLAGS+=-Wstack-usage=1024
CFLAGS+=-Wstack-usage=$(STACK_USAGE_LIMIT)
endif
endif
CFLAGS+=-DTARGET_$(TARGET) -I../include
@ -509,6 +512,8 @@ ifeq ($(TARGET),sim)
# LD on MacOS does not support "-Map="
LDMAPSUPPORTED=$(shell $(CC) -Wl,-Map=image.map 2>&1 | grep 'unknown option')
LDFLAGS=
CFLAGS+=-fno-pie
LDFLAGS+=-no-pie
ifeq ($(FORCE_32BIT),1)
LDFLAGS+=-m32
CFLAGS+=-m32

View File

@ -1,7 +1,5 @@
# wolfBoot KeyGen and Signing Tool
-include ../../.config
V?=0
ifeq ($(V),0)
Q=@
@ -18,6 +16,7 @@ LD = gcc
WOLFBOOTDIR = ../..
CFLAGS = -Wall -Wextra -Werror
CFLAGS += -I. -DWOLFSSL_USER_SETTINGS -I$(WOLFBOOT_LIB_WOLFSSL) -I$(WOLFBOOTDIR)/include
DEPFLAGS = -MMD -MP
LDFLAGS =
OBJDIR = ./
LIBS =
@ -112,6 +111,7 @@ OBJS_REAL+=\
OBJS_REAL+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/dilithium.o
OBJS_VIRT=$(addprefix $(OBJDIR), $(notdir $(OBJS_REAL)))
DEPS=$(OBJS_VIRT:.o=.d) sign.d keygen.d
vpath %.c $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/
vpath %.c $(WOLFBOOTDIR)/src/
vpath %.c ./
@ -125,11 +125,11 @@ debug: all
# build objects
$(OBJDIR)/%.o: %.c
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
$(Q)$(CC) $(CFLAGS) $(DEPFLAGS) -c -o $@ $<
$(OBJDIR)/%.o: $(WOLFBOOTDIR)/src/%.c
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
$(Q)$(CC) $(CFLAGS) $(DEPFLAGS) -c -o $@ $<
$(OBJDIR)/%.o: $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/%.c
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
$(Q)$(CC) $(CFLAGS) $(DEPFLAGS) -c -o $@ $<
# build templates
sign: $(OBJS_VIRT) $(LIBS) sign.o
@ -141,5 +141,6 @@ keygen: $(OBJS_VIRT) $(LIBS) keygen.o
$(Q)$(LD) -o $@ $@.o $(OBJS_VIRT) $(LIBS) $(LDFLAGS)
clean:
rm -f sign keygen *.o
rm -f sign keygen *.o *.d
-include $(DEPS)