pub struct AffineVar<P: TECurveConfig, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>>{
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: TECurveConfig, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> AffineVar<P, F>
impl<P: TECurveConfig, F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>> AffineVar<P, F>
Sourcepub fn new_variable_omit_on_curve_check<T: Into<TEAffine<P>>>(
cs: impl Into<Namespace<<<P as CurveConfig>::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 as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField> + ThreeBitCondNegLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> AffineVar<P, F>where
P: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField> + ThreeBitCondNegLookupGadget<<<P as CurveConfig>::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>
pub fn precomputed_base_3_bit_signed_digit_scalar_mul<J>( bases: &[impl Borrow<[TEProjective<P>]>], scalars: &[impl Borrow<[J]>], ) -> Result<Self, SynthesisError>
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 as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> Add<&'a AffineVar<P, F>> 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> Add<&'a AffineVar<P, F>> for AffineVar<P, F>
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> Add<AffineVar<P, F>> 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> Add<AffineVar<P, F>> for &'a AffineVar<P, F>
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> Add<Projective<P>> 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> Add<Projective<P>> for &'a AffineVar<P, F>
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> Add<Projective<P>> 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> Add<Projective<P>> for AffineVar<P, F>
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> Add 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> Add for &'a AffineVar<P, F>
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> Add 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> Add for AffineVar<P, F>
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> AddAssign<&'a AffineVar<P, F>> 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> AddAssign<&'a AffineVar<P, F>> for AffineVar<P, 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 as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> AddAssign<Projective<P>> 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> AddAssign<Projective<P>> for AffineVar<P, F>
Source§fn add_assign(&mut self, other: TEProjective<P>)
fn add_assign(&mut self, other: TEProjective<P>)
+=
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> AddAssign 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> AddAssign for AffineVar<P, F>
Source§fn add_assign(&mut self, other: AffineVar<P, F>)
fn add_assign(&mut self, other: AffineVar<P, F>)
+=
operation. Read moreSource§impl<P, F> AllocVar<Affine<P>, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::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 as CurveConfig>::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 as CurveConfig>::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§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>
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<P, F> AllocVar<Projective<P>, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::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 as CurveConfig>::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 as CurveConfig>::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§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>
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<P: TECurveConfig, F> Clone for AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone + FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
PhantomData<P>: Clone,
impl<P: TECurveConfig, F> Clone for AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone + FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
PhantomData<P>: Clone,
Source§impl<P, F> CondSelectGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Source§fn conditionally_select(
cond: &Boolean<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
true_value: &Self,
false_value: &Self,
) -> Result<Self, SynthesisError>
fn conditionally_select( cond: &Boolean<<<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::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 as CurveConfig>::BaseField as Field>::BasePrimeField>, SynthesisError>
fn is_zero( &self, ) -> Result<Boolean<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>, SynthesisError>
Boolean
representing whether self == Self::zero()
.Source§fn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<<<P as CurveConfig>::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 as CurveConfig>::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 as CurveConfig>::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 as CurveConfig>::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>
fn precomputed_base_multiscalar_mul_le<'a, T, I, B>( bases: &[B], scalars: I, ) -> Result<Self, SynthesisError>
Σⱼ(scalarⱼ * baseⱼ)
for all j,
where scalarⱼ
is a Boolean
little-endian
representation of the j-th scalar.Source§impl<P: TECurveConfig, F> Debug for AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug + FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
impl<P: TECurveConfig, F> Debug for AffineVar<P, F>where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug + FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
Source§impl<P, F> EqGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Source§fn is_eq(
&self,
other: &Self,
) -> Result<Boolean<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>, SynthesisError>
fn is_eq( &self, other: &Self, ) -> Result<Boolean<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>, SynthesisError>
Boolean
value representing whether self.value() == other.value()
.Source§fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Result<(), SynthesisError>
fn conditional_enforce_equal( &self, other: &Self, condition: &Boolean<<<P as CurveConfig>::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 as CurveConfig>::BaseField as Field>::BasePrimeField>,
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal( &self, other: &Self, condition: &Boolean<<<P as CurveConfig>::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<'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
*
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
*
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<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
*
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
*
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> 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>, )
*=
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>, )
*=
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> Sub<&'a AffineVar<P, F>> 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> Sub<&'a AffineVar<P, F>> for AffineVar<P, F>
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> Sub<AffineVar<P, F>> 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> Sub<AffineVar<P, F>> for &'a AffineVar<P, F>
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> Sub<Projective<P>> 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> Sub<Projective<P>> for &'a AffineVar<P, F>
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> Sub<Projective<P>> 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> Sub<Projective<P>> for AffineVar<P, F>
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> Sub 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> Sub for &'a AffineVar<P, F>
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> Sub 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> Sub for AffineVar<P, F>
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> SubAssign<&'a AffineVar<P, F>> 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> SubAssign<&'a AffineVar<P, F>> for AffineVar<P, 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 as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>, P: TECurveConfig> SubAssign<Projective<P>> 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> SubAssign<Projective<P>> for AffineVar<P, F>
Source§fn sub_assign(&mut self, other: TEProjective<P>)
fn sub_assign(&mut self, other: TEProjective<P>)
-=
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> SubAssign 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> SubAssign for AffineVar<P, F>
Source§fn sub_assign(&mut self, other: AffineVar<P, F>)
fn sub_assign(&mut self, other: AffineVar<P, F>)
-=
operation. Read moreSource§impl<P, F> ToBitsGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField> for AffineVar<P, F>where
P: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Source§fn to_bits_le(
&self,
) -> Result<Vec<Boolean<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_bits_le( &self, ) -> Result<Vec<Boolean<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>>, SynthesisError>
self
. Read moreSource§fn to_non_unique_bits_le(
&self,
) -> Result<Vec<Boolean<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_non_unique_bits_le( &self, ) -> Result<Vec<Boolean<<<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Source§fn to_bytes_le(
&self,
) -> Result<Vec<UInt8<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_bytes_le( &self, ) -> Result<Vec<UInt8<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>>, SynthesisError>
self
. Read moreSource§fn to_non_unique_bytes_le(
&self,
) -> Result<Vec<UInt8<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_non_unique_bytes_le( &self, ) -> Result<Vec<UInt8<<<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + ToConstraintFieldGadget<<<P as CurveConfig>::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: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + ToConstraintFieldGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
Source§fn to_constraint_field(
&self,
) -> Result<Vec<FpVar<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_constraint_field( &self, ) -> Result<Vec<FpVar<<<P as CurveConfig>::BaseField as Field>::BasePrimeField>>, SynthesisError>
self
to FpVar<ConstraintF>
variables.impl<'a, P, F> GroupOpsBounds<'a, Projective<P>, AffineVar<P, F>> for &'a AffineVar<P, F>where
P: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, P, F> GroupOpsBounds<'a, Projective<P>, AffineVar<P, F>> for AffineVar<P, F>where
P: TECurveConfig,
F: FieldVar<P::BaseField, <<P as CurveConfig>::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<<P as CurveConfig>::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Auto Trait Implementations§
impl<P, F> Freeze for AffineVar<P, F>
impl<P, F> RefUnwindSafe for AffineVar<P, F>
impl<P, F> Send for AffineVar<P, F>
impl<P, F> Sync for AffineVar<P, F>
impl<P, F> Unpin for AffineVar<P, F>
impl<P, F> UnwindSafe for AffineVar<P, F>
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
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)
clone_to_uninit
)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>
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>
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