Skip to content

Commit

Permalink
fix pprf
Browse files Browse the repository at this point in the history
  • Loading branch information
lzjluzijie committed Nov 1, 2023
1 parent 95f0d86 commit cfa4726
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions libOTe/Tools/Subfield/Subfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ struct TypeTraitVec {
static constexpr size_t bitsF = sizeof(F) * 8;
static constexpr size_t bytesF = sizeof(F);
static constexpr size_t sizeBlocks = (bytesF + sizeof(block) - 1) / sizeof(block);
static constexpr size_t size = N;
union Buf {
F f;
block b[sizeBlocks];
Expand Down
8 changes: 8 additions & 0 deletions libOTe/Tools/Subfield/SubfieldPprf.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,10 @@ namespace osuCrypto::Subfield
sum[6] = sum[6] ^ child[6];
sum[7] = sum[7] ^ child[7];
} else {
if (getLastLevel(pprf.mDepth, treeIdx).size() <= childIdx) {
childIdx = width;
break;
}
auto& realChild = getLastLevel(pprf.mDepth, treeIdx)[childIdx];
auto& lastSum = lastSums[keep];
realChild[0] = TypeTrait::fromBlock(child[0]);
Expand Down Expand Up @@ -1246,6 +1250,10 @@ namespace osuCrypto::Subfield
sum[6] = sum[6] ^ child[6];
sum[7] = sum[7] ^ child[7];
} else {
if (getLastLevel(pprf.mDepth, treeIdx).size() <= childIdx) {
childIdx = width;
break;
}
auto& realChild = getLastLevel(pprf.mDepth, treeIdx)[childIdx];
auto& lastSum = lastSums[keep];
realChild[0] = TypeTrait::fromBlock(child[0]);
Expand Down

0 comments on commit cfa4726

Please sign in to comment.