Struct curve25519_dalek::ristretto::CompressedRistretto
source · [−]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
sourceimpl CompressedRistretto
impl CompressedRistretto
sourcepub fn from_slice(bytes: &[u8]) -> CompressedRistretto
pub fn from_slice(bytes: &[u8]) -> CompressedRistretto
Construct a CompressedRistretto
from a slice of bytes.
Panics
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
sourceimpl Clone for CompressedRistretto
impl Clone for CompressedRistretto
sourcefn clone(&self) -> CompressedRistretto
fn clone(&self) -> CompressedRistretto
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ConstantTimeEq for CompressedRistretto
impl ConstantTimeEq for CompressedRistretto
sourcefn ct_eq(&self, other: &CompressedRistretto) -> Choice
fn ct_eq(&self, other: &CompressedRistretto) -> Choice
Determine if two items are equal. Read more
sourceimpl Debug for CompressedRistretto
impl Debug for CompressedRistretto
sourceimpl Default for CompressedRistretto
impl Default for CompressedRistretto
sourcefn default() -> CompressedRistretto
fn default() -> CompressedRistretto
Returns the “default value” for a type. Read more
sourceimpl Hash for CompressedRistretto
impl Hash for CompressedRistretto
sourceimpl Identity for CompressedRistretto
impl Identity for CompressedRistretto
sourcefn identity() -> CompressedRistretto
fn identity() -> CompressedRistretto
Returns the identity element of the curve. Can be used as a constructor. Read more
sourceimpl PartialEq<CompressedRistretto> for CompressedRistretto
impl PartialEq<CompressedRistretto> for CompressedRistretto
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &CompressedRistretto) -> bool
fn ne(&self, other: &CompressedRistretto) -> bool
This method tests for !=
.
sourceimpl Zeroize for CompressedRistretto
impl Zeroize for CompressedRistretto
impl Copy for CompressedRistretto
impl Eq for CompressedRistretto
impl StructuralEq for CompressedRistretto
impl StructuralPartialEq for CompressedRistretto
Auto Trait Implementations
impl RefUnwindSafe for CompressedRistretto
impl Send for CompressedRistretto
impl Sync for CompressedRistretto
impl Unpin for CompressedRistretto
impl UnwindSafe for CompressedRistretto
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> IsIdentity for T where
T: ConstantTimeEq + Identity,
impl<T> IsIdentity for T where
T: ConstantTimeEq + Identity,
sourcefn is_identity(&self) -> bool
fn is_identity(&self) -> bool
Return true if this element is the identity element of the curve.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more