Skip to content

Commit 0fd2cb8

Browse files
committed
Update wolfHSM pointer, fix minor issues
1 parent 5222385 commit 0fd2cb8

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

arch.mk

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,8 +1470,23 @@ ifeq ($(ARCH),sim)
14701470
LDFLAGS+=-m32
14711471
endif
14721472
ifeq ($(SPMATH),1)
1473-
MATH_OBJS += $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/sp_c32.o
1474-
CFLAGS+=-DWOLFSSL_SP_DIV_WORD_HALF
1473+
ifeq ($(FORCE_32BIT),1)
1474+
MATH_OBJS += $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/sp_c32.o
1475+
CFLAGS+=-DWOLFSSL_SP_DIV_WORD_HALF
1476+
else ifeq ($(shell uname -m),aarch64)
1477+
MATH_OBJS += $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/sp_c32.o
1478+
MATH_OBJS += $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/sp_arm64.o
1479+
else ifeq ($(shell uname -m),x86_64)
1480+
CFLAGS += -DARCH_x86_64 -DFAST_MEMCPY
1481+
ifeq ($(NO_ASM),1)
1482+
MATH_OBJS += $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/sp_c64.o
1483+
else
1484+
MATH_OBJS += $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/sp_x86_64.o
1485+
endif
1486+
else
1487+
MATH_OBJS += $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/sp_c32.o
1488+
CFLAGS+=-DWOLFSSL_SP_DIV_WORD_HALF
1489+
endif
14751490
endif
14761491
ifeq ($(WOLFHSM_CLIENT),1)
14771492
WOLFHSM_OBJS += $(WOLFBOOT_LIB_WOLFHSM)/port/posix/posix_transport_tcp.o

hal/sim.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ whCommServerConfig cs_conf[1] = {{
170170
}};
171171

172172
/* Crypto context */
173-
whServerCryptoContext crypto[1] = {{
174-
.devId = INVALID_DEVID,
175-
}};
173+
whServerCryptoContext crypto[1] = {0};
176174

177175
#if defined(WOLFHSM_CFG_SHE_EXTENSION)
178176
whServerSheContext she[1] = {{0}};

include/user_settings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ extern int tolower(int c);
146146
#endif
147147
# define WOLFSSL_SP_MATH
148148
# define WOLFSSL_SP_SMALL
149-
# define SP_WORD_SIZE 32
150149
# define WOLFSSL_HAVE_SP_ECC
151150
# define WOLFSSL_KEY_GEN
152151
# define HAVE_ECC_KEY_EXPORT
@@ -342,7 +341,8 @@ extern int tolower(int c);
342341
# elif defined(ARCH_RISCV64)
343342
# define HAVE___UINT128_T
344343
# define SP_WORD_SIZE 64
345-
# elif defined(ARCH_x86_64) && !defined(FORCE_32BIT)
344+
# elif (defined(ARCH_x86_64) || defined(__x86_64__) || defined(_M_X64)) && \
345+
!defined(FORCE_32BIT)
346346
# define SP_WORD_SIZE 64
347347
# ifndef NO_ASM
348348
# define WOLFSSL_SP_X86_64_ASM

lib/wolfHSM

Submodule wolfHSM updated 120 files

0 commit comments

Comments
 (0)