Struct curve25519_dalek::edwards::CompressedEdwardsY
source · pub struct CompressedEdwardsY(pub [u8; 32]);
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]) -> Result<CompressedEdwardsY, TryFromSliceError>
pub fn from_slice(bytes: &[u8]) -> Result<CompressedEdwardsY, TryFromSliceError>
Construct a CompressedEdwardsY
from a slice of bytes.
§Errors
Returns TryFromSliceError
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<'de> Deserialize<'de> for CompressedEdwardsY
impl<'de> Deserialize<'de> for CompressedEdwardsY
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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.
source§impl PartialEq for CompressedEdwardsY
impl PartialEq for CompressedEdwardsY
source§fn eq(&self, other: &CompressedEdwardsY) -> bool
fn eq(&self, other: &CompressedEdwardsY) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CompressedEdwardsY
impl Serialize for CompressedEdwardsY
source§impl TryFrom<&[u8]> for CompressedEdwardsY
impl TryFrom<&[u8]> for CompressedEdwardsY
§type Error = TryFromSliceError
type Error = TryFromSliceError
The type returned in the event of a conversion error.
source§fn try_from(slice: &[u8]) -> Result<CompressedEdwardsY, TryFromSliceError>
fn try_from(slice: &[u8]) -> Result<CompressedEdwardsY, TryFromSliceError>
Performs the conversion.
source§impl Zeroize for CompressedEdwardsY
impl Zeroize for CompressedEdwardsY
impl Copy for CompressedEdwardsY
impl Eq for CompressedEdwardsY
impl StructuralPartialEq for CompressedEdwardsY
Auto Trait Implementations§
impl Freeze for CompressedEdwardsY
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> 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.