Trait pasta_curves::arithmetic::CurveAffine [−][src]
pub trait CurveAffine: PrimeCurveAffine<Scalar = Self::ScalarExt, Curve = Self::CurveExt> + Default + Add<Output = <Self as PrimeCurveAffine>::Curve> + Sub<Output = <Self as PrimeCurveAffine>::Curve> + ConditionallySelectable + ConstantTimeEq + From<<Self as PrimeCurveAffine>::Curve> {
type ScalarExt: FieldExt;
type Base: FieldExt;
type CurveExt: CurveExt<AffineExt = Self, ScalarExt = <Self as CurveAffine>::ScalarExt>;
fn coordinates(&self) -> CtOption<Coordinates<Self>>;
fn from_xy(x: Self::Base, y: Self::Base) -> CtOption<Self>;
fn is_on_curve(&self) -> Choice;
fn a() -> Self::Base;
fn b() -> Self::Base;
fn read<R: Read>(reader: &mut R) -> Result<Self> { ... }
fn write<W: Write>(&self, writer: &mut W) -> Result<()> { ... }
}
Expand description
This trait is the affine counterpart to Curve
and is used for
serialization, storage in memory, and inspection of $x$ and $y$ coordinates.
Associated Types
type CurveExt: CurveExt<AffineExt = Self, ScalarExt = <Self as CurveAffine>::ScalarExt>
type CurveExt: CurveExt<AffineExt = Self, ScalarExt = <Self as CurveAffine>::ScalarExt>
The projective form of the curve
Required methods
fn coordinates(&self) -> CtOption<Coordinates<Self>>
fn coordinates(&self) -> CtOption<Coordinates<Self>>
Gets the coordinates of this point.
Returns None if this is the identity.
Obtains a point given $(x, y)$, failing if it is not on the curve.
fn is_on_curve(&self) -> Choice
fn is_on_curve(&self) -> Choice
Returns whether or not this element is on the curve; should always be true unless an “unchecked” API was used.
Provided methods
Reads a compressed element from the buffer and attempts to parse it
using from_bytes
.