Trait noise_protocol::DH
[−]
[src]
pub trait DH { type Key: U8Array + Clone; type Pubkey: U8Array + Clone; type Output: U8Array + Clone; fn name() -> &'static str; fn genkey() -> Self::Key; fn pubkey(_: &Self::Key) -> Self::Pubkey; fn dh(_: &Self::Key, _: &Self::Pubkey) -> Self::Output; }
A DH.
Associated Types
type Key: U8Array + Clone
Type of private key.
type Pubkey: U8Array + Clone
Type of pubkey key.
type Output: U8Array + Clone
Type of output.
Required Methods
fn name() -> &'static str
Name of this DH function, e.g., “25519”.
fn genkey() -> Self::Key
Randomly generate a new private key.
fn pubkey(_: &Self::Key) -> Self::Pubkey
Calculate public key from a private key.
fn dh(_: &Self::Key, _: &Self::Pubkey) -> Self::Output
Perform DH key exchange.