pub struct DHPublicKey(/* private fields */);Expand description
A ristretto255 group element.
§Security
This can be instantiated only by decoding, by the element derivation function, or by a group operation, so it is always a valid ristretto255 element. The element is held decompressed, so repeated operations on the same key do not repeat point decompression.
Implementations§
Source§impl DHPublicKey
impl DHPublicKey
Sourcepub fn decode(bytes: [u8; 32]) -> Result<Self, Error>
pub fn decode(bytes: [u8; 32]) -> Result<Self, Error>
Decode a group element from its 32 byte encoding, validating that it is a real ristretto255 element.
This must be used for any untrusted bytes (wire or storage) such that an invalid element cannot be instantiated.
Sourcepub fn into_bytes(self) -> [u8; 32]
pub fn into_bytes(self) -> [u8; 32]
The canonical 32-byte encoding of this element.
Trait Implementations§
Source§impl Clone for DHPublicKey
impl Clone for DHPublicKey
Source§fn clone(&self) -> DHPublicKey
fn clone(&self) -> DHPublicKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DHPublicKey
impl Debug for DHPublicKey
Source§impl<'de> Deserialize<'de> for DHPublicKey
impl<'de> Deserialize<'de> for DHPublicKey
Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DHPublicKey
impl Serialize for DHPublicKey
impl Copy for DHPublicKey
Auto Trait Implementations§
impl Freeze for DHPublicKey
impl RefUnwindSafe for DHPublicKey
impl Send for DHPublicKey
impl Sync for DHPublicKey
impl Unpin for DHPublicKey
impl UnsafeUnpin for DHPublicKey
impl UnwindSafe for DHPublicKey
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