Skip to content

Commit

Permalink
Support SHA3 with ARMASM.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Oct 30, 2024
1 parent 2536eb2 commit 3eff52a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ ifeq ($(ARCH),AARCH64)
endif
ifeq ($(NO_ASM),0)
ARCH_FLAGS=-mstrict-align
CFLAGS+=$(ARCH_FLAGS) -DWOLFSSL_ARMASM -DWC_HASH_DATA_ALIGNMENT=8
CFLAGS+=$(ARCH_FLAGS) -DWOLFSSL_ARMASM -DWOLFSSL_ARMASM_INLINE -DWC_HASH_DATA_ALIGNMENT=8
WOLFCRYPT_OBJS += lib/wolfssl/wolfcrypt/src/port/arm/armv8-sha256.o \
lib/wolfssl/wolfcrypt/src/port/arm/armv8-sha3-asm_c.o \
lib/wolfssl/wolfcrypt/src/port/arm/armv8-aes.o
endif
endif
Expand Down
23 changes: 14 additions & 9 deletions include/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@
/* Stdlib Types */
#define CTYPE_USER /* don't let wolfCrypt types.h include ctype.h */

#ifndef WOLFSSL_ARMASM
#ifndef toupper
extern int toupper(int c);
#endif
#ifndef tolower
extern int tolower(int c);
#endif
#define XTOUPPER(c) toupper((c))
#define XTOLOWER(c) tolower((c))
#ifdef WOLFSSL_ARMASM
/* armv8 uses stdint types like uint64_t */
#ifdef __aarch64__
#include <stdint.h>
#endif
#else
#ifndef toupper
extern int toupper(int c);
#endif
#ifndef tolower
extern int tolower(int c);
#endif
#define XTOUPPER(c) toupper((c))
#define XTOLOWER(c) tolower((c))
#endif

#ifdef USE_FAST_MATH
Expand Down

0 comments on commit 3eff52a

Please sign in to comment.