BinaryWireLabel

Trait BinaryWireLabel 

Source
pub trait BinaryWireLabel: WireLabel + ConditionallySelectable {
    // Required methods
    fn garble_and_gate(
        gate_num: usize,
        A: &Self,
        B: &Self,
        delta: &Self,
    ) -> (U8x16, U8x16, Self);
    fn evaluate_and_gate(
        gate_num: usize,
        A: &Self,
        B: &Self,
        gate0: &U8x16,
        gate1: &U8x16,
    ) -> Self;
}
Expand description

The BinaryWireLabel provides the subroutines to implement AND gates for the garbler and evaluator in crate::fancy::FancyBinary.

Required Methods§

Source

fn garble_and_gate( gate_num: usize, A: &Self, B: &Self, delta: &Self, ) -> (U8x16, U8x16, Self)

Garbles an ‘and’ gate given two input wires and the delta.

Outputs a tuple consisting of the two gates (that should be transfered to the evaluator) and the next wirelabel for the garbler.

Source

fn evaluate_and_gate( gate_num: usize, A: &Self, B: &Self, gate0: &U8x16, gate1: &U8x16, ) -> Self

Evaluates an ‘and’ gate given two inputs wires and two half-gates from the garbler.

Outputs C = A & B

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§