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

Associated Constants

Required methods

Returns a fixed generator of unknown exponent.

Normalizes a slice of projective elements so that conversion to affine is cheap.

Checks if the point is already “normalized” so that cheap affine conversion is possible.

Doubles this element in place.

Set self to be self + other, where other: Self::Affine. This is usually faster than adding other in projective form.

Provided methods

Normalizes a slice of projective elements and outputs a vector containing the affine equivalents.

Doubles this element.

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.

Performs scalar multiplication of this element.

Implementors

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.