EvaluableCircuit

Trait EvaluableCircuit 

Source
pub trait EvaluableCircuit<F: Fancy>: CircuitType {
    // Required method
    fn eval_to_wirelabels(
        &self,
        f: &mut F,
        garbler_inputs: &[F::Item],
        evaluator_inputs: &[F::Item],
        channel: &mut Channel<'_>,
    ) -> Result<Vec<F::Item>>;

    // Provided method
    fn eval(
        &self,
        f: &mut F,
        garbler_inputs: &[F::Item],
        evaluator_inputs: &[F::Item],
        channel: &mut Channel<'_>,
    ) -> Result<Option<Vec<u16>>> { ... }
}
Expand description

A Circuit that can be evaluated by a given Fancy object

Supertrait ensures that circuit can be built by CircuitBuilder

Required Methods§

Source

fn eval_to_wirelabels( &self, f: &mut F, garbler_inputs: &[F::Item], evaluator_inputs: &[F::Item], channel: &mut Channel<'_>, ) -> Result<Vec<F::Item>>

Evaluate the circuit up to producing the output Fancy::Items, and output those.

The argument f provides the Fancy instantiation to use during evaluation, and the actual circuit data is accessed using channel. The output is a vector of Fancy::Items that correspond to the outputs of the circuit evaluation.

Provided Methods§

Source

fn eval( &self, f: &mut F, garbler_inputs: &[F::Item], evaluator_inputs: &[F::Item], channel: &mut Channel<'_>, ) -> Result<Option<Vec<u16>>>

Evaluate the circuit.

The argument f provides the Fancy instantiation to use during evaluation, and the actual circuit data is accessed using channel. The output is a vector of Option<u16>s because certain Fancy instantiations may not output anything (for example, a garbler doesn’t have an “output”, so None would be returned here).

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§