Skip to content

Commit

Permalink
fix vole mpfss index overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
carlweng committed Feb 2, 2024
1 parent c2d1a16 commit 4a0d717
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion emp-zk/emp-vole-f2k/mpfss.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ template <typename IO> class MpfssRegF2k {
if (triple_x == nullptr or party == ALICE)
error("mpfss: set value vector error");
for (int i = 0; i < tree_n; ++i) {
int pt = i * leave_n + item_pos_recver[i];
int64_t pt = (int64_t)i * leave_n + (int64_t)item_pos_recver[i];
out[pt] = out[pt] ^ triple_x[i];
}
}
Expand Down
2 changes: 1 addition & 1 deletion emp-zk/emp-vole/mpfss_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ template <typename IO> class MpfssRegFp {

void set_vec_x(__uint128_t *out, __uint128_t *in) {
for (int i = 0; i < tree_n; ++i) {
int pt = i * leave_n + (item_pos_recver[i] % leave_n);
int64_t pt = (int64_t)i * leave_n + ((int64_t)item_pos_recver[i] % leave_n);
out[pt] = out[pt] ^ (__uint128_t)makeBlock(in[i], 0x0LL);
}
}
Expand Down

0 comments on commit 4a0d717

Please sign in to comment.