pub trait GenericCurveAffine:
Copy
+ Clone
+ Sized
+ Send
+ Sync
+ Debug
+ Display
+ PartialEq
+ Eq
+ 'static {
type Scalar: PrimeField;
type Base: SqrtField;
type Projective: GenericCurveProjective<Affine = Self, Scalar = Self::Scalar, Base = Self::Base>;
// Required methods
fn zero() -> Self;
fn one() -> Self;
fn is_zero(&self) -> bool;
fn negate(&mut self);
fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
) -> Self::Projective;
fn into_projective(&self) -> Self::Projective;
fn as_xy(&self) -> (&Self::Base, &Self::Base);
fn into_xy_unchecked(self) -> (Self::Base, Self::Base);
fn from_xy_unchecked(x: Self::Base, y: Self::Base) -> Self;
fn from_xy_checked(
x: Self::Base,
y: Self::Base,
) -> Result<Self, GroupDecodingError>;
fn a_coeff() -> Self::Base;
fn b_coeff() -> Self::Base;
}Expand description
Affine representation of an elliptic curve point guaranteed to be in the correct prime order subgroup.
Required Associated Types§
type Scalar: PrimeField
type Base: SqrtField
type Projective: GenericCurveProjective<Affine = Self, Scalar = Self::Scalar, Base = Self::Base>
Required Methods§
Sourcefn is_zero(&self) -> bool
fn is_zero(&self) -> bool
Determines if this point represents the point at infinity; the additive identity.
Sourcefn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
) -> Self::Projective
fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>( &self, other: S, ) -> Self::Projective
Performs scalar multiplication of this element with mixed addition.
Sourcefn into_projective(&self) -> Self::Projective
fn into_projective(&self) -> Self::Projective
Converts this element into its affine representation.
Sourcefn as_xy(&self) -> (&Self::Base, &Self::Base)
fn as_xy(&self) -> (&Self::Base, &Self::Base)
Returns references to underlying X and Y coordinates. Users should check for infinity outside of this call
Sourcefn into_xy_unchecked(self) -> (Self::Base, Self::Base)
fn into_xy_unchecked(self) -> (Self::Base, Self::Base)
Returns underlying X and Y coordinates. Users should check for infinity outside of this call
Sourcefn from_xy_unchecked(x: Self::Base, y: Self::Base) -> Self
fn from_xy_unchecked(x: Self::Base, y: Self::Base) -> Self
Creates a point from raw X and Y coordinates. Point of infinity is encoded as (0,0) by default. On-curve check is NOT performed
Sourcefn from_xy_checked(
x: Self::Base,
y: Self::Base,
) -> Result<Self, GroupDecodingError>
fn from_xy_checked( x: Self::Base, y: Self::Base, ) -> Result<Self, GroupDecodingError>
Creates a point from raw X and Y coordinates. Point of infinity is encoded as (0,0) by default. On-curve check is performed
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.