Skip to content

Commit

Permalink
fix issue peihanmiao#6
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni-kaFruit committed Aug 5, 2022
1 parent 694921c commit 76faaef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions PSI/src/PsiReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace PSI {

for (auto i = 0; i < w; ++i) {
for (auto j = 0; j < receiverSize; ++j) {
auto location = (*(u32*)(transLocations[i] + j * locationInBytes)) & shift;
auto location = ((*(u32*)(transLocations[i] + j * locationInBytes)) & shift) % height;

matrixDelta[i][location >> 3] &= ~(1 << (location & 7));
}
Expand Down Expand Up @@ -174,7 +174,7 @@ namespace PSI {

for (auto i = 0; i < w; ++i) {
for (auto j = 0; j < receiverSize; ++j) {
auto location = (*(u32*)(transLocations[i] + j * locationInBytes)) & shift;
auto location = ((*(u32*)(transLocations[i] + j * locationInBytes)) & shift) % height;

transHashInputs[i + wLeft][j >> 3] |= (u8)((bool)(matrixA[i][location >> 3] & (1 << (location & 7)))) << (j & 7);
}
Expand Down
2 changes: 1 addition & 1 deletion PSI/src/PsiSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace PSI {

for (auto i = 0; i < w; ++i) {
for (auto j = 0; j < senderSize; ++j) {
auto location = (*(u32*)(transLocations[i] + j * locationInBytes)) & shift;
auto location = ((*(u32*)(transLocations[i] + j * locationInBytes)) & shift) % height;

transHashInputs[i + wLeft][j >> 3] |= (u8)((bool)(matrixC[i][location >> 3] & (1 << (location & 7)))) << (j & 7);
}
Expand Down

0 comments on commit 76faaef

Please sign in to comment.