Skip to main content

Coordinates

Enum Coordinates 

Source
pub enum Coordinates<'a, C: Curve> {
    Identity,
    Compact {
        x: &'a FieldBytes<C>,
    },
    Compressed {
        x: &'a FieldBytes<C>,
        y_is_odd: bool,
    },
    Uncompressed {
        x: &'a FieldBytes<C>,
        y: &'a FieldBytes<C>,
    },
}
Expand description

Enum representing the coordinates of either compressed or uncompressed SEC1-encoded elliptic curve points.

Variants§

§

Identity

Identity point (a.k.a. point at infinity)

§

Compact

Compact curve point

Fields

§x: &'a FieldBytes<C>

x-coordinate

§

Compressed

Compressed curve point

Fields

§x: &'a FieldBytes<C>

x-coordinate

§y_is_odd: bool

Is the y-coordinate odd?

§

Uncompressed

Uncompressed curve point

Fields

§x: &'a FieldBytes<C>

x-coordinate

§y: &'a FieldBytes<C>

y-coordinate

Implementations§

Source§

impl<'a, C: Curve> Coordinates<'a, C>

Source

pub fn tag(&self) -> Tag

Get the tag octet needed to encode this set of Coordinates

Trait Implementations§

Source§

impl<'a, C: Clone + Curve> Clone for Coordinates<'a, C>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, C: Copy + Curve> Copy for Coordinates<'a, C>

Source§

impl<'a, C: Debug + Curve> Debug for Coordinates<'a, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, C: Eq + Curve> Eq for Coordinates<'a, C>

Source§

impl<'a, C: PartialEq + Curve> PartialEq for Coordinates<'a, C>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a, C: PartialEq + Curve> StructuralPartialEq for Coordinates<'a, C>

Auto Trait Implementations§

§

impl<'a, C> Freeze for Coordinates<'a, C>

§

impl<'a, C> RefUnwindSafe for Coordinates<'a, C>

§

impl<'a, C> Send for Coordinates<'a, C>

§

impl<'a, C> Sync for Coordinates<'a, C>

§

impl<'a, C> Unpin for Coordinates<'a, C>

§

impl<'a, C> UnsafeUnpin for Coordinates<'a, C>

§

impl<'a, C> UnwindSafe for Coordinates<'a, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.