Skip to content

Commit

Permalink
better pprf if guards on types
Browse files Browse the repository at this point in the history
  • Loading branch information
ladnir committed Jun 14, 2024
1 parent b2a6c29 commit 21c1bcf
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libOTe/Tools/Pprf/RegularPprf.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,10 @@ namespace osuCrypto
{
// The child that we will write in this iteration.

if constexpr (std::is_same_v<F, block>)
if constexpr (std::is_same_v<F, block> && (
std::is_same_v<CoeffCtx, CoeffCtxGF2> ||
std::is_same_v<CoeffCtx, CoeffCtxGF128>)
)
{
gGgmAes.data()[keep].hashBlocks<8>(parent.data(), outIter);
}
Expand Down Expand Up @@ -704,6 +707,7 @@ namespace osuCrypto
bool programPuncturedPoint,
u64 numThreads,
CoeffCtx ctx = {})
try
{
MACORO_TRY{
pprf::validateExpandFormat(oFormat, output, mDomain, mPntCount);
Expand Down Expand Up @@ -1029,9 +1033,12 @@ namespace osuCrypto

for (u64 keep = 0; keep < 2; ++keep, ++childIdx)
{
if constexpr (std::is_same_v<F, block>)
{
gGgmAes.data()[keep].hashBlocks<8>(parent.data(), outIter);
if constexpr (std::is_same_v<F, block> && (
std::is_same_v<CoeffCtx, CoeffCtxGF2> ||
std::is_same_v<CoeffCtx, CoeffCtxGF128>
))
{
gGgmAes.data()[keep].hashBlocks<8>(parent.data(), outIter);
}
else
{
Expand Down

0 comments on commit 21c1bcf

Please sign in to comment.