Enum ark_r1cs_std::fields::fp::FpVar[][src]

#[must_use]pub enum FpVar<F: PrimeField> {
    Constant(F),
    Var(AllocatedFp<F>),
}

Represent variables corresponding to a field element in F.

Variants

Constant(F)

Represents a constant in the constraint system, which means that it does not have a corresponding variable.

Var(AllocatedFp<F>)

Represents an allocated variable constant in the constraint system.

Implementations

impl<F: PrimeField> FpVar<F>[src]

pub fn enforce_cmp(
    &self,
    other: &FpVar<F>,
    ordering: Ordering,
    should_also_check_equality: bool
) -> Result<(), SynthesisError>
[src]

This function enforces the ordering between self and other. The constraint system will not be satisfied otherwise. If self should also be checked for equality, e.g. self <= other instead of self < other, set should_also_check_quality to true. This variant verifies self and other are <= (p-1)/2.

pub fn enforce_cmp_unchecked(
    &self,
    other: &FpVar<F>,
    ordering: Ordering,
    should_also_check_equality: bool
) -> Result<(), SynthesisError>
[src]

This function enforces the ordering between self and other. The constraint system will not be satisfied otherwise. If self should also be checked for equality, e.g. self <= other instead of self < other, set should_also_check_quality to true. This variant assumes self and other are <= (p-1)/2 and does not generate constraints to verify that.

pub fn is_cmp(
    &self,
    other: &FpVar<F>,
    ordering: Ordering,
    should_also_check_equality: bool
) -> Result<Boolean<F>, SynthesisError>
[src]

This function checks the ordering between self and other. It outputs self Boolean that contains the result - 1 if true, 0 otherwise. The constraint system will be satisfied in any case. If self should also be checked for equality, e.g. self <= other instead of self < other, set should_also_check_quality to true. This variant verifies self and other are <= (p-1)/2.

pub fn is_cmp_unchecked(
    &self,
    other: &FpVar<F>,
    ordering: Ordering,
    should_also_check_equality: bool
) -> Result<Boolean<F>, SynthesisError>
[src]

This function checks the ordering between self and other. It outputs a Boolean that contains the result - 1 if true, 0 otherwise. The constraint system will be satisfied in any case. If self should also be checked for equality, e.g. self <= other instead of self < other, set should_also_check_quality to true. This variant assumes self and other are <= (p-1)/2 and does not generate constraints to verify that.

pub fn enforce_smaller_or_equal_than_mod_minus_one_div_two(
    &self
) -> Result<(), SynthesisError>
[src]

Helper function to enforce that self <= (p-1)/2.

Trait Implementations

impl<'a, F: PrimeField> Add<&'a FpVar<F>> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the + operator.

impl<'a, F: PrimeField> Add<&'a FpVar<F>> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the + operator.

impl<'a, F: PrimeField> Add<F> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the + operator.

impl<F: PrimeField> Add<F> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the + operator.

impl<'a, F: PrimeField> Add<FpVar<F>> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the + operator.

impl<F: PrimeField> Add<FpVar<F>> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the + operator.

impl<'a, F: PrimeField> AddAssign<&'a FpVar<F>> for FpVar<F>[src]

impl<F: PrimeField> AddAssign<F> for FpVar<F>[src]

impl<F: PrimeField> AddAssign<FpVar<F>> for FpVar<F>[src]

impl<F: PrimeField> AllocVar<F, F> for FpVar<F>[src]

impl<F: Clone + PrimeField> Clone for FpVar<F>[src]

impl<F: PrimeField> CondSelectGadget<F> for FpVar<F>[src]

impl<P: Fp3Parameters> CubicExtVarParams<FpVar<<P as Fp3Parameters>::Fp>> for Fp3ParamsWrapper<P>[src]

impl<F: Debug + PrimeField> Debug for FpVar<F>[src]

impl<F: PrimeField> EqGadget<F> for FpVar<F>[src]



impl<'a, F: PrimeField> FieldOpsBounds<'a, F, FpVar<F>> for FpVar<F>[src]

impl<'a, F: PrimeField> FieldOpsBounds<'a, F, FpVar<F>> for &'a FpVar<F>[src]

impl<F: PrimeField> FieldVar<F, F> for FpVar<F>[src]

fn mul_equals(&self, other: &Self, result: &Self) -> Result<(), SynthesisError>[src]

Enforce that self * other == result.

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

Enforce that self * self == result.

impl<F: PrimeField> From<AllocatedFp<F>> for FpVar<F>[src]

impl<F: PrimeField> From<Boolean<F>> for FpVar<F>[src]

impl<'a, F: PrimeField> Mul<&'a FpVar<F>> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the * operator.

impl<'a, F: PrimeField> Mul<&'a FpVar<F>> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the * operator.

impl<'a, F: PrimeField> Mul<F> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the * operator.

impl<F: PrimeField> Mul<F> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the * operator.

impl<'a, F: PrimeField> Mul<FpVar<F>> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the * operator.

impl<F: PrimeField> Mul<FpVar<F>> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the * operator.

impl<'a, F: PrimeField> MulAssign<&'a FpVar<F>> for FpVar<F>[src]

impl<F: PrimeField> MulAssign<F> for FpVar<F>[src]

impl<F: PrimeField> MulAssign<FpVar<F>> for FpVar<F>[src]

impl<P: Fp2Parameters> QuadExtVarParams<FpVar<<P as Fp2Parameters>::Fp>> for Fp2ParamsWrapper<P>[src]

impl<F: PrimeField> R1CSVar<F> for FpVar<F>[src]

type Value = F

The type of the “native” value that Self represents in the constraint system. Read more

impl<'a, F: PrimeField> Sub<&'a FpVar<F>> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the - operator.

impl<'a, F: PrimeField> Sub<&'a FpVar<F>> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the - operator.

impl<'a, F: PrimeField> Sub<F> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the - operator.

impl<F: PrimeField> Sub<F> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the - operator.

impl<'a, F: PrimeField> Sub<FpVar<F>> for &'a FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the - operator.

impl<F: PrimeField> Sub<FpVar<F>> for FpVar<F>[src]

type Output = FpVar<F>

The resulting type after applying the - operator.

impl<'a, F: PrimeField> SubAssign<&'a FpVar<F>> for FpVar<F>[src]

impl<F: PrimeField> SubAssign<F> for FpVar<F>[src]

impl<F: PrimeField> SubAssign<FpVar<F>> for FpVar<F>[src]

impl<F: PrimeField> ThreeBitCondNegLookupGadget<F> for FpVar<F>[src]

type TableConstant = F

The type of values being looked up.

impl<F: PrimeField> ToBitsGadget<F> for FpVar<F>[src]

impl<F: PrimeField> ToBytesGadget<F> for FpVar<F>[src]

fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError>[src]

Outputs the unique byte decomposition of self in little-endian form.

impl<F: PrimeField> ToConstraintFieldGadget<F> for FpVar<F>[src]

impl<F: PrimeField> TwoBitLookupGadget<F> for FpVar<F>[src]

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

type TableConstant = F

The type of values being looked up.

Auto Trait Implementations

impl<F> !RefUnwindSafe for FpVar<F>

impl<F> !Send for FpVar<F>

impl<F> !Sync for FpVar<F>

impl<F> Unpin for FpVar<F> where
    F: Unpin

impl<F> !UnwindSafe for FpVar<F>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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