Skip to content

Commit

Permalink
build(deps): Updated swanky, remove GC::mux since swanky now has the …
Browse files Browse the repository at this point in the history
…optimized version
  • Loading branch information
rw0x0 committed Nov 6, 2024
1 parent 7d38334 commit 1a6d6b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions mpc-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ ark-ff = { workspace = true }
ark-serialize = { workspace = true }
bytes = { workspace = true }
eyre = { workspace = true }
fancy-garbling = { git = "https://github.com/GaloisInc/swanky", rev = "586a6ba1efdb531542668d6b0afe5cacc302d434" }
fancy-garbling = { git = "https://github.com/GaloisInc/swanky", rev = "5ff648457218b74da9d8323b7ca47166ff5be4b3" }
itertools = { workspace = true }
mpc-net = { version = "0.1.2", path = "../mpc-net" }
num-bigint = { workspace = true }
num-traits = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
rayon = { workspace = true }
scuttlebutt = { git = "https://github.com/GaloisInc/swanky", rev = "586a6ba1efdb531542668d6b0afe5cacc302d434" }
scuttlebutt = { git = "https://github.com/GaloisInc/swanky", rev = "5ff648457218b74da9d8323b7ca47166ff5be4b3" }
subtle = { workspace = true }
serde = { workspace = true }
sha3 = { workspace = true }
Expand Down
15 changes: 2 additions & 13 deletions mpc-core/src/protocols/rep3/yao/circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,7 @@ impl GarbledCircuits {
Ok(c)
}

/// If `b = 0` returns `x` else `y`.
fn mux<G: FancyBinary>(
g: &mut G,
b: &G::Item,
x: &G::Item,
y: &G::Item,
) -> Result<G::Item, G::Error> {
// let r = g.mux(&ov, s, a)?; // Has two ANDs, only need one though
let xor = g.xor(x, y)?;
let and = g.and(b, &xor)?;
g.xor(&and, x)
}


fn sub_p_and_mux_with_output_size<G: FancyBinary, F: PrimeField>(
g: &mut G,
Expand Down Expand Up @@ -225,7 +214,7 @@ impl GarbledCircuits {
let mut result = Vec::with_capacity(outlen);
for (s, a) in subtracted.iter().zip(wires.iter()).take(outlen) {
// CMUX
let r = Self::mux(g, &ov, s, a)?;
let r = g.mux(&ov, s, a)?;
result.push(r);
}

Expand Down

0 comments on commit 1a6d6b6

Please sign in to comment.