Skip to content

Commit 136cb98

Browse files
dgarskeSparkiDev
authored andcommitted
Force 32-bit alignment on kCurve25519BasePoint
1 parent 0638ec2 commit 136cb98

10 files changed

Lines changed: 641 additions & 653 deletions

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2582,7 +2582,7 @@ then
25822582
AC_MSG_NOTICE([64bit ARMv8 found, setting mcpu to generic+crypto])
25832583
;;
25842584
armv7a*)
2585-
AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-a -mfpu=neon -DWOLFSSL_ARM_ARCH=7"
2585+
AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-a -mfpu=neon -DWOLFSSL_ARM_ARCH=7 -marm"
25862586
# Include options.h
25872587
AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
25882588
ENABLED_ARMASM_CRYPTO=no

src/include.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ endif
157157

158158
if BUILD_AES
159159
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/aes.c
160+
if BUILD_ARMASM
160161
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-aes.c
162+
endif BUILD_ARMASM
161163
if BUILD_ARMASM_NEON
162164
if !BUILD_ARMASM_CRYPTO
163165
if BUILD_ARMASM_INLINE
@@ -409,7 +411,9 @@ endif
409411
if !BUILD_FIPS_CURRENT
410412
if BUILD_AES
411413
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/aes.c
414+
if BUILD_ARMASM
412415
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-aes.c
416+
endif BUILD_ARMASM
413417
if BUILD_ARMASM_NEON
414418
if !BUILD_ARMASM_CRYPTO
415419
if BUILD_ARMASM_INLINE

wolfcrypt/src/curve25519.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const curve25519_set_type curve25519_sets[] = {
5858
}
5959
};
6060

61-
static const unsigned char kCurve25519BasePoint[CURVE25519_KEYSIZE] = {9};
61+
static const word32 kCurve25519BasePoint[CURVE25519_KEYSIZE/sizeof(word32)] = {9};
6262

6363
/* Curve25519 private key must be less than order */
6464
/* These functions clamp private k and check it */
@@ -133,7 +133,7 @@ int wc_curve25519_make_pub(int public_size, byte* pub, int private_size,
133133

134134
SAVE_VECTOR_REGISTERS(return _svr_ret;);
135135

136-
ret = curve25519(pub, priv, kCurve25519BasePoint);
136+
ret = curve25519(pub, priv, (byte*)kCurve25519BasePoint);
137137

138138
RESTORE_VECTOR_REGISTERS();
139139
#endif

0 commit comments

Comments
 (0)