Merge pull request #1988 from JacobBarthelmeh/ARMv8

add -mstrict-align flag with armasm
This commit is contained in:
toddouska
2018-12-18 15:51:32 -08:00
committed by GitHub
2 changed files with 19 additions and 3 deletions

View File

@@ -970,6 +970,22 @@ then
*aarch64*) *aarch64*)
# +crypto needed for hardware acceleration # +crypto needed for hardware acceleration
AM_CPPFLAGS="$AM_CPPFLAGS -mcpu=generic+crypto" AM_CPPFLAGS="$AM_CPPFLAGS -mcpu=generic+crypto"
# Check for and set -mstrict-align compiler flag
# Used to set assumption that Aarch64 systems will not handle
# unaligned memory references. The flag -mstrict-align is needed
# on some compiler versions to avoid an invalid addressing mode
# error with "m" constraint variables in the inline assembly AES
# code. Even though unaligned load/store access is permitted on
# normal memory with Cortex-A series boards with the exception
# being exclusive and ordered access.
case $CPPFLAGS in
*mstrict-align*)
break;; # already set by user
*)
AM_CPPFLAGS="$AM_CPPFLAGS -mstrict-align"
AC_MSG_NOTICE([64bit ARMv8, setting -mstrict-align]);;
esac
AC_MSG_NOTICE([64bit ARMv8 found, setting mcpu to generic+crypto]);; AC_MSG_NOTICE([64bit ARMv8 found, setting mcpu to generic+crypto]);;
*) *)
AM_CPPFLAGS="$AM_CPPFLAGS -mfpu=crypto-neon-fp-armv8" AM_CPPFLAGS="$AM_CPPFLAGS -mfpu=crypto-neon-fp-armv8"

View File

@@ -4198,7 +4198,7 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
/* sanity checks */ /* sanity checks */
if (aes == NULL || (iv == NULL && ivSz > 0) || if (aes == NULL || (iv == NULL && ivSz > 0) ||
(authTag == NULL) || (authTag == NULL) ||
(authIn == NULL) || (authIn == NULL && authInSz > 0) ||
(in == NULL && sz > 0) || (in == NULL && sz > 0) ||
(out == NULL && sz > 0)) { (out == NULL && sz > 0)) {
WOLFSSL_MSG("a NULL parameter passed in when size is larger than 0"); WOLFSSL_MSG("a NULL parameter passed in when size is larger than 0");
@@ -4282,7 +4282,7 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
/* sanity checks */ /* sanity checks */
if (aes == NULL || (iv == NULL && ivSz > 0) || if (aes == NULL || (iv == NULL && ivSz > 0) ||
(authTag == NULL) || (authTag == NULL) ||
(authIn == NULL) || (authIn == NULL && authInSz > 0) ||
(in == NULL && sz > 0) || (in == NULL && sz > 0) ||
(out == NULL && sz > 0)) { (out == NULL && sz > 0)) {
WOLFSSL_MSG("a NULL parameter passed in when size is larger than 0"); WOLFSSL_MSG("a NULL parameter passed in when size is larger than 0");