ark_r1cs_std::fields::emulated_fp

Enum EmulatedFpVar

Source
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§

§

Constant(TargetF)

Constant

§

Var(AllocatedEmulatedFpVar<TargetF, BaseF>)

Allocated gadget

Implementations§

Source§

impl<TargetF: PrimeField, BaseF: PrimeField> EmulatedFpVar<TargetF, BaseF>

Source

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>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the + operator.
Source§

fn add(self, other: EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the + operator.
Source§

fn add(self, other: TargetF) -> Self::Output

Performs the + operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> Add<TargetF> for EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the + operator.
Source§

fn add(self, other: TargetF) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Add for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the + operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> Add for EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the + operator.
Source§

fn add(self, other: EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the + operation. Read more
Source§

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>)

Performs the += operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> AddAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>

Source§

fn add_assign(&mut self, other: TargetF)

Performs the += operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> AddAssign for EmulatedFpVar<TargetF, BaseF>

Source§

fn add_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)

Performs the += operation. Read more
Source§

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>

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>

Allocates a new constant of type Self in the ConstraintSystem cs. Read more
Source§

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>

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>

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 more
Source§

impl<TargetF: Clone + PrimeField, BaseF: Clone + PrimeField> Clone for EmulatedFpVar<TargetF, BaseF>

Source§

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)

Performs copy-assignment from source. Read more
Source§

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>

If cond == &Boolean::TRUE, then this returns true_value; else, returns false_value. Read more
Source§

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 more
Source§

impl<TargetF: Debug + PrimeField, BaseF: Debug + PrimeField> Debug for EmulatedFpVar<TargetF, BaseF>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> EqGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>



Source§

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<()>

If should_enforce == true, enforce that self and other are equal; else, enforce a vacuously true statement. Read more
Source§

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 more
Source§

fn is_neq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>

Output a Boolean value representing whether self.value() != other.value(). Read more
Source§

fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>

Enforce that self and other are equal. Read more
Source§

fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>

Enforce that self and other are not equal. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> FieldVar<TargetF, BaseF> for EmulatedFpVar<TargetF, BaseF>

Source§

fn zero() -> Self

Returns the constant F::zero().
Source§

fn one() -> Self

Returns the constant F::one().
Source§

fn constant(v: TargetF) -> Self

Returns a constant with value v. Read more
Source§

fn negate(&self) -> R1CSResult<Self>

Coputes -self.
Source§

fn inverse(&self) -> R1CSResult<Self>

Computes result such that self * result == Self::one().
Source§

fn frobenius_map(&self, power: usize) -> R1CSResult<Self>

Computes the frobenius map over self.
Source§

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>

Returns a Boolean representing whether self == Self::one().
Source§

fn double(&self) -> Result<Self, SynthesisError>

Computes self + self.
Source§

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>

Sets self = -self.
Source§

fn square(&self) -> Result<Self, SynthesisError>

Computes self * self. Read more
Source§

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>

Enforces that self * other == result.
Source§

fn square_equals(&self, result: &Self) -> Result<(), SynthesisError>

Enforces that self * self == result.
Source§

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>

Returns (self / d). Read more
Source§

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>

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>

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>

Source§

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>

Source§

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>

Source§

fn from(other: Boolean<BaseF>) -> Self

Converts to this type from the input type.
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> Hash for EmulatedFpVar<TargetF, BaseF>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

type Output = AffineVar<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

Performs the * operation. Read more
Source§

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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

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

Performs the * operation. Read more
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 AffineVar<P, F>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

type Output = AffineVar<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

Performs the * operation. Read more
Source§

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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

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

Performs the * operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the * operation. Read more
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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

type Output = AffineVar<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

Performs the * operation. Read more
Source§

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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

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

Performs the * operation. Read more
Source§

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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

type Output = AffineVar<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

Performs the * operation. Read more
Source§

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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

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

Performs the * operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the * operator.
Source§

fn mul(self, other: EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the * operator.
Source§

fn mul(self, other: TargetF) -> Self::Output

Performs the * operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> Mul<TargetF> for EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the * operator.
Source§

fn mul(self, other: TargetF) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Mul for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the * operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> Mul for EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the * operator.
Source§

fn mul(self, other: EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the * operation. Read more
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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

fn mul_assign( &mut self, other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, )

Performs the *= operation. Read more
Source§

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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

fn mul_assign( &mut self, other: &'a EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, )

Performs the *= operation. Read more
Source§

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>)

Performs the *= operation. Read more
Source§

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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

fn mul_assign( &mut self, other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, )

Performs the *= operation. Read more
Source§

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>
where for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,

Source§

fn mul_assign( &mut self, other: EmulatedFpVar<P::ScalarField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>, )

Performs the *= operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> MulAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>

Source§

fn mul_assign(&mut self, other: TargetF)

Performs the *= operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> MulAssign for EmulatedFpVar<TargetF, BaseF>

Source§

fn mul_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)

Performs the *= operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> PartialEq for EmulatedFpVar<TargetF, BaseF>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<&'a EmulatedFpVar<TargetF, BaseF>> for EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the - operator.
Source§

fn sub(self, other: EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub<TargetF> for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TargetF) -> Self::Output

Performs the - operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> Sub<TargetF> for EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TargetF) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> Sub for &'a EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the - operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> Sub for EmulatedFpVar<TargetF, BaseF>

Source§

type Output = EmulatedFpVar<TargetF, BaseF>

The resulting type after applying the - operator.
Source§

fn sub(self, other: EmulatedFpVar<TargetF, BaseF>) -> Self::Output

Performs the - operation. Read more
Source§

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>)

Performs the -= operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> SubAssign<TargetF> for EmulatedFpVar<TargetF, BaseF>

Source§

fn sub_assign(&mut self, other: TargetF)

Performs the -= operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> SubAssign for EmulatedFpVar<TargetF, BaseF>

Source§

fn sub_assign(&mut self, other: EmulatedFpVar<TargetF, BaseF>)

Performs the -= operation. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> ThreeBitCondNegLookupGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>

Source§

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>

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 more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> ToBitsGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>

Source§

fn to_bits_le(&self) -> R1CSResult<Vec<Boolean<BaseF>>>

Outputs the canonical little-endian bit-wise representation of self. Read more
Source§

fn to_non_unique_bits_le(&self) -> R1CSResult<Vec<Boolean<BaseF>>>

Outputs a possibly non-unique little-endian bit-wise representation of self. Read more
Source§

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>

Outputs a possibly non-unique big-endian bit-wise representation of self.
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> ToBytesGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>

Source§

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>>>

Outputs a possibly non-unique byte decomposition of self. Read more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> ToConstraintFieldGadget<BaseF> for EmulatedFpVar<TargetF, BaseF>

Source§

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>

Uses two bits to perform a lookup into a table b is little-endian: b[0] is LSB.

Source§

type TableConstant = TargetF

The type of values being looked up.
Source§

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 more
Source§

impl<TargetF: PrimeField, BaseF: PrimeField> Eq for EmulatedFpVar<TargetF, BaseF>

Source§

impl<'a, TargetF: PrimeField, BaseF: PrimeField> FieldOpsBounds<'a, TargetF, EmulatedFpVar<TargetF, BaseF>> for &'a EmulatedFpVar<TargetF, BaseF>

Source§

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>
where TargetF: Freeze, BaseF: Freeze,

§

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>
where TargetF: Unpin, BaseF: Unpin,

§

impl<TargetF, BaseF> !UnwindSafe for EmulatedFpVar<TargetF, BaseF>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more