Struct salty::CompressedY
source · pub struct CompressedY(pub [u8; 32]);
Expand description
“Compressed” form of a EdwardsPoint
, whereby
the sign of the x-coordinate is stuffed in a
spare bit of the y-coordinate
Tuple Fields§
§0: [u8; 32]
Implementations§
source§impl CompressedY
impl CompressedY
sourcepub fn decompressed(&self) -> Result<EdwardsPoint>
pub fn decompressed(&self) -> Result<EdwardsPoint>
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.
Trait Implementations§
source§impl Clone for CompressedY
impl Clone for CompressedY
source§fn clone(&self) -> CompressedY
fn clone(&self) -> CompressedY
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ConstantTimeEq for CompressedY
impl ConstantTimeEq for CompressedY
source§impl Debug for CompressedY
impl Debug for CompressedY
source§impl Default for CompressedY
impl Default for CompressedY
source§fn default() -> CompressedY
fn default() -> CompressedY
Returns the “default value” for a type. Read more
source§impl PartialEq for CompressedY
impl PartialEq for CompressedY
impl Copy for CompressedY
Auto Trait Implementations§
impl RefUnwindSafe for CompressedY
impl Send for CompressedY
impl Sync for CompressedY
impl Unpin for CompressedY
impl UnwindSafe for CompressedY
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more