Trait noise_protocol::DH

source ·
pub trait DH {
    type Key: U8Array;
    type Pubkey: U8Array;
    type Output: U8Array;

    // Required methods
    fn name() -> &'static str;
    fn genkey() -> Self::Key;
    fn pubkey(_: &Self::Key) -> Self::Pubkey;
    fn dh(_: &Self::Key, _: &Self::Pubkey) -> Result<Self::Output, ()>;
}
Expand description

A DH.

Required Associated Types§

source

type Key: U8Array

Type of private key.

source

type Pubkey: U8Array

Type of pubkey key.

source

type Output: U8Array

Type of output.

Required Methods§

source

fn name() -> &'static str

Name of this DH function, e.g., “25519”.

source

fn genkey() -> Self::Key

Randomly generate a new private key.

source

fn pubkey(_: &Self::Key) -> Self::Pubkey

Calculate public key from a private key.

source

fn dh(_: &Self::Key, _: &Self::Pubkey) -> Result<Self::Output, ()>

Perform DH key exchange.

Object Safety§

This trait is not object safe.

Implementors§