Fix ARM builds

Need to include options.h in assembly now.
bufPt declared in block but not outside.
poly1305_block and poly1305_blocks need prototype - declaration in
wolfcrypt/src/port/arm/armv8-poly1305.c (__arch64__ only).
This commit is contained in:
Sean Parkinson 2020-08-10 11:59:10 +10:00
parent 920c97963c
commit 72d1352bd6
3 changed files with 12 additions and 2 deletions

View File

@ -1029,6 +1029,8 @@ then
*aarch64*)
# +crypto needed for hardware acceleration
AM_CPPFLAGS="$AM_CPPFLAGS -mcpu=generic+crypto"
# Include options.h
AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
# Check for and set -mstrict-align compiler flag
# Used to set assumption that Aarch64 systems will not handle
@ -1048,6 +1050,8 @@ then
AC_MSG_NOTICE([64bit ARMv8 found, setting mcpu to generic+crypto]);;
*)
AM_CPPFLAGS="$AM_CPPFLAGS -mfpu=crypto-neon-fp-armv8"
# Include options.h
AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
AC_MSG_NOTICE([32bit ARMv8 found, setting mfpu to crypto-neon-fp-armv8]);;
esac
esac

View File

@ -1081,7 +1081,7 @@ static WC_INLINE int Sha256Final(wc_Sha256* sha256, byte* hash)
/* store lengths */
#if defined(LITTLE_ENDIAN_ORDER)
{
word32* bufPt = sha256->buffer;
word32* bufPt = sha256->buffer;
__asm__ volatile (
"VLD1.32 {q0}, [%[in]] \n"
"VREV32.8 q0, q0 \n"
@ -1106,7 +1106,7 @@ static WC_INLINE int Sha256Final(wc_Sha256* sha256, byte* hash)
XMEMCPY(&local[WC_SHA256_PAD_SIZE + sizeof(word32)], &sha256->loLen,
sizeof(word32));
bufPt = sha256->buffer;
word32* bufPt = sha256->buffer;
word32* digPt = sha256->digest;
__asm__ volatile (
"#load leftover data\n"

View File

@ -119,6 +119,12 @@ WOLFSSL_API int wc_Poly1305_EncodeSizes(Poly1305* ctx, word32 aadSz, word32 data
WOLFSSL_API int wc_Poly1305_MAC(Poly1305* ctx, byte* additional, word32 addSz,
byte* input, word32 sz, byte* tag, word32 tagSz);
#if defined(__aarch64__ ) && defined(WOLFSSL_ARMASM)
void poly1305_blocks(Poly1305* ctx, const unsigned char *m,
size_t bytes);
void poly1305_block(Poly1305* ctx, const unsigned char *m);
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif