[][src]Struct zerocaf::edwards::CompressedEdwardsY

pub struct CompressedEdwardsY(pub [u8; 32]);

The first 255 bits of a CompressedEdwardsY represent the (y)-coordinate. The high bit of the 32nd byte gives the sign of (x).

Methods

impl CompressedEdwardsY[src]

pub fn from_slice(bytes: &[u8]) -> CompressedEdwardsY[src]

Construct a CompressedEdwardsY from a slice of bytes.

Note:

This function should only be used to get a CompressedEdwardsY compressed point from a [u8; 32] that we know that is already a compressed point.

If this function is used with Y-coordinates randomly might give errors.

pub fn to_bytes(&self) -> [u8; 32][src]

Return the CompressedEdwardsY as an array of bytes (it's cannonical state).

pub fn decompress(&self) -> Option<EdwardsPoint>[src]

Attempt to decompress to an EdwardsPoint.

Returns None if the input is not the Y-coordinate of a curve point.

Trait Implementations

impl Clone for CompressedEdwardsY[src]

impl ConstantTimeEq for CompressedEdwardsY[src]

impl Copy for CompressedEdwardsY[src]

impl Debug for CompressedEdwardsY[src]

impl Default for CompressedEdwardsY[src]

fn default() -> CompressedEdwardsY[src]

Returns the identity for CompressedEdwardsY point.

impl Eq for CompressedEdwardsY[src]

impl Identity for CompressedEdwardsY[src]

fn identity() -> CompressedEdwardsY[src]

Returns the CompressedEdwardsY identity point value that corresponds to 1 (mod l) with the x-sign bit setted to 0.

impl Index<usize> for CompressedEdwardsY[src]

type Output = u8

The returned type after indexing.

impl IndexMut<usize> for CompressedEdwardsY[src]

impl<'a> Neg for &'a CompressedEdwardsY[src]

type Output = CompressedEdwardsY

The resulting type after applying the - operator.

fn neg(self) -> CompressedEdwardsY[src]

Negates an CompressedEdwardsY by decompressing it, negating over Twisted Edwards Extended Projective Coordinates and compressing it back.

impl Neg for CompressedEdwardsY[src]

type Output = CompressedEdwardsY

The resulting type after applying the - operator.

fn neg(self) -> CompressedEdwardsY[src]

Negates an CompressedEdwardsY by decompressing it, negating over Twisted Edwards Extended Projective Coordinates and compressing it back.

impl PartialEq<CompressedEdwardsY> for CompressedEdwardsY[src]

Auto Trait Implementations

impl RefUnwindSafe for CompressedEdwardsY

impl Send for CompressedEdwardsY

impl Sync for CompressedEdwardsY

impl Unpin for CompressedEdwardsY

impl UnwindSafe for CompressedEdwardsY

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> From<T> for T[src]

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,