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, ()>;
}
Expand description

A DH.

Required Associated Types

Type of private key.

Type of pubkey key.

Type of output.

Required Methods

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

Randomly generate a new private key.

Calculate public key from a private key.

Perform DH key exchange.

Implementors