Struct curve25519_dalek::edwards::CompressedEdwardsY
source · Expand description
In “Edwards y” / “Ed25519” format, the curve point \((x,y)\) is determined by the \(y\)-coordinate and the sign of \(x\).
The first 255 bits of a CompressedEdwardsY
represent the
\(y\)-coordinate. The high bit of the 32nd byte gives the sign of \(x\).
Tuple Fields§
§0: [u8; 32]
Implementations§
source§impl CompressedEdwardsY
impl CompressedEdwardsY
sourcepub fn decompress(&self) -> Option<EdwardsPoint>
pub fn decompress(&self) -> Option<EdwardsPoint>
Attempt to decompress to an EdwardsPoint
.
Returns None
if the input is not the \(y\)-coordinate of a
curve point.
source§impl CompressedEdwardsY
impl CompressedEdwardsY
sourcepub fn from_slice(bytes: &[u8]) -> CompressedEdwardsY
pub fn from_slice(bytes: &[u8]) -> CompressedEdwardsY
Construct a CompressedEdwardsY
from a slice of bytes.
Panics
If the input bytes
slice does not have a length of 32.
Trait Implementations§
source§impl Clone for CompressedEdwardsY
impl Clone for CompressedEdwardsY
source§fn clone(&self) -> CompressedEdwardsY
fn clone(&self) -> CompressedEdwardsY
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 CompressedEdwardsY
impl ConstantTimeEq for CompressedEdwardsY
source§impl Debug for CompressedEdwardsY
impl Debug for CompressedEdwardsY
source§impl Default for CompressedEdwardsY
impl Default for CompressedEdwardsY
source§fn default() -> CompressedEdwardsY
fn default() -> CompressedEdwardsY
Returns the “default value” for a type. Read more
source§impl Hash for CompressedEdwardsY
impl Hash for CompressedEdwardsY
source§impl Identity for CompressedEdwardsY
impl Identity for CompressedEdwardsY
source§fn identity() -> CompressedEdwardsY
fn identity() -> CompressedEdwardsY
Returns the identity element of the curve.
Can be used as a constructor. Read more
source§impl PartialEq<CompressedEdwardsY> for CompressedEdwardsY
impl PartialEq<CompressedEdwardsY> for CompressedEdwardsY
source§fn eq(&self, other: &CompressedEdwardsY) -> bool
fn eq(&self, other: &CompressedEdwardsY) -> bool
source§impl Zeroize for CompressedEdwardsY
impl Zeroize for CompressedEdwardsY
impl Copy for CompressedEdwardsY
impl Eq for CompressedEdwardsY
impl StructuralEq for CompressedEdwardsY
impl StructuralPartialEq for CompressedEdwardsY
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§
source§impl<T> IsIdentity for Twhere
T: ConstantTimeEq + Identity,
impl<T> IsIdentity for Twhere
T: ConstantTimeEq + Identity,
source§fn is_identity(&self) -> bool
fn is_identity(&self) -> bool
Return true if this element is the identity element of the curve.