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§impl Serialize for CompressedEdwardsY
impl Serialize for CompressedEdwardsY
Source§impl TryFrom<&[u8]> for CompressedEdwardsY
impl TryFrom<&[u8]> for CompressedEdwardsY
Source§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§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.