[][src]Trait noise_protocol::DH

pub trait DH {
    type Key: U8Array;
    type Pubkey: U8Array;
    type Output: U8Array;
    fn name() -> &'static str;
fn genkey() -> Self::Key;
fn pubkey(_: &Self::Key) -> Self::Pubkey;
fn dh(_: &Self::Key, _: &Self::Pubkey) -> Result<Self::Output, ()>; }

A DH.

Associated Types

type Key: U8Array

Type of private key.

type Pubkey: U8Array

Type of pubkey key.

type Output: U8Array

Type of output.

Loading content...

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) -> Result<Self::Output, ()>

Perform DH key exchange.

Loading content...

Implementors

Loading content...