Struct schnorrkel::points::RistrettoBoth
source · [−]pub struct RistrettoBoth { /* private fields */ }
Expand description
A RistrettoBoth
contains both an uncompressed RistrettoPoint
as well as the corresponding CompressedRistretto
. It provides
a convenient middle ground for protocols that both hash compressed
points to derive scalars for use with uncompressed points.
Implementations
Access the compressed Ristretto form
Extract the compressed Ristretto form
Access the point form
Extract the point form
Decompress into the RistrettoBoth
format that also retains the
compressed form.
Compress into the RistrettoBoth
format that also retains the
uncompressed form.
Construct a RistrettoBoth
from a slice of bytes.
Example
use schnorrkel::points::RistrettoBoth;
use schnorrkel::PUBLIC_KEY_LENGTH;
use schnorrkel::SignatureError;
let public_key_bytes: [u8; PUBLIC_KEY_LENGTH] = [
215, 90, 152, 1, 130, 177, 10, 183, 213, 75, 254, 211, 201, 100, 7, 58,
14, 225, 114, 243, 218, 166, 35, 37, 175, 2, 26, 104, 247, 7, 81, 26];
let public_key = RistrettoBoth::from_bytes(&public_key_bytes)?;
Returns
A Result
whose okay value is an EdDSA RistrettoBoth
or whose error value
is an SignatureError
describing the error that occurred.
pub fn from_bytes_ser(
name: &'static str,
description: &'static str,
bytes: &[u8]
) -> SignatureResult<RistrettoBoth>
pub fn from_bytes_ser(
name: &'static str,
description: &'static str,
bytes: &[u8]
) -> SignatureResult<RistrettoBoth>
Variant of RistrettoBoth::from_bytes
that propogates more informative errors.
Trait Implementations
Returns the “default value” for a type. Read more
We hide fields largely so that only compairing the compressed forms works.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for RistrettoBoth
impl Send for RistrettoBoth
impl Sync for RistrettoBoth
impl Unpin for RistrettoBoth
impl UnwindSafe for RistrettoBoth
Blanket Implementations
Mutably borrows from an owned value. Read more