Skip to content

Commit

Permalink
fix an error
Browse files Browse the repository at this point in the history
  • Loading branch information
rw0x0 committed Jan 13, 2025
1 parent 63bbc11 commit 784747a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion iris-mpc-gpu/src/server/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ impl ServerActor {
&match_distances_buffers_codes_view,
&match_distances_buffers_masks_view,
batch_streams,
&[24577],
&[16384],
&mut self.buckets,
);

Expand Down
8 changes: 4 additions & 4 deletions iris-mpc-gpu/src/threshold_ring/cuda/kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ __device__ void arithmetic_xor_inner(T *res_a, T *lhs_a, T *lhs_b, T *rhs_a,
T rhs_b_val = *rhs_b;
T r1_val = *r1;
T r2_val = *r2;
T mul = (lhs_a_val * rhs_a_val) + (lhs_b_val * rhs_a_val) +

T mul = (lhs_a_val * rhs_a_val) + (lhs_b_val * rhs_a_val) +
(lhs_a_val * rhs_b_val) + r1_val - r2_val;
*res_a = lhs_a_val + rhs_a_val - 2 * mul;
}
Expand Down Expand Up @@ -457,10 +457,10 @@ extern "C" __global__ void shared_lifted_sub(U32 *mask_a, U32 *mask_b,
lifted_sub(&mask_b[i], &code_b[i], &output_b[i], a);
switch (id) {
case 0:
mask_a[i] -= 1; // Transforms the <= into <
output_a[i] -= 1; // Transforms the <= into <
break;
case 1:
mask_b[i] -= 1; // Transforms the <= into <
output_b[i] -= 1; // Transforms the <= into <
break;
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion iris-mpc-gpu/src/threshold_ring/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2414,7 +2414,7 @@ impl Circuits {
streams: &[CudaStream],
) {
const A: u64 = ((1. - 2. * iris_mpc_common::iris_db::iris::MATCH_THRESHOLD_RATIO)
* ((1 << 16) as f64)) as u64;
* ((1u64 << 16) as f64)) as u64;

assert_eq!(self.n_devices, code_dots.len());
assert_eq!(self.n_devices, mask_dots.len());
Expand Down

0 comments on commit 784747a

Please sign in to comment.