Enum ark_r1cs_std::fields::fp::FpVar [−][src]
Represent variables corresponding to a field element in F.
Variants
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]
&self,
other: &FpVar<F>,
ordering: Ordering,
should_also_check_equality: bool
) -> Result<(), SynthesisError>
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]
&self,
other: &FpVar<F>,
ordering: Ordering,
should_also_check_equality: bool
) -> Result<(), SynthesisError>
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]
&self,
other: &FpVar<F>,
ordering: Ordering,
should_also_check_equality: bool
) -> Result<Boolean<F>, SynthesisError>
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]
&self,
other: &FpVar<F>,
ordering: Ordering,
should_also_check_equality: bool
) -> Result<Boolean<F>, SynthesisError>
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]
&self
) -> Result<(), SynthesisError>
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.
fn add(self, other: Self) -> Self::Output[src]
impl<'a, F: PrimeField> Add<&'a FpVar<F>> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the + operator.
fn add(self, other: &'a FpVar<F>) -> Self::Output[src]
impl<'a, F: PrimeField> Add<F> for &'a FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the + operator.
fn add(self, other: F) -> Self::Output[src]
impl<F: PrimeField> Add<F> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the + operator.
fn add(self, other: F) -> Self::Output[src]
impl<'a, F: PrimeField> Add<FpVar<F>> for &'a FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the + operator.
fn add(self, other: FpVar<F>) -> Self::Output[src]
impl<F: PrimeField> Add<FpVar<F>> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the + operator.
fn add(self, other: FpVar<F>) -> Self::Output[src]
impl<'a, F: PrimeField> AddAssign<&'a FpVar<F>> for FpVar<F>[src]
fn add_assign(&mut self, other: &'a FpVar<F>)[src]
impl<F: PrimeField> AddAssign<F> for FpVar<F>[src]
fn add_assign(&mut self, other: F)[src]
impl<F: PrimeField> AddAssign<FpVar<F>> for FpVar<F>[src]
fn add_assign(&mut self, other: FpVar<F>)[src]
impl<F: PrimeField> AllocVar<F, F> for FpVar<F>[src]
fn new_variable<T: Borrow<F>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>[src]
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>[src]
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>[src]
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>[src]
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
impl<F: Clone + PrimeField> Clone for FpVar<F>[src]
impl<F: PrimeField> CondSelectGadget<F> for FpVar<F>[src]
fn conditionally_select(
cond: &Boolean<F>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>[src]
cond: &Boolean<F>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>[src]
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>
impl<P: Fp3Parameters> CubicExtVarParams<FpVar<<P as Fp3Parameters>::Fp>> for Fp3ParamsWrapper<P>[src]
fn mul_base_field_vars_by_frob_coeff(
c1: &mut FpVar<P::Fp>,
c2: &mut FpVar<P::Fp>,
power: usize
)[src]
c1: &mut FpVar<P::Fp>,
c2: &mut FpVar<P::Fp>,
power: usize
)
impl<F: Debug + PrimeField> Debug for FpVar<F>[src]
impl<F: PrimeField> EqGadget<F> for FpVar<F>[src]
fn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>[src]
fn conditional_enforce_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>[src]
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>[src]
&self,
other: &Self,
should_enforce: &Boolean<F>
) -> Result<(), SynthesisError>
fn is_neq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>[src]
fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>[src]
fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>[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 constant(f: F) -> Self[src]
fn zero() -> Self[src]
fn one() -> Self[src]
fn double(&self) -> Result<Self, SynthesisError>[src]
fn negate(&self) -> Result<Self, SynthesisError>[src]
fn square(&self) -> Result<Self, SynthesisError>[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.
fn inverse(&self) -> Result<Self, SynthesisError>[src]
fn frobenius_map(&self, power: usize) -> Result<Self, SynthesisError>[src]
fn frobenius_map_in_place(
&mut self,
power: usize
) -> Result<&mut Self, SynthesisError>[src]
&mut self,
power: usize
) -> Result<&mut Self, SynthesisError>
fn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError>[src]
fn is_one(&self) -> Result<Boolean<ConstraintF>, SynthesisError>[src]
fn double_in_place(&mut self) -> Result<&mut Self, SynthesisError>[src]
fn negate_in_place(&mut self) -> Result<&mut Self, SynthesisError>[src]
fn square_in_place(&mut self) -> Result<&mut Self, SynthesisError>[src]
fn mul_by_inverse(&self, d: &Self) -> Result<Self, SynthesisError>[src]
fn pow_le(&self, bits: &[Boolean<ConstraintF>]) -> Result<Self, SynthesisError>[src]
fn pow_by_constant<S: AsRef<[u64]>>(
&self,
exp: S
) -> Result<Self, SynthesisError>[src]
&self,
exp: S
) -> Result<Self, SynthesisError>
impl<F: PrimeField> From<AllocatedFp<F>> for FpVar<F>[src]
fn from(other: AllocatedFp<F>) -> Self[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.
fn mul(self, other: Self) -> Self::Output[src]
impl<'a, F: PrimeField> Mul<&'a FpVar<F>> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the * operator.
fn mul(self, other: &'a FpVar<F>) -> Self::Output[src]
impl<'a, F: PrimeField> Mul<F> for &'a FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the * operator.
fn mul(self, other: F) -> Self::Output[src]
impl<F: PrimeField> Mul<F> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the * operator.
fn mul(self, other: F) -> Self::Output[src]
impl<'a, F: PrimeField> Mul<FpVar<F>> for &'a FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the * operator.
fn mul(self, other: FpVar<F>) -> Self::Output[src]
impl<F: PrimeField> Mul<FpVar<F>> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the * operator.
fn mul(self, other: FpVar<F>) -> Self::Output[src]
impl<'a, F: PrimeField> MulAssign<&'a FpVar<F>> for FpVar<F>[src]
fn mul_assign(&mut self, other: &'a FpVar<F>)[src]
impl<F: PrimeField> MulAssign<F> for FpVar<F>[src]
fn mul_assign(&mut self, other: F)[src]
impl<F: PrimeField> MulAssign<FpVar<F>> for FpVar<F>[src]
fn mul_assign(&mut self, other: FpVar<F>)[src]
impl<P: Fp2Parameters> QuadExtVarParams<FpVar<<P as Fp2Parameters>::Fp>> for Fp2ParamsWrapper<P>[src]
fn mul_base_field_var_by_frob_coeff(fe: &mut FpVar<P::Fp>, power: usize)[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
fn cs(&self) -> ConstraintSystemRef<F>[src]
fn value(&self) -> Result<Self::Value, SynthesisError>[src]
fn is_constant(&self) -> bool[src]
impl<'a, F: PrimeField> Sub<&'a FpVar<F>> for &'a FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the - operator.
fn sub(self, other: Self) -> Self::Output[src]
impl<'a, F: PrimeField> Sub<&'a FpVar<F>> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the - operator.
fn sub(self, other: &'a FpVar<F>) -> Self::Output[src]
impl<'a, F: PrimeField> Sub<F> for &'a FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the - operator.
fn sub(self, other: F) -> Self::Output[src]
impl<F: PrimeField> Sub<F> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the - operator.
fn sub(self, other: F) -> Self::Output[src]
impl<'a, F: PrimeField> Sub<FpVar<F>> for &'a FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the - operator.
fn sub(self, other: FpVar<F>) -> Self::Output[src]
impl<F: PrimeField> Sub<FpVar<F>> for FpVar<F>[src]
type Output = FpVar<F>
The resulting type after applying the - operator.
fn sub(self, other: FpVar<F>) -> Self::Output[src]
impl<'a, F: PrimeField> SubAssign<&'a FpVar<F>> for FpVar<F>[src]
fn sub_assign(&mut self, other: &'a FpVar<F>)[src]
impl<F: PrimeField> SubAssign<F> for FpVar<F>[src]
fn sub_assign(&mut self, other: F)[src]
impl<F: PrimeField> SubAssign<FpVar<F>> for FpVar<F>[src]
fn sub_assign(&mut self, other: FpVar<F>)[src]
impl<F: PrimeField> ThreeBitCondNegLookupGadget<F> for FpVar<F>[src]
type TableConstant = F
The type of values being looked up.
fn three_bit_cond_neg_lookup(
b: &[Boolean<F>],
b0b1: &Boolean<F>,
c: &[Self::TableConstant]
) -> Result<Self, SynthesisError>[src]
b: &[Boolean<F>],
b0b1: &Boolean<F>,
c: &[Self::TableConstant]
) -> Result<Self, SynthesisError>
impl<F: PrimeField> ToBitsGadget<F> for FpVar<F>[src]
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>[src]
fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>[src]
fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>[src]
fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>[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.
fn to_non_unique_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError>[src]
impl<F: PrimeField> ToConstraintFieldGadget<F> for FpVar<F>[src]
fn to_constraint_field(&self) -> Result<Vec<FpVar<F>>, SynthesisError>[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.
fn two_bit_lookup(
b: &[Boolean<F>],
c: &[Self::TableConstant]
) -> Result<Self, SynthesisError>[src]
b: &[Boolean<F>],
c: &[Self::TableConstant]
) -> Result<Self, SynthesisError>
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,
F: Unpin,
impl<F> !UnwindSafe for FpVar<F>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,