[][src]Struct salty::CompressedY

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

"Compressed" form of a CurvePoint, whereby the sign of the x-coordinate is stuffed in a spare bit of the y-coordinate


impl CompressedY[src]

pub fn decompressed(&self) -> Result<CurvePoint>[src]

This is rather tricky: to get the x-coordinate, and not just its sign, need to calculate the square root of u/v := (y**2 - 1)/(dy**2 + 1). Moreover, we want to detect whether our compressed Y actually corresponds to a point on the curve! The original sources are the Tweet NaCl paper, section 5 and the ed25519 paper, also section 5.

impl CompressedY[src]

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

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

Trait Implementations

impl<'_> From<&'_ [u8; 32]> for CompressedY[src]

impl PartialEq<CompressedY> for CompressedY[src]

impl Debug for CompressedY[src]

impl Copy for CompressedY[src]

impl Clone for CompressedY[src]

impl Default for CompressedY[src]

impl ConstantTimeEq for CompressedY[src]

Auto Trait Implementations

impl Unpin for CompressedY

impl Send for CompressedY

impl Sync for CompressedY

Blanket Implementations

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

The type returned in the event of a conversion error.

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

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

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