From acf5c7de1034fa59d338adb403296aee2b1dfcf1 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 8 Apr 2020 02:59:38 -0400 Subject: [PATCH] Update SPECK64 and SPECK128 OptimalDataAlignment --- ppc_simd.h | 2 +- speck.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ppc_simd.h b/ppc_simd.h index e7b0d2ad..8462c936 100644 --- a/ppc_simd.h +++ b/ppc_simd.h @@ -281,7 +281,7 @@ inline uint32x4_p VecLoad_ALTIVEC(int off, const byte src[16]) // http://www.nxp.com/docs/en/reference-manual/ALTIVECPEM.pdf const uint8x16_p perm = vec_lvsl(off, src); const uint8x16_p low = vec_ld(off, src); - const uint8x16_p high = vec_ld(15, src); + const uint8x16_p high = vec_ld(off+15, src); return (uint32x4_p)vec_perm(low, high, perm); } } diff --git a/speck.cpp b/speck.cpp index 72d9d5cd..01ea6f9b 100644 --- a/speck.cpp +++ b/speck.cpp @@ -240,15 +240,15 @@ unsigned int SPECK64::Base::OptimalDataAlignment() const #if (CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS) # if (CRYPTOPP_SSE41_AVAILABLE) if (HasSSE41()) - return 16; + return 16; // load __m128i # endif # if (CRYPTOPP_ARM_NEON_AVAILABLE) if (HasNEON()) - return 4; + return 4; // load uint32x4_t # endif # if (CRYPTOPP_ALTIVEC_AVAILABLE) if (HasAltivec()) - return 16; + return 16; // load uint32x4_p # endif #endif return GetAlignmentOf(); @@ -368,15 +368,15 @@ unsigned int SPECK128::Base::OptimalDataAlignment() const #if (CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS) # if (CRYPTOPP_SSSE3_AVAILABLE) if (HasSSSE3()) - return 16; + return 16; // load __m128i # endif # if (CRYPTOPP_ARM_NEON_AVAILABLE) if (HasNEON()) - return 8; + return 8; // load uint64x2_t # endif # if (CRYPTOPP_ALTIVEC_AVAILABLE) if (HasAltivec()) - return 8; + return 16; // load uint64x2_p # endif #endif return GetAlignmentOf();