Trait snarkvm_curves::traits::pairing_engine::ProjectiveCurve [−][src]
pub trait ProjectiveCurve: Eq + Sized + ToBytes + FromBytes + CanonicalSerialize + ConstantSerializedSize + CanonicalDeserialize + Copy + Clone + Default + Send + Sync + Hash + Debug + Display + UniformRand + Zero + 'static + Neg<Output = Self> + for<'a> Add<&'a Self, Output = Self> + for<'a> Sub<&'a Self, Output = Self> + for<'a> AddAssign<&'a Self> + for<'a> SubAssign<&'a Self> + From<Self::Affine> { type ScalarField: PrimeField + SquareRootField + Into<<Self::ScalarField as PrimeField>::BigInteger>; 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 double_in_place(&mut self) -> &mut Self; fn add_assign_mixed(&mut self, other: &Self::Affine); fn mul_assign<S: Into<<Self::ScalarField as PrimeField>::BigInteger>>(
&mut self,
other: S
); 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> { ... } fn double(&self) -> Self { ... } }
Expand description
Projective representation of an elliptic curve point guaranteed to be in the correct prime order subgroup.
Associated Types
type ScalarField: PrimeField + SquareRootField + Into<<Self::ScalarField as PrimeField>::BigInteger>
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 double_in_place(&mut self) -> &mut Self
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 mul_assign<S: Into<<Self::ScalarField as PrimeField>::BigInteger>>(
&mut self,
other: S
)
fn mul_assign<S: Into<<Self::ScalarField as PrimeField>::BigInteger>>(
&mut self,
other: S
)
Performs scalar multiplication of 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.
Implementors
impl<P: Parameters> ProjectiveCurve for snarkvm_curves::templates::short_weierstrass::short_weierstrass_jacobian::GroupProjective<P>
impl<P: Parameters> ProjectiveCurve for snarkvm_curves::templates::short_weierstrass::short_weierstrass_projective::GroupProjective<P>
impl<P: Parameters> ProjectiveCurve for snarkvm_curves::templates::twisted_edwards_extended::GroupProjective<P>