Struct secp256k1::ellswift::ElligatorSwiftSharedSecret
source · pub struct ElligatorSwiftSharedSecret(/* private fields */);
Expand description
The result of ElligatorSwift::shared_secret
, which is a shared secret
computed from the x-only ECDH using both parties’ public keys (ElligatorSwift
encoded) and our own
private key.
Implementations§
sourcepub const fn from_secret_bytes(bytes: [u8; 32]) -> Self
pub const fn from_secret_bytes(bytes: [u8; 32]) -> Self
Creates shared secret from bytes.
This is generally not needed except for unusual cases like restoring the secret from a database.
sourcepub const fn to_secret_bytes(self) -> [u8; 32]
pub const fn to_secret_bytes(self) -> [u8; 32]
Returns the secret bytes as an array.
sourcepub const fn as_secret_bytes(&self) -> &[u8; 32]
pub const fn as_secret_bytes(&self) -> &[u8; 32]
Returns the secret bytes as a reference to an array.
Trait Implementations§
source§fn clone(&self) -> ElligatorSwiftSharedSecret
fn clone(&self) -> ElligatorSwiftSharedSecret
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§fn cmp(&self, other: &ElligatorSwiftSharedSecret) -> Ordering
fn cmp(&self, other: &ElligatorSwiftSharedSecret) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§fn eq(&self, other: &ElligatorSwiftSharedSecret) -> bool
fn eq(&self, other: &ElligatorSwiftSharedSecret) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§fn partial_cmp(&self, other: &ElligatorSwiftSharedSecret) -> Option<Ordering>
fn partial_cmp(&self, other: &ElligatorSwiftSharedSecret) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreAuto Trait Implementations§
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: 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> 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
)