Trait snarkvm_curves::traits::pairing_engine::AffineCurve [−][src]
pub trait AffineCurve: Group + Sized + CanonicalSerialize + ConstantSerializedSize + CanonicalDeserialize + From<Self::Projective> { type BaseField: Field; type Projective: ProjectiveCurve<Affine = Self, ScalarField = Self::ScalarField> + From<Self> + Into<Self>;}Show 13 methods
fn prime_subgroup_generator() -> Self; fn from_x_coordinate(x: Self::BaseField, greatest: bool) -> Option<Self>; fn from_y_coordinate(y: Self::BaseField, greatest: bool) -> Option<Self>; fn mul_by_cofactor_to_projective(&self) -> Self::Projective; fn into_projective(&self) -> Self::Projective; fn from_random_bytes(bytes: &[u8]) -> Option<Self>; fn mul_bits<S: AsRef<[u64]>>(
&self,
bits: BitIteratorBE<S>
) -> Self::Projective; fn mul_by_cofactor_inv(&self) -> Self; fn is_in_correct_subgroup_assuming_on_curve(&self) -> bool; fn to_x_coordinate(&self) -> Self::BaseField; fn to_y_coordinate(&self) -> Self::BaseField; fn is_on_curve(&self) -> bool; fn mul_by_cofactor(&self) -> Self { ... }
Expand description
Affine representation of an elliptic curve point guaranteed to be in the correct prime order subgroup.
Associated Types
type Projective: ProjectiveCurve<Affine = 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.
fn from_x_coordinate(x: Self::BaseField, greatest: bool) -> Option<Self>
fn from_x_coordinate(x: Self::BaseField, greatest: bool) -> Option<Self>
Attempts to construct an affine point given an x-coordinate. The point is not guaranteed to be in the prime order subgroup.
If and only if greatest
is set will the lexicographically
largest y-coordinate be selected.
fn from_y_coordinate(y: Self::BaseField, greatest: bool) -> Option<Self>
fn from_y_coordinate(y: Self::BaseField, greatest: bool) -> Option<Self>
Attempts to construct an affine point given a y-coordinate. The point is not guaranteed to be in the prime order subgroup.
If and only if greatest
is set will the lexicographically
largest y-coordinate be selected.
fn mul_by_cofactor_to_projective(&self) -> Self::Projective
fn mul_by_cofactor_to_projective(&self) -> Self::Projective
Multiply this element by the cofactor and output the resulting projective element.
fn into_projective(&self) -> Self::Projective
fn into_projective(&self) -> Self::Projective
Converts this element into its projective representation.
Returns a group element if the set of bytes forms a valid group element, otherwise returns None. This function is primarily intended for sampling random group elements from a hash-function or RNG output.
fn mul_bits<S: AsRef<[u64]>>(&self, bits: BitIteratorBE<S>) -> Self::Projective
fn mul_bits<S: AsRef<[u64]>>(&self, bits: BitIteratorBE<S>) -> Self::Projective
Multiply this element by a scalar field element in BigInteger form.
fn mul_by_cofactor_inv(&self) -> Self
fn mul_by_cofactor_inv(&self) -> Self
Multiply this element by the inverse of the cofactor modulo the size of
Self::ScalarField
.
fn is_in_correct_subgroup_assuming_on_curve(&self) -> bool
fn is_in_correct_subgroup_assuming_on_curve(&self) -> bool
Checks that the point is in the prime order subgroup given the point on the curve.
fn to_x_coordinate(&self) -> Self::BaseField
fn to_x_coordinate(&self) -> Self::BaseField
Returns the x-coordinate of the point.
fn to_y_coordinate(&self) -> Self::BaseField
fn to_y_coordinate(&self) -> Self::BaseField
Returns the y-coordinate of the point.
fn is_on_curve(&self) -> bool
fn is_on_curve(&self) -> bool
Checks that the current point is on the elliptic curve.
Provided methods
fn mul_by_cofactor(&self) -> Self
fn mul_by_cofactor(&self) -> Self
Multiply this element by the cofactor.
Implementors
impl<P: Parameters> AffineCurve for snarkvm_curves::templates::short_weierstrass_jacobian::affine::Affine<P>
impl<P: Parameters> AffineCurve for snarkvm_curves::templates::short_weierstrass_projective::affine::Affine<P>
impl<P: Parameters> AffineCurve for snarkvm_curves::templates::twisted_edwards_extended::affine::Affine<P>