Trait ark_r1cs_std::groups::CurveVar [−][src]
A variable that represents a curve point for
the curve C
.
Required methods
fn zero() -> Self
[src]
Returns the constant F::zero()
. This is the identity
of the group.
fn constant(other: C) -> Self
[src]
Returns a constant with value v
.
This should not allocate any variables.
fn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<ConstraintF>>,
f: impl FnOnce() -> Result<C, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
[src]
cs: impl Into<Namespace<ConstraintF>>,
f: impl FnOnce() -> Result<C, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
Allocates a variable in the subgroup without checking if it’s in the prime-order subgroup.
fn enforce_prime_order(&self) -> Result<(), SynthesisError>
[src]
Enforce that self
is in the prime-order subgroup.
fn double_in_place(&mut self) -> Result<(), SynthesisError>
[src]
Sets self = self + self
.
fn negate(&self) -> Result<Self, SynthesisError>
[src]
Coputes -self
.
Provided methods
fn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError>
[src]
Returns a Boolean
representing whether self == Self::zero()
.
fn double(&self) -> Result<Self, SynthesisError>
[src]
Computes self + self
.
fn scalar_mul_le<'a>(
&self,
bits: impl Iterator<Item = &'a Boolean<ConstraintF>>
) -> Result<Self, SynthesisError>
[src]
&self,
bits: impl Iterator<Item = &'a Boolean<ConstraintF>>
) -> Result<Self, SynthesisError>
Computes bits * self
, where bits
is a little-endian
Boolean
representation of a scalar.
fn precomputed_base_scalar_mul_le<'a, I, B>(
&mut self,
scalar_bits_with_bases: I
) -> Result<(), SynthesisError> where
I: Iterator<Item = (B, &'a C)>,
B: Borrow<Boolean<ConstraintF>>,
C: 'a,
[src]
&mut self,
scalar_bits_with_bases: I
) -> Result<(), SynthesisError> where
I: Iterator<Item = (B, &'a C)>,
B: Borrow<Boolean<ConstraintF>>,
C: 'a,
Computes a I * self
in place, where I
is a Boolean
little-endian
representation of the scalar.
The bases are precomputed power-of-two multiples of a single base.
fn precomputed_base_multiscalar_mul_le<'a, T: ?Sized, I, B>(
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError> where
T: 'a + ToBitsGadget<ConstraintF>,
I: Iterator<Item = &'a T>,
B: Borrow<[C]>,
[src]
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError> where
T: 'a + ToBitsGadget<ConstraintF>,
I: Iterator<Item = &'a T>,
B: Borrow<[C]>,
Computes Σⱼ(scalarⱼ * baseⱼ)
for all j,
where scalarⱼ
is a Boolean
little-endian
representation of the j-th scalar.
Implementors
impl<P, F> CurveVar<GroupProjective<P>, <<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'a F: FieldOpsBounds<'a, P::BaseField, F>,
[src]
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn constant(g: SWProjective<P>) -> Self
[src]
fn zero() -> Self
[src]
fn is_zero(
&self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
[src]
&self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
fn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<SWProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
[src]
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<SWProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn enforce_prime_order(&self) -> Result<(), SynthesisError>
[src]
Enforce that self
is in the prime-order subgroup.
Does so by multiplying by the prime order, and checking that the result is unchanged.
fn double_in_place(&mut self) -> Result<(), SynthesisError>
[src]
fn negate(&self) -> Result<Self, SynthesisError>
[src]
fn scalar_mul_le<'a>(
&self,
bits: impl Iterator<Item = &'a Boolean<<P::BaseField as Field>::BasePrimeField>>
) -> Result<Self, SynthesisError>
[src]
&self,
bits: impl Iterator<Item = &'a Boolean<<P::BaseField as Field>::BasePrimeField>>
) -> Result<Self, SynthesisError>
Computes bits * self
, where bits
is a little-endian
Boolean
representation of a scalar.
fn precomputed_base_scalar_mul_le<'a, I, B>(
&mut self,
scalar_bits_with_bases: I
) -> Result<(), SynthesisError> where
I: Iterator<Item = (B, &'a SWProjective<P>)>,
B: Borrow<Boolean<<P::BaseField as Field>::BasePrimeField>>,
[src]
&mut self,
scalar_bits_with_bases: I
) -> Result<(), SynthesisError> where
I: Iterator<Item = (B, &'a SWProjective<P>)>,
B: Borrow<Boolean<<P::BaseField as Field>::BasePrimeField>>,
impl<P, F> CurveVar<GroupProjective<P>, <<P as ModelParameters>::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>,
&'a F: FieldOpsBounds<'a, P::BaseField, F>,
[src]
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField> + TwoBitLookupGadget<<P::BaseField as Field>::BasePrimeField, TableConstant = P::BaseField>,
&'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn constant(g: TEProjective<P>) -> Self
[src]
fn zero() -> Self
[src]
fn is_zero(
&self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
[src]
&self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, 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>
[src]
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<TEProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn enforce_prime_order(&self) -> Result<(), SynthesisError>
[src]
Enforce that self
is in the prime-order subgroup.
Does so by multiplying by the prime order, and checking that the result is unchanged.
fn double_in_place(&mut self) -> Result<(), SynthesisError>
[src]
fn negate(&self) -> Result<Self, SynthesisError>
[src]
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>>,
[src]
&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>>,