Fix crash in GCM mode on ARM with -mthumb

pull/853/head
Jeffrey Walton 2019-05-21 04:03:22 -04:00
parent 08235400b0
commit 6acbbf1849
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 1 additions and 8 deletions

View File

@ -60,10 +60,6 @@
#define M128_CAST(x) ((__m128i *)(void *)(x))
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
// GCC cast warning
#define UINT64X2_CAST(x) ((uint64x2_t *)(void *)(x))
#define CONST_UINT64X2_CAST(x) ((const uint64x2_t *)(const void *)(x))
// Squash MS LNK4221 and libtool warnings
extern const char GCM_SIMD_FNAME[] = __FILE__;
@ -219,10 +215,7 @@ bool CPU_ProbePMULL()
#if CRYPTOPP_ARM_NEON_AVAILABLE
void GCM_Xor16_NEON(byte *a, const byte *b, const byte *c)
{
CRYPTOPP_ASSERT(IsAlignedOn(a,GetAlignmentOf<uint64x2_t>()));
CRYPTOPP_ASSERT(IsAlignedOn(b,GetAlignmentOf<uint64x2_t>()));
CRYPTOPP_ASSERT(IsAlignedOn(c,GetAlignmentOf<uint64x2_t>()));
*UINT64X2_CAST(a) = veorq_u64(*CONST_UINT64X2_CAST(b), *CONST_UINT64X2_CAST(c));
vst1q_u8(a, veorq_u8(vld1q_u8(b), vld1q_u8(c)));
}
#endif // CRYPTOPP_ARM_NEON_AVAILABLE