Skip to content

Commit

Permalink
Merge pull request #48 from drewstone/drew/spelling
Browse files Browse the repository at this point in the history
Fix spelling of receive
  • Loading branch information
taskooh authored May 30, 2024
2 parents 6821195 + 1df7ca5 commit 1a5748d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions mpc-algebra/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub trait MpcSerNet: MpcNet {
})
}

fn recieve_from_king<T: CanonicalSerialize + CanonicalDeserialize>(out: Option<Vec<T>>) -> T {
fn receive_from_king<T: CanonicalSerialize + CanonicalDeserialize>(out: Option<Vec<T>>) -> T {
let bytes_in = Self::recv_bytes_from_king(out.map(|outs| {
outs.iter()
.map(|out| {
Expand Down Expand Up @@ -73,7 +73,7 @@ pub trait MpcSerNet: MpcNet {
f: impl Fn(Vec<T>) -> Vec<T>,
) -> T {
let king_response = Self::send_to_king(x).map(f);
Self::recieve_from_king(king_response)
Self::receive_from_king(king_response)
}
}

Expand Down
8 changes: 4 additions & 4 deletions mpc-algebra/src/share/additive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl<F: Field> Reveal for AdditiveFieldShare<F> {
let mut r: Vec<F> = (0..(Net::n_parties() - 1)).map(|_| F::rand(rng)).collect();
let sum_r: F = r.iter().sum();
r.push(f - sum_r);
Self::from_add_shared(Net::recieve_from_king(if Net::am_king() {
Self::from_add_shared(Net::receive_from_king(if Net::am_king() {
Some(r)
} else {
None
Expand All @@ -112,7 +112,7 @@ impl<F: Field> Reveal for AdditiveFieldShare<F> {
.map(|i| f[i] - &rs.iter().map(|r| &r[i]).sum())
.collect();
rs.push(final_shares);
Net::recieve_from_king(if Net::am_king() { Some(rs) } else { None })
Net::receive_from_king(if Net::am_king() { Some(rs) } else { None })
.into_iter()
.map(Self::from_add_shared)
.collect()
Expand Down Expand Up @@ -366,7 +366,7 @@ impl<G: Group, M> Reveal for AdditiveGroupShare<G, M> {
let mut r: Vec<G> = (0..(Net::n_parties() - 1)).map(|_| G::rand(rng)).collect();
let sum_r: G = r.iter().sum();
r.push(f - sum_r);
Self::from_add_shared(Net::recieve_from_king(if Net::am_king() {
Self::from_add_shared(Net::receive_from_king(if Net::am_king() {
Some(r)
} else {
None
Expand All @@ -380,7 +380,7 @@ impl<G: Group, M> Reveal for AdditiveGroupShare<G, M> {
.map(|i| f[i] - &rs.iter().map(|r| &r[i]).sum())
.collect();
rs.push(final_shares);
Net::recieve_from_king(if Net::am_king() { Some(rs) } else { None })
Net::receive_from_king(if Net::am_king() { Some(rs) } else { None })
.into_iter()
.map(Self::from_add_shared)
.collect()
Expand Down
8 changes: 4 additions & 4 deletions mpc-algebra/src/share/spdz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<F: Field> Reveal for SpdzFieldShare<F> {
let mut r: Vec<F> = (0..(Net::n_parties() - 1)).map(|_| F::rand(rng)).collect();
let sum_r: F = r.iter().sum();
r.push(f - sum_r);
Self::from_add_shared(Net::recieve_from_king(if Net::am_king() {
Self::from_add_shared(Net::receive_from_king(if Net::am_king() {
Some(r)
} else {
None
Expand All @@ -159,7 +159,7 @@ impl<F: Field> Reveal for SpdzFieldShare<F> {
.map(|i| f[i] - &rs.iter().map(|r| &r[i]).sum())
.collect();
rs.push(final_shares);
Net::recieve_from_king(if Net::am_king() { Some(rs) } else { None })
Net::receive_from_king(if Net::am_king() { Some(rs) } else { None })
.into_iter()
.map(Self::from_add_shared)
.collect()
Expand Down Expand Up @@ -305,7 +305,7 @@ impl<G: Group, M> Reveal for SpdzGroupShare<G, M> {
let mut r: Vec<G> = (0..(Net::n_parties() - 1)).map(|_| G::rand(rng)).collect();
let sum_r: G = r.iter().sum();
r.push(f - sum_r);
Self::from_add_shared(Net::recieve_from_king(if Net::am_king() {
Self::from_add_shared(Net::receive_from_king(if Net::am_king() {
Some(r)
} else {
None
Expand All @@ -319,7 +319,7 @@ impl<G: Group, M> Reveal for SpdzGroupShare<G, M> {
.map(|i| f[i] - &rs.iter().map(|r| &r[i]).sum())
.collect();
rs.push(final_shares);
Net::recieve_from_king(if Net::am_king() { Some(rs) } else { None })
Net::receive_from_king(if Net::am_king() { Some(rs) } else { None })
.into_iter()
.map(Self::from_add_shared)
.collect()
Expand Down

0 comments on commit 1a5748d

Please sign in to comment.