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