pub enum EmulatedFpVar<TargetF: PrimeField, BaseF: PrimeField> {
Constant(TargetF),
Var(AllocatedEmulatedFpVar<TargetF, BaseF>),
}
Expand description
A gadget for representing non-native (TargetF
) field elements over the
constraint field (BaseF
).
Variants§
Implementations§
Source§impl<TargetF: PrimeField, BaseF: PrimeField> EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> EmulatedFpVar<TargetF, BaseF>
Sourcepub fn mul_without_reduce(
&self,
other: &Self,
) -> R1CSResult<MulResultVar<TargetF, BaseF>>
pub fn mul_without_reduce( &self, other: &Self, ) -> R1CSResult<MulResultVar<TargetF, BaseF>>
The mul_without_reduce
for EmulatedFpVar
Trait Implementations§
Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
+
operator.Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
+
operator.Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>
Source§impl<TargetF: PrimeField, BaseF: PrimeField> Add<TargetF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> Add<TargetF> for EmulatedFpVar<TargetF, BaseF>
Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add for &'a EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
+
operator.Source§impl<TargetF: PrimeField, BaseF: PrimeField> Add for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> Add for EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
+
operator.Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> AddAssign<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> AddAssign<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§fn add_assign(&mut self, other: &'a EmulatedFpVar<TargetF, BaseF>)
fn add_assign(&mut self, other: &'a EmulatedFpVar<TargetF, BaseF>)
Performs the
+=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> AddAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> AddAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>
Source§fn add_assign(&mut self, other: TargetF)
fn add_assign(&mut self, other: TargetF)
Performs the
+=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> AddAssign for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> AddAssign for EmulatedFpVar<TargetF, BaseF>
Source§fn add_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)
fn add_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)
Performs the
+=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> AllocVar<TargetF, BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> AllocVar<TargetF, BaseF> for EmulatedFpVar<TargetF, BaseF>
Source§fn new_variable<T: Borrow<TargetF>>(
cs: impl Into<Namespace<BaseF>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode,
) -> R1CSResult<Self>
fn new_variable<T: Borrow<TargetF>>( cs: impl Into<Namespace<BaseF>>, f: impl FnOnce() -> Result<T, SynthesisError>, mode: AllocationMode, ) -> R1CSResult<Self>
Allocates a new variable of type
Self
in the ConstraintSystem
cs
.
The mode of allocation is decided by mode
.Source§fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>,
) -> Result<Self, SynthesisError>
fn new_constant( cs: impl Into<Namespace<F>>, t: impl Borrow<V>, ) -> Result<Self, SynthesisError>
Source§fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>
fn new_input<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
Allocates a new public input of type
Self
in the ConstraintSystem
cs
.Source§fn new_witness<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>
fn new_witness<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
Allocates a new private witness of type
Self
in the ConstraintSystem
cs
.Source§fn new_variable_with_inferred_mode<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>
fn new_variable_with_inferred_mode<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
Allocates a new constant or private witness of type
Self
in the
ConstraintSystem
cs
with the allocation mode inferred from cs
.
A constant is allocated if cs
is None
, and a private witness is
allocated otherwise. Read moreSource§impl<TargetF: Clone + PrimeField, BaseF: Clone + PrimeField> Clone for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: Clone + PrimeField, BaseF: Clone + PrimeField> Clone for EmulatedFpVar<TargetF, BaseF>
Source§fn clone(&self) -> EmulatedFpVar<TargetF, BaseF>
fn clone(&self) -> EmulatedFpVar<TargetF, BaseF>
Returns a copy 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<TargetF: PrimeField, BaseF: PrimeField> CondSelectGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> CondSelectGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
Source§fn conditionally_select(
cond: &Boolean<BaseF>,
true_value: &Self,
false_value: &Self,
) -> R1CSResult<Self>
fn conditionally_select( cond: &Boolean<BaseF>, true_value: &Self, false_value: &Self, ) -> R1CSResult<Self>
Source§fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self],
) -> Result<Self, SynthesisError>
fn conditionally_select_power_of_two_vector( position: &[Boolean<ConstraintF>], values: &[Self], ) -> Result<Self, SynthesisError>
Returns an element of
values
whose index in represented by position
.
position
is an array of boolean that represents an unsigned integer in
big endian order. Read moreSource§impl<TargetF: Debug + PrimeField, BaseF: Debug + PrimeField> Debug for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: Debug + PrimeField, BaseF: Debug + PrimeField> Debug for EmulatedFpVar<TargetF, BaseF>
Source§impl<TargetF: PrimeField, BaseF: PrimeField> EqGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> EqGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
Source§fn is_eq(&self, other: &Self) -> R1CSResult<Boolean<BaseF>>
fn is_eq(&self, other: &Self) -> R1CSResult<Boolean<BaseF>>
Output a
Boolean
value representing whether self.value() == other.value()
.Source§fn conditional_enforce_equal(
&self,
other: &Self,
should_enforce: &Boolean<BaseF>,
) -> R1CSResult<()>
fn conditional_enforce_equal( &self, other: &Self, should_enforce: &Boolean<BaseF>, ) -> R1CSResult<()>
If
should_enforce == true
, enforce that self
and other
are equal;
else, enforce a vacuously true statement. Read moreSource§fn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<BaseF>,
) -> R1CSResult<()>
fn conditional_enforce_not_equal( &self, other: &Self, should_enforce: &Boolean<BaseF>, ) -> R1CSResult<()>
If
should_enforce == true
, enforce that self
and other
are not
equal; else, enforce a vacuously true statement. Read moreSource§fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>
fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>
Source§fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>
fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>
Source§impl<TargetF: PrimeField, BaseF: PrimeField> FieldVar<TargetF, BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> FieldVar<TargetF, BaseF> for EmulatedFpVar<TargetF, BaseF>
Source§fn negate(&self) -> R1CSResult<Self>
fn negate(&self) -> R1CSResult<Self>
Coputes
-self
.Source§fn inverse(&self) -> R1CSResult<Self>
fn inverse(&self) -> R1CSResult<Self>
Computes
result
such that self * result == Self::one()
.Source§fn frobenius_map(&self, power: usize) -> R1CSResult<Self>
fn frobenius_map(&self, power: usize) -> R1CSResult<Self>
Computes the frobenius map over
self
.Source§fn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError>
fn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError>
Returns a
Boolean
representing whether self == Self::zero()
.Source§fn is_one(&self) -> Result<Boolean<ConstraintF>, SynthesisError>
fn is_one(&self) -> Result<Boolean<ConstraintF>, SynthesisError>
Returns a
Boolean
representing whether self == Self::one()
.Source§fn double(&self) -> Result<Self, SynthesisError>
fn double(&self) -> Result<Self, SynthesisError>
Computes
self + self
.Source§fn double_in_place(&mut self) -> Result<&mut Self, SynthesisError>
fn double_in_place(&mut self) -> Result<&mut Self, SynthesisError>
Sets
self = self + self
.Source§fn negate_in_place(&mut self) -> Result<&mut Self, SynthesisError>
fn negate_in_place(&mut self) -> Result<&mut Self, SynthesisError>
Sets
self = -self
.Source§fn square_in_place(&mut self) -> Result<&mut Self, SynthesisError>
fn square_in_place(&mut self) -> Result<&mut Self, SynthesisError>
Sets
self = self.square()
.Source§fn mul_equals(&self, other: &Self, result: &Self) -> Result<(), SynthesisError>
fn mul_equals(&self, other: &Self, result: &Self) -> Result<(), SynthesisError>
Enforces that
self * other == result
.Source§fn square_equals(&self, result: &Self) -> Result<(), SynthesisError>
fn square_equals(&self, result: &Self) -> Result<(), SynthesisError>
Enforces that
self * self == result
.Source§fn mul_by_inverse(&self, d: &Self) -> Result<Self, SynthesisError>
fn mul_by_inverse(&self, d: &Self) -> Result<Self, SynthesisError>
Returns
(self / d)
.
The constraint system will be unsatisfiable when d = 0
.Source§fn mul_by_inverse_unchecked(&self, d: &Self) -> Result<Self, SynthesisError>
fn mul_by_inverse_unchecked(&self, d: &Self) -> Result<Self, SynthesisError>
Returns
(self / d)
. Read moreSource§fn frobenius_map_in_place(
&mut self,
power: usize,
) -> Result<&mut Self, SynthesisError>
fn frobenius_map_in_place( &mut self, power: usize, ) -> Result<&mut Self, SynthesisError>
Sets
self = self.frobenius_map()
.Source§fn pow_le(&self, bits: &[Boolean<ConstraintF>]) -> Result<Self, SynthesisError>
fn pow_le(&self, bits: &[Boolean<ConstraintF>]) -> Result<Self, SynthesisError>
Comptues
self^bits
, where bits
is a little-endian bit-wise
decomposition of the exponent.Source§fn pow_by_constant<S: AsRef<[u64]>>(
&self,
exp: S,
) -> Result<Self, SynthesisError>
fn pow_by_constant<S: AsRef<[u64]>>( &self, exp: S, ) -> Result<Self, SynthesisError>
Computes
self^S
, where S is interpreted as an little-endian
u64-decomposition of an integer.Source§impl<TargetF: PrimeField, BaseF: PrimeField> From<&EmulatedFpVar<TargetF, BaseF>> for MulResultVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> From<&EmulatedFpVar<TargetF, BaseF>> for MulResultVar<TargetF, BaseF>
Source§fn from(src: &EmulatedFpVar<TargetF, BaseF>) -> Self
fn from(src: &EmulatedFpVar<TargetF, BaseF>) -> Self
Converts to this type from the input type.
Source§impl<TargetF: PrimeField, BaseF: PrimeField> From<AllocatedEmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> From<AllocatedEmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§fn from(other: AllocatedEmulatedFpVar<TargetF, BaseF>) -> Self
fn from(other: AllocatedEmulatedFpVar<TargetF, BaseF>) -> Self
Converts to this type from the input type.
Source§impl<TargetF: PrimeField, BaseF: PrimeField> From<Boolean<BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> From<Boolean<BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§impl<TargetF: PrimeField, BaseF: PrimeField> Hash for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> Hash for EmulatedFpVar<TargetF, BaseF>
Source§impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Mul<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for &'a AffineVar<P, F>
impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Mul<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for &'a AffineVar<P, F>
Source§fn mul(
self,
other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Self::Output
fn mul( self, other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, ) -> Self::Output
Performs the
*
operation. Read moreSource§impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> Mul<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for &'a ProjectiveVar<P, F>
impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> Mul<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for &'a ProjectiveVar<P, F>
Source§type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the
*
operator.Source§fn mul(
self,
other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Self::Output
fn mul( self, other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, ) -> Self::Output
Performs the
*
operation. Read moreSource§impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Mul<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for AffineVar<P, F>
impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Mul<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for AffineVar<P, F>
Source§fn mul(
self,
other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Self::Output
fn mul( self, other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, ) -> Self::Output
Performs the
*
operation. Read moreSource§impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> Mul<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for ProjectiveVar<P, F>
impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> Mul<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for ProjectiveVar<P, F>
Source§type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the
*
operator.Source§fn mul(
self,
other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Self::Output
fn mul( self, other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, ) -> Self::Output
Performs the
*
operation. Read moreSource§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
*
operator.Source§impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Mul<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for &'a AffineVar<P, F>
impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Mul<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for &'a AffineVar<P, F>
Source§fn mul(
self,
other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Self::Output
fn mul( self, other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, ) -> Self::Output
Performs the
*
operation. Read moreSource§impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> Mul<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for &'a ProjectiveVar<P, F>
impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> Mul<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for &'a ProjectiveVar<P, F>
Source§type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the
*
operator.Source§fn mul(
self,
other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Self::Output
fn mul( self, other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, ) -> Self::Output
Performs the
*
operation. Read moreSource§impl<F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Mul<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for AffineVar<P, F>
impl<F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Mul<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for AffineVar<P, F>
Source§fn mul(
self,
other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Self::Output
fn mul( self, other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, ) -> Self::Output
Performs the
*
operation. Read moreSource§impl<F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> Mul<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for ProjectiveVar<P, F>
impl<F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> Mul<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for ProjectiveVar<P, F>
Source§type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the
*
operator.Source§fn mul(
self,
other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Self::Output
fn mul( self, other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, ) -> Self::Output
Performs the
*
operation. Read moreSource§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
*
operator.Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>
Source§impl<TargetF: PrimeField, BaseF: PrimeField> Mul<TargetF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> Mul<TargetF> for EmulatedFpVar<TargetF, BaseF>
Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul for &'a EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
*
operator.Source§impl<TargetF: PrimeField, BaseF: PrimeField> Mul for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> Mul for EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
*
operator.Source§impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> MulAssign<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for AffineVar<P, F>
impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> MulAssign<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for AffineVar<P, F>
Source§fn mul_assign(
&mut self,
other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
)
fn mul_assign( &mut self, other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, )
Performs the
*=
operation. Read moreSource§impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> MulAssign<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for ProjectiveVar<P, F>
impl<'a, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> MulAssign<&'a EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for ProjectiveVar<P, F>
Source§fn mul_assign(
&mut self,
other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
)
fn mul_assign( &mut self, other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, )
Performs the
*=
operation. Read moreSource§impl<'a, TargetF: PrimeField, BaseF: PrimeField> MulAssign<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> MulAssign<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§fn mul_assign(&mut self, other: &'a EmulatedFpVar<TargetF, BaseF>)
fn mul_assign(&mut self, other: &'a EmulatedFpVar<TargetF, BaseF>)
Performs the
*=
operation. Read moreSource§impl<F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> MulAssign<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for AffineVar<P, F>
impl<F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> MulAssign<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for AffineVar<P, F>
Source§fn mul_assign(
&mut self,
other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
)
fn mul_assign( &mut self, other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, )
Performs the
*=
operation. Read moreSource§impl<F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> MulAssign<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for ProjectiveVar<P, F>
impl<F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, P: SWCurveConfig> MulAssign<EmulatedFpVar<<P as CurveConfig>::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> for ProjectiveVar<P, F>
Source§fn mul_assign(
&mut self,
other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
)
fn mul_assign( &mut self, other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, )
Performs the
*=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> MulAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> MulAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>
Source§fn mul_assign(&mut self, other: TargetF)
fn mul_assign(&mut self, other: TargetF)
Performs the
*=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> MulAssign for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> MulAssign for EmulatedFpVar<TargetF, BaseF>
Source§fn mul_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)
fn mul_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)
Performs the
*=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> PartialEq for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> PartialEq for EmulatedFpVar<TargetF, BaseF>
Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
-
operator.Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
-
operator.Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>
Source§impl<TargetF: PrimeField, BaseF: PrimeField> Sub<TargetF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> Sub<TargetF> for EmulatedFpVar<TargetF, BaseF>
Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub for &'a EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
-
operator.Source§impl<TargetF: PrimeField, BaseF: PrimeField> Sub for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> Sub for EmulatedFpVar<TargetF, BaseF>
Source§type Output = EmulatedFpVar<TargetF, BaseF>
type Output = EmulatedFpVar<TargetF, BaseF>
The resulting type after applying the
-
operator.Source§impl<'a, TargetF: PrimeField, BaseF: PrimeField> SubAssign<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> SubAssign<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§fn sub_assign(&mut self, other: &'a EmulatedFpVar<TargetF, BaseF>)
fn sub_assign(&mut self, other: &'a EmulatedFpVar<TargetF, BaseF>)
Performs the
-=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> SubAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> SubAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>
Source§fn sub_assign(&mut self, other: TargetF)
fn sub_assign(&mut self, other: TargetF)
Performs the
-=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> SubAssign for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> SubAssign for EmulatedFpVar<TargetF, BaseF>
Source§fn sub_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)
fn sub_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)
Performs the
-=
operation. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> ThreeBitCondNegLookupGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> ThreeBitCondNegLookupGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
Source§type TableConstant = TargetF
type TableConstant = TargetF
The type of values being looked up.
Source§fn three_bit_cond_neg_lookup(
b: &[Boolean<BaseF>],
b0b1: &Boolean<BaseF>,
c: &[Self::TableConstant],
) -> R1CSResult<Self>
fn three_bit_cond_neg_lookup( b: &[Boolean<BaseF>], b0b1: &Boolean<BaseF>, c: &[Self::TableConstant], ) -> R1CSResult<Self>
Interprets the slice
bits
as a two-bit integer b = bits[0] + (bits[1] << 1)
, and then outputs constants[b] * c
, where c = if bits[2] { -1 } else { 1 };
. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> ToBitsGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> ToBitsGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
Source§fn to_bits_le(&self) -> R1CSResult<Vec<Boolean<BaseF>>>
fn to_bits_le(&self) -> R1CSResult<Vec<Boolean<BaseF>>>
Outputs the canonical little-endian bit-wise representation of
self
. Read moreSource§fn to_non_unique_bits_le(&self) -> R1CSResult<Vec<Boolean<BaseF>>>
fn to_non_unique_bits_le(&self) -> R1CSResult<Vec<Boolean<BaseF>>>
Outputs a possibly non-unique little-endian bit-wise representation of
self
. Read moreSource§fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
Outputs the canonical big-endian bit-wise representation of
self
.Source§fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
Outputs a possibly non-unique big-endian bit-wise representation of
self
.Source§impl<TargetF: PrimeField, BaseF: PrimeField> ToBytesGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> ToBytesGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
Source§fn to_bytes_le(&self) -> R1CSResult<Vec<UInt8<BaseF>>>
fn to_bytes_le(&self) -> R1CSResult<Vec<UInt8<BaseF>>>
Outputs the unique byte decomposition of self
in little-endian
form.
Source§fn to_non_unique_bytes_le(&self) -> R1CSResult<Vec<UInt8<BaseF>>>
fn to_non_unique_bytes_le(&self) -> R1CSResult<Vec<UInt8<BaseF>>>
Outputs a possibly non-unique byte decomposition of
self
. Read moreSource§impl<TargetF: PrimeField, BaseF: PrimeField> ToConstraintFieldGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> ToConstraintFieldGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
Source§fn to_constraint_field(&self) -> R1CSResult<Vec<FpVar<BaseF>>>
fn to_constraint_field(&self) -> R1CSResult<Vec<FpVar<BaseF>>>
Converts
self
to FpVar<ConstraintF>
variables.Source§impl<TargetF: PrimeField, BaseF: PrimeField> TwoBitLookupGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> TwoBitLookupGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>
Uses two bits to perform a lookup into a table
b
is little-endian: b[0]
is LSB.
Source§type TableConstant = TargetF
type TableConstant = TargetF
The type of values being looked up.
Source§fn two_bit_lookup(
b: &[Boolean<BaseF>],
c: &[Self::TableConstant],
) -> R1CSResult<Self>
fn two_bit_lookup( b: &[Boolean<BaseF>], c: &[Self::TableConstant], ) -> R1CSResult<Self>
Interprets the slice
bits
as a two-bit integer b = bits[0] + (bits[1] << 1)
, and then outputs constants[b]
. Read moreimpl<TargetF: PrimeField, BaseF: PrimeField> Eq for EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> FieldOpsBounds<'a, TargetF, EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>
impl<'a, TargetF: PrimeField, BaseF: PrimeField> FieldOpsBounds<'a, TargetF, EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>
Auto Trait Implementations§
impl<TargetF, BaseF> Freeze for EmulatedFpVar<TargetF, BaseF>
impl<TargetF, BaseF> !RefUnwindSafe for EmulatedFpVar<TargetF, BaseF>
impl<TargetF, BaseF> !Send for EmulatedFpVar<TargetF, BaseF>
impl<TargetF, BaseF> !Sync for EmulatedFpVar<TargetF, BaseF>
impl<TargetF, BaseF> Unpin for EmulatedFpVar<TargetF, BaseF>
impl<TargetF, BaseF> !UnwindSafe for EmulatedFpVar<TargetF, BaseF>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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