Skip to content

Commit

Permalink
fix the len issues in sending/receiving
Browse files Browse the repository at this point in the history
  • Loading branch information
rw0x0 committed Jan 22, 2025
1 parent 0d6be5d commit db43027
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions iris-mpc-gpu/src/threshold_ring/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,11 @@ impl Circuits {

result::group_start().unwrap();
self.comms[idx]
.send(&send_bufs, self.next_id, &streams[idx])
.send_view(
&send_bufs.slice(range.to_owned()),
self.next_id,
&streams[idx],
)
.unwrap();
let mut rcv = res.b.slice(range.to_owned());
self.comms[idx]
Expand Down Expand Up @@ -944,7 +948,7 @@ impl Circuits {
result::group_start().unwrap();
for (idx, res) in send_bufs.iter().enumerate() {
self.comms[idx]
.send(res, self.next_id, &streams[idx])
.send_view(&res.slice(range.to_owned()), self.next_id, &streams[idx])
.unwrap();
}
for (idx, res) in res.iter_mut().enumerate() {
Expand All @@ -969,9 +973,9 @@ impl Circuits {
.collect_vec();

result::group_start().unwrap();
for (idx, res) in send_bufs.iter().enumerate() {
for (idx, r) in send_bufs.iter().enumerate() {
self.comms[idx]
.send(res, self.next_id, &streams[idx])
.send_view(&r.slice(0..res[idx].len()), self.next_id, &streams[idx])
.unwrap();
}
for (idx, res) in res.iter_mut().enumerate() {
Expand All @@ -995,9 +999,9 @@ impl Circuits {
.collect_vec();

result::group_start().unwrap();
for (idx, res) in send_bufs.iter().enumerate() {
for (idx, r) in send_bufs.iter().enumerate() {
self.comms[idx]
.send(res, self.next_id, &streams[idx])
.send_view(&r.slice(0..res[idx].len()), self.next_id, &streams[idx])
.unwrap();
}
for (idx, res) in res.iter_mut().enumerate() {
Expand All @@ -1021,7 +1025,7 @@ impl Circuits {

result::group_start().unwrap();
self.comms[idx]
.send(&send_bufs, self.next_id, &streams[idx])
.send_view(&send_bufs.slice(0..res.len()), self.next_id, &streams[idx])
.unwrap();
self.comms[idx]
.receive_view(&mut res.b, self.prev_id, &streams[idx])
Expand Down

0 comments on commit db43027

Please sign in to comment.