Trait snarkvm_curves::traits::pairing_engine::ProjectiveCurve
source · [−]pub trait ProjectiveCurve: Group + Sized + CanonicalSerialize + ConstantSerializedSize + CanonicalDeserialize + Sum + From<Self::Affine> {
type BaseField: Field;
type Affine: AffineCurve<Projective = Self, ScalarField = Self::ScalarField> + From<Self> + Into<Self>;
fn prime_subgroup_generator() -> Self;
fn batch_normalization(v: &mut [Self]);
fn is_normalized(&self) -> bool;
fn add_assign_mixed(&mut self, other: &Self::Affine);
fn into_affine(&self) -> Self::Affine;
fn recommended_wnaf_for_scalar(
scalar: <Self::ScalarField as PrimeField>::BigInteger
) -> usize;
fn recommended_wnaf_for_num_scalars(num_scalars: usize) -> usize;
fn batch_normalization_into_affine(v: Vec<Self>) -> Vec<Self::Affine> { ... }
}
Expand description
Projective representation of an elliptic curve point guaranteed to be in the correct prime order subgroup.
Associated Types
type Affine: AffineCurve<Projective = Self, ScalarField = Self::ScalarField> + From<Self> + Into<Self>
Required methods
fn prime_subgroup_generator() -> Self
fn prime_subgroup_generator() -> Self
Returns a fixed generator of unknown exponent.
Normalizes a slice of projective elements so that conversion to affine is cheap.
fn is_normalized(&self) -> bool
fn is_normalized(&self) -> bool
Checks if the point is already “normalized” so that cheap affine conversion is possible.
fn add_assign_mixed(&mut self, other: &Self::Affine)
fn add_assign_mixed(&mut self, other: &Self::Affine)
Adds an affine element to this element.
fn into_affine(&self) -> Self::Affine
fn into_affine(&self) -> Self::Affine
Converts this element into its affine representation.
fn recommended_wnaf_for_scalar(
scalar: <Self::ScalarField as PrimeField>::BigInteger
) -> usize
fn recommended_wnaf_for_scalar(
scalar: <Self::ScalarField as PrimeField>::BigInteger
) -> usize
Recommends a wNAF window table size given a scalar. Always returns a number between 2 and 22, inclusive.
fn recommended_wnaf_for_num_scalars(num_scalars: usize) -> usize
fn recommended_wnaf_for_num_scalars(num_scalars: usize) -> usize
Recommends a wNAF window size given the number of scalars you intend to multiply a base by. Always returns a number between 2 and 22, inclusive.
Provided methods
fn batch_normalization_into_affine(v: Vec<Self>) -> Vec<Self::Affine>
fn batch_normalization_into_affine(v: Vec<Self>) -> Vec<Self::Affine>
Normalizes a slice of projective elements and outputs a vector containing the affine equivalents.