Trait CircuitType

Source
pub trait CircuitType: Clone {
    type Gate: GateType;

Show 17 methods // Required methods fn increment_nonfree_gates(&mut self); fn new(ngates: Option<usize>) -> Self; fn get_output_refs(&self) -> &[CircuitRef]; fn get_garbler_input_refs(&self) -> &[CircuitRef]; fn get_evaluator_input_refs(&self) -> &[CircuitRef]; fn get_num_nonfree_gates(&self) -> usize; fn push_gates(&mut self, gate: Self::Gate); fn push_const_ref(&mut self, xref: CircuitRef); fn push_output_ref(&mut self, xref: CircuitRef); fn push_garbler_input_ref(&mut self, xref: CircuitRef); fn push_evaluator_input_ref(&mut self, xref: CircuitRef); fn push_modulus(&mut self, modulus: u16); fn garbler_input_mod(&self, i: usize) -> u16; fn evaluator_input_mod(&self, i: usize) -> u16; // Provided methods fn num_garbler_inputs(&self) -> usize { ... } fn num_evaluator_inputs(&self) -> usize { ... } fn noutputs(&self) -> usize { ... }
}
Expand description

Trait representing circuits that can be built by CircuitBuilder

Required Associated Types§

Source

type Gate: GateType

Gates that the circuit is composed of

Required Methods§

Source

fn increment_nonfree_gates(&mut self)

Increase number of nonfree gates

Source

fn new(ngates: Option<usize>) -> Self

Make a new Circuit object.

Source

fn get_output_refs(&self) -> &[CircuitRef]

Get all output refs

Source

fn get_garbler_input_refs(&self) -> &[CircuitRef]

Get all garbler input refs

Source

fn get_evaluator_input_refs(&self) -> &[CircuitRef]

Get all evaluator input refs

Source

fn get_num_nonfree_gates(&self) -> usize

Get number of nonfree gates

Source

fn push_gates(&mut self, gate: Self::Gate)

Add a gate

Source

fn push_const_ref(&mut self, xref: CircuitRef)

Add a constant ref

Source

fn push_output_ref(&mut self, xref: CircuitRef)

Add an output ref

Source

fn push_garbler_input_ref(&mut self, xref: CircuitRef)

Add a garbler input ref

Source

fn push_evaluator_input_ref(&mut self, xref: CircuitRef)

Add an evaluator input ref

Source

fn push_modulus(&mut self, modulus: u16)

Add wire moulus

Source

fn garbler_input_mod(&self, i: usize) -> u16

Return the modulus of the garbler input indexed by i.

Source

fn evaluator_input_mod(&self, i: usize) -> u16

Return the modulus of the evaluator input indexed by i.

Provided Methods§

Source

fn num_garbler_inputs(&self) -> usize

Return the number of garbler inputs.

Source

fn num_evaluator_inputs(&self) -> usize

Return the number of evaluator inputs.

Source

fn noutputs(&self) -> usize

Return the number of outputs.

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§