Skip to main content

CompressedEdwardsY

Struct CompressedEdwardsY 

Source
pub struct CompressedEdwardsY(pub [u8; 57]);
Expand description

Represents a point on the Compressed Twisted Edwards Curve in little endian format where the most significant bit is the sign bit and the remaining 448 bits represent the y-coordinate

Tuple Fields§

§0: [u8; 57]

Implementations§

Source§

impl CompressedEdwardsY

Source

pub const GENERATOR: Self

The compressed generator point

Source

pub const IDENTITY: Self

The compressed identity point

Source

pub fn decompress_unchecked(&self) -> CtOption<AffinePoint>

Attempt to decompress to an AffinePoint.

Returns None if the input is not the \(y\)-coordinate of a curve point.

Source

pub fn decompress(&self) -> CtOption<AffinePoint>

Attempt to decompress to an AffinePoint.

Returns None:

  • if the input is not the \(y\)-coordinate of a curve point.
  • if the input point is not on the curve.
  • if the input point has nonzero torsion component.
Source

pub const fn as_bytes(&self) -> &[u8; 57]

View this CompressedEdwardsY as an array of bytes.

Source

pub const fn to_bytes(&self) -> [u8; 57]

Copy this CompressedEdwardsY to an array of bytes.

Trait Implementations§

Source§

impl AsRef<[u8]> for CompressedEdwardsY

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<[u8; 57]> for CompressedEdwardsY

Source§

fn as_ref(&self) -> &[u8; 57]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for CompressedEdwardsY

Source§

fn clone(&self) -> CompressedEdwardsY

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConditionallySelectable for CompressedEdwardsY

Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
Source§

impl ConstantTimeEq for CompressedEdwardsY

Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl Debug for CompressedEdwardsY

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CompressedEdwardsY

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for CompressedEdwardsY

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
Source§

impl From<&CompressedEdwardsY> for [u8; 57]

Source§

fn from(value: &CompressedEdwardsY) -> Self

Converts to this type from the input type.
Source§

impl From<&CompressedEdwardsY> for Vec<u8>

Available on crate feature alloc only.
Source§

fn from(value: &CompressedEdwardsY) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 57]> for CompressedEdwardsY

Source§

fn from(point: [u8; 57]) -> Self

Converts to this type from the input type.
Source§

impl From<CompressedEdwardsY> for [u8; 57]

Source§

fn from(value: CompressedEdwardsY) -> Self

Converts to this type from the input type.
Source§

impl From<CompressedEdwardsY> for Vec<u8>

Available on crate feature alloc only.
Source§

fn from(value: CompressedEdwardsY) -> Self

Converts to this type from the input type.
Source§

impl LowerHex for CompressedEdwardsY

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CompressedEdwardsY

Source§

fn eq(&self, other: &CompressedEdwardsY) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&[u8]> for CompressedEdwardsY

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from(value: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Vec<u8>> for CompressedEdwardsY

Available on crate feature alloc only.
Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Vec<u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Box<[u8]>> for CompressedEdwardsY

Available on crate feature alloc only.
Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from(value: Box<[u8]>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<u8>> for CompressedEdwardsY

Available on crate feature alloc only.
Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from(value: Vec<u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl UpperHex for CompressedEdwardsY

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
Source§

impl Zeroize for CompressedEdwardsY

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl Copy for CompressedEdwardsY

Source§

impl Eq for CompressedEdwardsY

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.