diff options
-rw-r--r-- | news.rst | 3 | ||||
-rw-r--r-- | src/lib/utils/simd/simd_32.h | 10 |
2 files changed, 5 insertions, 8 deletions
@@ -35,6 +35,9 @@ Version 2.3.0, Not Yet Released * Workaround a GCC 7 bug that caused miscompilation of the GOST-34.11 hash function on x86-32. (GH #882 #1148) +* Fix a bug in SIMD_4x32 which affected little-endian PowerPC processors. + This would cause test failures for Serpent, among other problems. + * Fix Altivec runtime detection, which was broken starting in Botan 2.1.0 * Silence a Clang warning in create_private_key (GH #1150) diff --git a/src/lib/utils/simd/simd_32.h b/src/lib/utils/simd/simd_32.h index def933f4a..6d9223a38 100644 --- a/src/lib/utils/simd/simd_32.h +++ b/src/lib/utils/simd/simd_32.h @@ -214,18 +214,12 @@ class SIMD_4x32 final #elif defined(BOTAN_SIMD_USE_ALTIVEC) - __vector unsigned char perm = vec_lvsl(0, static_cast<uint32_t*>(nullptr)); - if(CPUID::is_big_endian()) - { - perm = vec_xor(perm, vec_splat_u8(3)); // bswap vector - } - union { __vector unsigned int V; uint32_t R[4]; } vec; - vec.V = vec_perm(m_vmx, m_vmx, perm); - Botan::store_be(out, vec.R[0], vec.R[1], vec.R[2], vec.R[3]); + vec.V = m_vmx; + Botan::store_le(out, vec.R[0], vec.R[1], vec.R[2], vec.R[3]); #elif defined(BOTAN_SIMD_USE_NEON) |