pub trait CurveVar<C: CurveGroup, ConstraintF: PrimeField>:
'static
+ Sized
+ Clone
+ Debug
+ R1CSVar<ConstraintF, Value = C>
+ ToBitsGadget<ConstraintF>
+ ToBytesGadget<ConstraintF>
+ EqGadget<ConstraintF>
+ CondSelectGadget<ConstraintF>
+ AllocVar<C, ConstraintF>
+ AllocVar<C::Affine, ConstraintF>
+ ToConstraintFieldGadget<ConstraintF>
+ for<'a> GroupOpsBounds<'a, C, Self>
+ for<'a> AddAssign<&'a Self>
+ for<'a> SubAssign<&'a Self>
+ AddAssign<C>
+ SubAssign<C>
+ AddAssign<Self>
+ SubAssign<Self>
+ Mul<EmulatedFpVar<C::ScalarField, ConstraintF>, Output = Self>
+ for<'a> Mul<&'a EmulatedFpVar<C::ScalarField, ConstraintF>, Output = Self>
+ MulAssign<EmulatedFpVar<C::ScalarField, ConstraintF>> {
// Required methods
fn zero() -> Self;
fn constant(other: C) -> Self;
fn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<ConstraintF>>,
f: impl FnOnce() -> Result<C, SynthesisError>,
mode: AllocationMode,
) -> Result<Self, SynthesisError>;
fn enforce_prime_order(&self) -> Result<(), SynthesisError>;
fn double_in_place(&mut self) -> Result<(), SynthesisError>;
fn negate(&self) -> Result<Self, SynthesisError>;
// Provided methods
fn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError> { ... }
fn double(&self) -> Result<Self, SynthesisError> { ... }
fn scalar_mul_le<'a>(
&self,
bits: impl Iterator<Item = &'a Boolean<ConstraintF>>,
) -> Result<Self, SynthesisError> { ... }
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 { ... }
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]> { ... }
}
Expand description
A variable that represents a curve point for
the curve C
.
Required Methods§
Sourcefn constant(other: C) -> Self
fn constant(other: C) -> Self
Returns a constant with value v
.
This should not allocate any variables.
Sourcefn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<ConstraintF>>,
f: impl FnOnce() -> Result<C, SynthesisError>,
mode: AllocationMode,
) -> Result<Self, SynthesisError>
fn new_variable_omit_prime_order_check( 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.
Sourcefn enforce_prime_order(&self) -> Result<(), SynthesisError>
fn enforce_prime_order(&self) -> Result<(), SynthesisError>
Enforce that self
is in the prime-order subgroup.
Sourcefn double_in_place(&mut self) -> Result<(), SynthesisError>
fn double_in_place(&mut self) -> Result<(), SynthesisError>
Sets self = self + self
.
Sourcefn negate(&self) -> Result<Self, SynthesisError>
fn negate(&self) -> Result<Self, SynthesisError>
Coputes -self
.
Provided Methods§
Sourcefn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError>
fn is_zero(&self) -> Result<Boolean<ConstraintF>, SynthesisError>
Returns a Boolean
representing whether self == Self::zero()
.
Sourcefn double(&self) -> Result<Self, SynthesisError>
fn double(&self) -> Result<Self, SynthesisError>
Computes self + self
.
Sourcefn 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>
Computes bits * self
, where bits
is a little-endian
Boolean
representation of a scalar.
Sourcefn precomputed_base_scalar_mul_le<'a, I, B>(
&mut self,
scalar_bits_with_bases: I,
) -> Result<(), SynthesisError>
fn precomputed_base_scalar_mul_le<'a, I, B>( &mut self, scalar_bits_with_bases: I, ) -> Result<(), SynthesisError>
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.
Sourcefn 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>
Computes Σⱼ(scalarⱼ * baseⱼ)
for all j,
where scalarⱼ
is a Boolean
little-endian
representation of the j-th scalar.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.