Struct curve25519_dalek::ristretto::CompressedRistretto
source · pub struct CompressedRistretto(pub [u8; 32]);
Expand description
A Ristretto point, in compressed wire format.
The Ristretto encoding is canonical, so two points are equal if and only if their encodings are equal.
Tuple Fields§
§0: [u8; 32]
Implementations§
source§impl CompressedRistretto
impl CompressedRistretto
sourcepub fn from_slice(
bytes: &[u8],
) -> Result<CompressedRistretto, TryFromSliceError>
pub fn from_slice( bytes: &[u8], ) -> Result<CompressedRistretto, TryFromSliceError>
Construct a CompressedRistretto
from a slice of bytes.
§Errors
Returns TryFromSliceError
if the input bytes
slice does not have
a length of 32.
sourcepub fn decompress(&self) -> Option<RistrettoPoint>
pub fn decompress(&self) -> Option<RistrettoPoint>
Attempt to decompress to an RistrettoPoint
.
§Return
-
Some(RistrettoPoint)
ifself
was the canonical encoding of a point; -
None
ifself
was not the canonical encoding of a point.
Trait Implementations§
source§impl Clone for CompressedRistretto
impl Clone for CompressedRistretto
source§fn clone(&self) -> CompressedRistretto
fn clone(&self) -> CompressedRistretto
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 CompressedRistretto
impl ConstantTimeEq for CompressedRistretto
source§impl Debug for CompressedRistretto
impl Debug for CompressedRistretto
source§impl Default for CompressedRistretto
impl Default for CompressedRistretto
source§fn default() -> CompressedRistretto
fn default() -> CompressedRistretto
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for CompressedRistretto
impl<'de> Deserialize<'de> for CompressedRistretto
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 CompressedRistretto
impl Hash for CompressedRistretto
source§impl Identity for CompressedRistretto
impl Identity for CompressedRistretto
source§fn identity() -> CompressedRistretto
fn identity() -> CompressedRistretto
Returns the identity element of the curve.
Can be used as a constructor.
source§impl PartialEq for CompressedRistretto
impl PartialEq for CompressedRistretto
source§fn eq(&self, other: &CompressedRistretto) -> bool
fn eq(&self, other: &CompressedRistretto) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CompressedRistretto
impl Serialize for CompressedRistretto
source§impl TryFrom<&[u8]> for CompressedRistretto
impl TryFrom<&[u8]> for CompressedRistretto
§type Error = TryFromSliceError
type Error = TryFromSliceError
The type returned in the event of a conversion error.
source§fn try_from(slice: &[u8]) -> Result<CompressedRistretto, TryFromSliceError>
fn try_from(slice: &[u8]) -> Result<CompressedRistretto, TryFromSliceError>
Performs the conversion.
source§impl Zeroize for CompressedRistretto
impl Zeroize for CompressedRistretto
impl Copy for CompressedRistretto
impl Eq for CompressedRistretto
impl StructuralPartialEq for CompressedRistretto
Auto Trait Implementations§
impl Freeze for CompressedRistretto
impl RefUnwindSafe for CompressedRistretto
impl Send for CompressedRistretto
impl Sync for CompressedRistretto
impl Unpin for CompressedRistretto
impl UnwindSafe for CompressedRistretto
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.