Struct vodozemac::Curve25519SecretKey
source · pub struct Curve25519SecretKey(/* private fields */);
Expand description
Struct representing a Curve25519 secret key.
Implementations§
source§impl Curve25519SecretKey
impl Curve25519SecretKey
sourcepub fn from_slice(bytes: &[u8; 32]) -> Self
pub fn from_slice(bytes: &[u8; 32]) -> Self
Create a Curve25519SecretKey
from the given slice of bytes.
sourcepub fn diffie_hellman(
&self,
their_public_key: &Curve25519PublicKey,
) -> SharedSecret
pub fn diffie_hellman( &self, their_public_key: &Curve25519PublicKey, ) -> SharedSecret
Perform a Diffie-Hellman key exchange between the given
Curve25519PublicKey
and this Curve25519SecretKey
and return a shared
secret.
Trait Implementations§
source§impl Clone for Curve25519SecretKey
impl Clone for Curve25519SecretKey
source§fn clone(&self) -> Curve25519SecretKey
fn clone(&self) -> Curve25519SecretKey
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 Default for Curve25519SecretKey
impl Default for Curve25519SecretKey
source§impl<'de> Deserialize<'de> for Curve25519SecretKey
impl<'de> Deserialize<'de> for Curve25519SecretKey
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<'a> From<&'a Curve25519SecretKey> for Curve25519PublicKey
impl<'a> From<&'a Curve25519SecretKey> for Curve25519PublicKey
source§fn from(secret: &'a Curve25519SecretKey) -> Curve25519PublicKey
fn from(secret: &'a Curve25519SecretKey) -> Curve25519PublicKey
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Curve25519SecretKey
impl RefUnwindSafe for Curve25519SecretKey
impl Send for Curve25519SecretKey
impl Sync for Curve25519SecretKey
impl Unpin for Curve25519SecretKey
impl UnwindSafe for Curve25519SecretKey
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§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
)