Struct ark_r1cs_std::groups::curves::twisted_edwards::AffineVar
source · pub struct AffineVar<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,{
pub x: F,
pub y: F,
/* private fields */
}
Expand description
An implementation of arithmetic for Twisted Edwards curves that relies on the complete formulae for the affine model, as outlined in the EFD.
Fields§
§x: F
The x-coordinate.
y: F
The y-coordinate.
Implementations§
source§impl<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P: TEModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
sourcepub fn new_variable_omit_on_curve_check<T: Into<TEAffine<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
pub fn new_variable_omit_on_curve_check<T: Into<TEAffine<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
Allocates a new variable without performing an on-curve check, which is useful if the variable is known to be on the curve (eg., if the point is a constant or is a public input).
source§impl<P, F> AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField> + ThreeBitCondNegLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField> + ThreeBitCondNegLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
sourcepub fn precomputed_base_3_bit_signed_digit_scalar_mul<J>(
bases: &[impl Borrow<[TEProjective<P>]>],
scalars: &[impl Borrow<[J]>]
) -> Result<Self, SynthesisError>where
J: Borrow<[Boolean<<P::BaseField as Field>::BasePrimeField>]>,
pub fn precomputed_base_3_bit_signed_digit_scalar_mul<J>(
bases: &[impl Borrow<[TEProjective<P>]>],
scalars: &[impl Borrow<[J]>]
) -> Result<Self, SynthesisError>where
J: Borrow<[Boolean<<P::BaseField as Field>::BasePrimeField>]>,
Compute a scalar multiplication of bases
with respect to scalars
,
where the elements of scalars
are length-three slices of bits, and
which such that the first two bits are use to select one of the
bases, while the third bit is used to conditionally negate the
selection.
Trait Implementations§
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<&'a AffineVar<P, F>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<&'a AffineVar<P, F>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<&'a AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<&'a AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<AffineVar<P, F>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<AffineVar<P, F>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<Projective<P>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<Projective<P>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<Projective<P>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Add<Projective<P>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> AddAssign<&'a AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> AddAssign<&'a AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn add_assign(&mut self, other: &'a AffineVar<P, F>)
fn add_assign(&mut self, other: &'a AffineVar<P, F>)
+=
operation. Read moresource§impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> AddAssign<AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> AddAssign<AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn add_assign(&mut self, other: AffineVar<P, F>)
fn add_assign(&mut self, other: AffineVar<P, F>)
+=
operation. Read moresource§impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> AddAssign<Projective<P>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> AddAssign<Projective<P>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn add_assign(&mut self, other: TEProjective<P>)
fn add_assign(&mut self, other: TEProjective<P>)
+=
operation. Read moresource§impl<P, F> AllocVar<Affine<P>, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> AllocVar<Affine<P>, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
source§fn new_variable<Point: Borrow<TEAffine<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<Point, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable<Point: Borrow<TEAffine<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<Point, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
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>
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>
Self
in the ConstraintSystem
cs
.source§impl<P, F> AllocVar<Projective<P>, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> AllocVar<Projective<P>, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
source§fn new_variable<Point: Borrow<TEProjective<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<Point, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable<Point: Borrow<TEProjective<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<Point, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
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>
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>
Self
in the ConstraintSystem
cs
.source§impl<P: TEModelParameters, F> Clone for AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone + FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
impl<P: TEModelParameters, F> Clone for AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone + FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
source§impl<P, F> CondSelectGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<P, F> CondSelectGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn conditionally_select(
cond: &Boolean<<P::BaseField as Field>::BasePrimeField>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
fn conditionally_select(
cond: &Boolean<<P::BaseField as Field>::BasePrimeField>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
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>
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<P, F> CurveVar<Projective<P>, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> CurveVar<Projective<P>, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
source§fn enforce_prime_order(&self) -> Result<(), SynthesisError>
fn enforce_prime_order(&self) -> Result<(), SynthesisError>
Enforce that self
is in the prime-order subgroup.
Does so by multiplying by the prime order, and checking that the result is unchanged.
source§fn constant(g: TEProjective<P>) -> Self
fn constant(g: TEProjective<P>) -> Self
v
. Read moresource§fn is_zero(
&self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
fn is_zero(
&self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
Boolean
representing whether self == Self::zero()
.source§fn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<TEProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<TEProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
source§fn double_in_place(&mut self) -> Result<(), SynthesisError>
fn double_in_place(&mut self) -> Result<(), SynthesisError>
self = self + self
.source§fn negate(&self) -> Result<Self, SynthesisError>
fn negate(&self) -> Result<Self, SynthesisError>
-self
.source§fn precomputed_base_scalar_mul_le<'a, I, B>(
&mut self,
scalar_bits_with_base_multiples: I
) -> Result<(), SynthesisError>where
I: Iterator<Item = (B, &'a TEProjective<P>)>,
B: Borrow<Boolean<<P::BaseField as Field>::BasePrimeField>>,
fn precomputed_base_scalar_mul_le<'a, I, B>(
&mut self,
scalar_bits_with_base_multiples: I
) -> Result<(), SynthesisError>where
I: Iterator<Item = (B, &'a TEProjective<P>)>,
B: Borrow<Boolean<<P::BaseField as Field>::BasePrimeField>>,
I * self
in place, where I
is a Boolean
little-endian
representation of the scalar. Read moresource§fn double(&self) -> Result<Self, SynthesisError>
fn double(&self) -> Result<Self, SynthesisError>
self + self
.source§fn scalar_mul_le<'a>(
&self,
bits: impl Iterator<Item = &'a Boolean<ConstraintF>>
) -> Result<Self, SynthesisError>
fn scalar_mul_le<'a>(
&self,
bits: impl Iterator<Item = &'a Boolean<ConstraintF>>
) -> Result<Self, SynthesisError>
bits * self
, where bits
is a little-endian
Boolean
representation of a scalar.source§fn precomputed_base_multiscalar_mul_le<'a, T, I, B>(
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError>where
T: 'a + ToBitsGadget<ConstraintF> + ?Sized,
I: Iterator<Item = &'a T>,
B: Borrow<[C]>,
fn precomputed_base_multiscalar_mul_le<'a, T, I, B>(
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError>where
T: 'a + ToBitsGadget<ConstraintF> + ?Sized,
I: Iterator<Item = &'a T>,
B: Borrow<[C]>,
Σⱼ(scalarⱼ * baseⱼ)
for all j,
where scalarⱼ
is a Boolean
little-endian
representation of the j-th scalar.source§impl<P: TEModelParameters, F> Debug for AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug + FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
impl<P: TEModelParameters, F> Debug for AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug + FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
source§impl<P, F> EqGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<P, F> EqGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn is_eq(
&self,
other: &Self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
fn is_eq(
&self,
other: &Self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
Boolean
value representing whether self.value() == other.value()
.source§fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
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,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
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<P, F> R1CSVar<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> R1CSVar<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
§type Value = Projective<P>
type Value = Projective<P>
Self
represents in the constraint
system.source§fn cs(&self) -> ConstraintSystemRef<<P::BaseField as Field>::BasePrimeField>
fn cs(&self) -> ConstraintSystemRef<<P::BaseField as Field>::BasePrimeField>
ConstraintSystemRef
. Read moresource§fn value(&self) -> Result<TEProjective<P>, SynthesisError>
fn value(&self) -> Result<TEProjective<P>, SynthesisError>
self
in the underlying
ConstraintSystem
.source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if self
is a circuit-generation-time constant.source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<&'a AffineVar<P, F>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<&'a AffineVar<P, F>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<&'a AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<&'a AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<AffineVar<P, F>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<AffineVar<P, F>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<Projective<P>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<Projective<P>> for &'a AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<Projective<P>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> Sub<Projective<P>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> SubAssign<&'a AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> SubAssign<&'a AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn sub_assign(&mut self, other: &'a AffineVar<P, F>)
fn sub_assign(&mut self, other: &'a AffineVar<P, F>)
-=
operation. Read moresource§impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> SubAssign<AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> SubAssign<AffineVar<P, F>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn sub_assign(&mut self, other: AffineVar<P, F>)
fn sub_assign(&mut self, other: AffineVar<P, F>)
-=
operation. Read moresource§impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> SubAssign<Projective<P>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TEModelParameters> SubAssign<Projective<P>> for AffineVar<P, F>where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn sub_assign(&mut self, other: TEProjective<P>)
fn sub_assign(&mut self, other: TEProjective<P>)
-=
operation. Read moresource§impl<P, F> ToBitsGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<P, F> ToBitsGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn to_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
self
. Read moresource§fn to_non_unique_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_non_unique_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
self
. Read moresource§fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
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>
self
.source§impl<P, F> ToBytesGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<P, F> ToBytesGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
source§fn to_bytes(
&self
) -> Result<Vec<UInt8<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_bytes(
&self
) -> Result<Vec<UInt8<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
self
. Read moresource§fn to_non_unique_bytes(
&self
) -> Result<Vec<UInt8<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_non_unique_bytes(
&self
) -> Result<Vec<UInt8<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
self
. Read moresource§impl<P, F> ToConstraintFieldGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + ToConstraintFieldGadget<<P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> ToConstraintFieldGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + ToConstraintFieldGadget<<P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
source§fn to_constraint_field(
&self
) -> Result<Vec<FpVar<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_constraint_field(
&self
) -> Result<Vec<FpVar<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
self
to FpVar<ConstraintF>
variables.