pub struct GarbledCircuit<W> { /* private fields */ }Expand description
A garbled circuit.
A garbled circuit at its core is just a vector of garbled rows and constant wirelabels.
Implementations§
Source§impl<W: WireLabel<F2>> GarbledCircuit<W>
impl<W: WireLabel<F2>> GarbledCircuit<W>
Sourcepub fn new(blocks: Vec<U8x16>) -> Self
pub fn new(blocks: Vec<U8x16>) -> Self
Create a GarbledCircuit from a vector of garbled rows and constant
wirelabels.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
The number of garbled rows and constant wires in the garbled circuit.
Sourcepub fn garble<C: CircuitInputMapper<Garbler<W, RNG>> + CircuitOutputMapper<Garbler<W, RNG>>, RNG: CryptoRng + SeedableRng>(
circuit: &C,
rng: &mut RNG,
) -> Result<(Encoder<W>, Self)>
pub fn garble<C: CircuitInputMapper<Garbler<W, RNG>> + CircuitOutputMapper<Garbler<W, RNG>>, RNG: CryptoRng + SeedableRng>( circuit: &C, rng: &mut RNG, ) -> Result<(Encoder<W>, Self)>
Garble a circuit.
This outputs an Encoder for encoding inputs into their associated
wirelabels, and the garbled circuit itself.
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for GarbledCircuit<W>
impl<W> RefUnwindSafe for GarbledCircuit<W>where
W: RefUnwindSafe,
impl<W> Send for GarbledCircuit<W>where
W: Send,
impl<W> Sync for GarbledCircuit<W>where
W: Sync,
impl<W> Unpin for GarbledCircuit<W>where
W: Unpin,
impl<W> UnsafeUnpin for GarbledCircuit<W>
impl<W> UnwindSafe for GarbledCircuit<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> IsSameType<T> for T
impl<T> IsSameType<T> for T
§type EqualityProposition = TrueEqualityProposition
type EqualityProposition = TrueEqualityProposition
The [
EqualityProposition] that Self == T