From 36cd083faf3cf084dde93300499cfa64916005ea Mon Sep 17 00:00:00 2001 From: Peter Rindal Date: Mon, 22 Jan 2024 15:14:21 -0800 Subject: [PATCH] ENABLE_SSE Ctx --- libOTe/Tools/CoeffCtx.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libOTe/Tools/CoeffCtx.h b/libOTe/Tools/CoeffCtx.h index 7b8312a..ddf64ee 100644 --- a/libOTe/Tools/CoeffCtx.h +++ b/libOTe/Tools/CoeffCtx.h @@ -357,6 +357,8 @@ namespace osuCrypto { { // multiplication y modulo mod block y(0, 4234123421); + +#ifdef ENABLE_SSE static const constexpr std::uint64_t mod = 0b10000111; const __m128i modulus = _mm_loadl_epi64((const __m128i*) & (mod)); @@ -368,6 +370,9 @@ namespace osuCrypto { /* reduce w.r.t. high half of mul256_high */ auto tmp = _mm_clmulepi64_si128(xy2, modulus, 0x00); ret = _mm_xor_si128(xy1, tmp); +#else + ret = x.gf128Mul(y); +#endif } };