pub enum CombineOperation {
GF2(Operation<bool>),
Z64(Operation<u64>),
B2A(usize, usize),
SizeHint(usize, usize),
}Expand description
Wraps Operation to define a field for each gate. Also supports conversions and metadata.
Variants§
GF2(Operation<bool>)
Circuit Operation on GF2 Finite Field
Z64(Operation<u64>)
Circuit Operation on 64-bit integer ring
B2A(usize, usize)
Converts a value on GF2 to a value on Z64. Takes: (dst, src) where src is the low bit of the 64-bit GF2 slice. This means that the least significant bit of the Z64 value will come from the GF2 wire with the lowest index. Make sure your circuits are designed accordingly.
SizeHint(usize, usize)
Information about the number of wires needed to evaluate the circuit. As with B2A, first item is Z64, second is GF2.
Trait Implementations§
Source§impl Clone for CombineOperation
impl Clone for CombineOperation
Source§fn clone(&self) -> CombineOperation
fn clone(&self) -> CombineOperation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CombineOperation
impl Debug for CombineOperation
Source§impl<'de> Deserialize<'de> for CombineOperation
impl<'de> Deserialize<'de> for CombineOperation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HasConst<bool> for CombineOperation
impl HasConst<bool> for CombineOperation
Source§impl HasConst<u64> for CombineOperation
impl HasConst<u64> for CombineOperation
Source§impl HasIO for CombineOperation
impl HasIO for CombineOperation
fn inputs(&self) -> InputIterator<'_, CombineOperation>
fn outputs(&self) -> OutputIterator<'_, CombineOperation>
Source§impl Identity<bool> for CombineOperation
impl Identity<bool> for CombineOperation
Source§impl Identity<u64> for CombineOperation
impl Identity<u64> for CombineOperation
Source§impl PartialEq for CombineOperation
impl PartialEq for CombineOperation
Source§impl Serialize for CombineOperation
impl Serialize for CombineOperation
Source§impl Translatable for CombineOperation
impl Translatable for CombineOperation
Source§fn translate<'a, I1, I2>(&self, win: I1, wout: I2) -> Option<Self>
fn translate<'a, I1, I2>(&self, win: I1, wout: I2) -> Option<Self>
takes an iterator of input wires and an iterator of output wires, and creates a new gate
of the same type using the inputs and outputs. The current input and output wires have
no bearing on the new wires, just the gate type.
Source§fn translate_from_hashmap<'a>(
&'a self,
translation_table: HashMap<usize, usize>,
) -> Option<Self>
fn translate_from_hashmap<'a>( &'a self, translation_table: HashMap<usize, usize>, ) -> Option<Self>
Takes a hashmap, and looks for existing wires in the keys. Replaces any existing wire keys
with the value from the hashmap.
impl Copy for CombineOperation
impl<T: WireValue> Gate<T> for CombineOperation
impl StructuralPartialEq for CombineOperation
Auto Trait Implementations§
impl Freeze for CombineOperation
impl RefUnwindSafe for CombineOperation
impl Send for CombineOperation
impl Sync for CombineOperation
impl Unpin for CombineOperation
impl UnwindSafe for CombineOperation
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