Skip to main content

AffineCoordinates

Trait AffineCoordinates 

Source
pub trait AffineCoordinates: Sized {
    type FieldRepr: AsRef<[u8]>;

    // Required methods
    fn from_coordinates(
        x: &Self::FieldRepr,
        y: &Self::FieldRepr,
    ) -> CtOption<Self>;
    fn x(&self) -> Self::FieldRepr;
    fn y(&self) -> Self::FieldRepr;
    fn x_is_odd(&self) -> Choice;
    fn y_is_odd(&self) -> Choice;
}
Expand description

Access to the affine coordinates of an elliptic curve point.

Required Associated Types§

Source

type FieldRepr: AsRef<[u8]>

Field element representation with curve-specific serialization/endianness.

Required Methods§

Source

fn from_coordinates(x: &Self::FieldRepr, y: &Self::FieldRepr) -> CtOption<Self>

Creates an affine point from its coordinates.

Source

fn x(&self) -> Self::FieldRepr

Get the affine x-coordinate as a serialized field element.

Source

fn y(&self) -> Self::FieldRepr

Get the affine y-coordinate as a serialized field element.

Source

fn x_is_odd(&self) -> Choice

Is the affine x-coordinate odd?

Source

fn y_is_odd(&self) -> Choice

Is the affine y-coordinate odd?

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.

Implementors§