Trait snow::types::Dh

source · []
pub trait Dh: Send + Sync {
    fn name(&self) -> &'static str;
fn pub_len(&self) -> usize;
fn priv_len(&self) -> usize;
fn set(&mut self, privkey: &[u8]);
fn generate(&mut self, rng: &mut dyn Random);
fn pubkey(&self) -> &[u8]Notable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8];
fn privkey(&self) -> &[u8]Notable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8];
fn dh(&self, pubkey: &[u8], out: &mut [u8]) -> Result<(), ()>; }
Expand description

Diffie-Hellman operations

Required methods

The string that the Noise spec defines for the primitive

The length in bytes of a public key for this primitive

The length in bytes of a private key for this primitive

Set the private key

Generate a new private key

Get the public key

Get the private key

Calculate a Diffie-Hellman exchange.

Implementors