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§
Required Methods§
Sourcefn increment_nonfree_gates(&mut self)
fn increment_nonfree_gates(&mut self)
Increase number of nonfree gates
Sourcefn get_output_refs(&self) -> &[CircuitRef]
fn get_output_refs(&self) -> &[CircuitRef]
Get all output refs
Sourcefn get_garbler_input_refs(&self) -> &[CircuitRef]
fn get_garbler_input_refs(&self) -> &[CircuitRef]
Get all garbler input refs
Sourcefn get_evaluator_input_refs(&self) -> &[CircuitRef]
fn get_evaluator_input_refs(&self) -> &[CircuitRef]
Get all evaluator input refs
Sourcefn get_num_nonfree_gates(&self) -> usize
fn get_num_nonfree_gates(&self) -> usize
Get number of nonfree gates
Sourcefn push_gates(&mut self, gate: Self::Gate)
fn push_gates(&mut self, gate: Self::Gate)
Add a gate
Sourcefn push_const_ref(&mut self, xref: CircuitRef)
fn push_const_ref(&mut self, xref: CircuitRef)
Add a constant ref
Sourcefn push_output_ref(&mut self, xref: CircuitRef)
fn push_output_ref(&mut self, xref: CircuitRef)
Add an output ref
Sourcefn push_garbler_input_ref(&mut self, xref: CircuitRef)
fn push_garbler_input_ref(&mut self, xref: CircuitRef)
Add a garbler input ref
Sourcefn push_evaluator_input_ref(&mut self, xref: CircuitRef)
fn push_evaluator_input_ref(&mut self, xref: CircuitRef)
Add an evaluator input ref
Sourcefn push_modulus(&mut self, modulus: u16)
fn push_modulus(&mut self, modulus: u16)
Add wire moulus
Sourcefn garbler_input_mod(&self, i: usize) -> u16
fn garbler_input_mod(&self, i: usize) -> u16
Return the modulus of the garbler input indexed by i.
Sourcefn evaluator_input_mod(&self, i: usize) -> u16
fn evaluator_input_mod(&self, i: usize) -> u16
Return the modulus of the evaluator input indexed by i.
Provided Methods§
Sourcefn num_garbler_inputs(&self) -> usize
fn num_garbler_inputs(&self) -> usize
Return the number of garbler inputs.
Sourcefn num_evaluator_inputs(&self) -> usize
fn num_evaluator_inputs(&self) -> usize
Return the number of evaluator inputs.
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.