Trait ark_ec::ProjectiveCurve [−][src]
pub trait ProjectiveCurve: Eq + 'static + Sized + ToBytes + FromBytes + CanonicalSerialize + CanonicalDeserialize + Copy + Clone + Default + Send + Sync + Hash + Debug + Display + UniformRand + Zeroize + Zero + Neg<Output = Self> + Add<Self, Output = Self> + Sub<Self, Output = Self> + AddAssign<Self> + SubAssign<Self> + MulAssign<Self::ScalarField> + for<'a> Add<&'a Self, Output = Self> + for<'a> Sub<&'a Self, Output = Self> + for<'a> AddAssign<&'a Self> + for<'a> SubAssign<&'a Self> + Sum<Self> + for<'a> Sum<&'a Self> + From<Self::Affine> { type ScalarField: PrimeField + SquareRootField; type BaseField: Field; type Affine: AffineCurve<Projective = Self, ScalarField = Self::ScalarField, BaseField = Self::BaseField> + From<Self> + Into<Self>; const COFACTOR: &'static [u64]; #[must_use] fn prime_subgroup_generator() -> Self; fn batch_normalization(v: &mut [Self]); #[must_use] fn is_normalized(&self) -> bool; fn double_in_place(&mut self) -> &mut Self; fn add_assign_mixed(&mut self, other: &Self::Affine); fn batch_normalization_into_affine(v: &[Self]) -> Vec<Self::Affine> { ... } #[must_use] fn double(&self) -> Self { ... } fn into_affine(&self) -> Self::Affine { ... } fn add_mixed(self, other: &Self::Affine) -> Self { ... } fn mul<S: AsRef<[u64]>>(self, other: S) -> Self { ... } }
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, BaseField = Self::BaseField> + From<Self> + Into<Self>
[src]Associated Constants
Required methods
#[must_use]fn prime_subgroup_generator() -> Self
[src]
#[must_use]fn prime_subgroup_generator() -> Self
[src]Returns a fixed generator of unknown exponent.
fn batch_normalization(v: &mut [Self])
[src]
fn batch_normalization(v: &mut [Self])
[src]Normalizes a slice of projective elements so that conversion to affine is cheap.
#[must_use]fn is_normalized(&self) -> bool
[src]
#[must_use]fn is_normalized(&self) -> bool
[src]Checks if the point is already “normalized” so that cheap affine conversion is possible.
fn double_in_place(&mut self) -> &mut Self
[src]
fn double_in_place(&mut self) -> &mut Self
[src]Doubles this element in place.
fn add_assign_mixed(&mut self, other: &Self::Affine)
[src]
fn add_assign_mixed(&mut self, other: &Self::Affine)
[src]Set self
to be self + other
, where other: Self::Affine
.
This is usually faster than adding other
in projective form.
Provided methods
fn batch_normalization_into_affine(v: &[Self]) -> Vec<Self::Affine>
[src]
fn batch_normalization_into_affine(v: &[Self]) -> Vec<Self::Affine>
[src]Normalizes a slice of projective elements and outputs a vector containing the affine equivalents.
fn into_affine(&self) -> Self::Affine
[src]
fn into_affine(&self) -> Self::Affine
[src]Converts self into the affine representation.
Set self
to be self + other
, where other: Self::Affine
.
This is usually faster than adding other
in projective form.
Implementors
impl<P: Parameters> ProjectiveCurve for ark_ec::models::short_weierstrass_jacobian::GroupProjective<P>
[src]
impl<P: Parameters> ProjectiveCurve for ark_ec::models::short_weierstrass_jacobian::GroupProjective<P>
[src]Normalizes a slice of projective elements so that conversion to affine is cheap.
In more detail, this method converts a curve point in Jacobian coordinates (x, y, z) into an equivalent representation (x/z^2, y/z^3, 1).
For N = v.len()
, this costs 1 inversion + 6N field multiplications + N field squarings.
(Where batch inversion comprises 3N field multiplications + 1 inversion of these operations)
Sets self = 2 * self
. Note that Jacobian formulae are incomplete, and
so doubling cannot be computed as self + self
. Instead, this implementation
uses the following specialized doubling formulae:
When other.is_normalized()
(i.e., other.z == 1
), we can use a more efficient
formula
to compute self + other
.
type ScalarField = P::ScalarField
type Affine = GroupAffine<P>
impl<P: Parameters> ProjectiveCurve for ark_ec::models::twisted_edwards_extended::GroupProjective<P>
[src]
impl<P: Parameters> ProjectiveCurve for ark_ec::models::twisted_edwards_extended::GroupProjective<P>
[src]type ScalarField = P::ScalarField
type Affine = GroupAffine<P>