Skip to content

Commit

Permalink
Fix compilation of GHASH with ARMv8 pmull
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit committed Dec 18, 2024
1 parent c8ffa1f commit 83d1b67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ BOTAN_FORCE_INLINE SIMD_4x32 BOTAN_FUNC_ISA(BOTAN_CLMUL_ISA) clmul(const SIMD_4x
#elif defined(BOTAN_SIMD_USE_NEON)
const uint64_t a = vgetq_lane_u64(vreinterpretq_u64_u32(x.raw()), M & 0x01);
const uint64_t b = vgetq_lane_u64(vreinterpretq_u64_u32(H.raw()), (M & 0x10) >> 4);
return SIMD_4x32(reinterpret_cast<uint32x4_t>(vmull_p64(a, b)));

#if defined(BOTAN_BUILD_COMPILER_IS_MSVC)
__n64 a1 = {a}, b1 = {b};
return SIMD_4x32(vmull_p64(a1, b1));
#else
return SIMD_4x32(reinterpret_cast<uint32x4_t>(vmull_p64(a, b)));
#endif

#elif defined(BOTAN_SIMD_USE_ALTIVEC)
const SIMD_4x32 mask_lo = SIMD_4x32(0, 0, 0xFFFFFFFF, 0xFFFFFFFF);

Expand Down

0 comments on commit 83d1b67

Please sign in to comment.