pub enum ArithmeticGate {
GarblerInput {
id: usize,
},
EvaluatorInput {
id: usize,
},
Constant {
val: u16,
},
Add {
xref: CircuitRef,
yref: CircuitRef,
out: Option<usize>,
},
Sub {
xref: CircuitRef,
yref: CircuitRef,
out: Option<usize>,
},
Cmul {
xref: CircuitRef,
c: u16,
out: Option<usize>,
},
Mul {
xref: CircuitRef,
yref: CircuitRef,
id: usize,
out: Option<usize>,
},
Proj {
xref: CircuitRef,
tt: Vec<u16>,
id: usize,
out: Option<usize>,
},
}Expand description
Arithmetic computation supported by fancy garbling.
id represents the gate number. out gives the output wire index; if out = None, then we use the gate index as the output wire index.
Variants§
GarblerInput
Input of garbler
EvaluatorInput
Input of evaluator
Constant
Constant value
Add
Add gate
Sub
Sub gate
Cmul
Constant multiplication gate
Fields
§
xref: CircuitRefReference to input 1
Mul
Multiplication gate
Proj
Projection gate
Trait Implementations§
Source§impl Clone for ArithmeticGate
impl Clone for ArithmeticGate
Source§fn clone(&self) -> ArithmeticGate
fn clone(&self) -> ArithmeticGate
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 ArithmeticGate
impl Debug for ArithmeticGate
Source§impl<'de> Deserialize<'de> for ArithmeticGate
impl<'de> Deserialize<'de> for ArithmeticGate
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 Display for ArithmeticGate
impl Display for ArithmeticGate
Source§impl GateType for ArithmeticGate
impl GateType for ArithmeticGate
Source§fn make_constant(val: u16) -> Self
fn make_constant(val: u16) -> Self
Generate constant gate
Source§fn make_garbler_input(id: usize) -> Self
fn make_garbler_input(id: usize) -> Self
Generate garbler input gate
Source§fn make_evaluator_input(id: usize) -> Self
fn make_evaluator_input(id: usize) -> Self
Generate evaluator input gate
Source§impl PartialEq for ArithmeticGate
impl PartialEq for ArithmeticGate
Source§impl Serialize for ArithmeticGate
impl Serialize for ArithmeticGate
impl StructuralPartialEq for ArithmeticGate
Auto Trait Implementations§
impl Freeze for ArithmeticGate
impl RefUnwindSafe for ArithmeticGate
impl Send for ArithmeticGate
impl Sync for ArithmeticGate
impl Unpin for ArithmeticGate
impl UnwindSafe for ArithmeticGate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IsSameType<T> for T
impl<T> IsSameType<T> for T
§type EqualityProposition = TrueEqualityProposition
type EqualityProposition = TrueEqualityProposition
The [
EqualityProposition] that Self == T