Skip to content

Commit

Permalink
ENABLE_SSE Ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
ladnir committed Jan 22, 2024
1 parent f9ba771 commit 36cd083
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libOTe/Tools/CoeffCtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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
}
};

Expand Down

0 comments on commit 36cd083

Please sign in to comment.