Trait snow::types::Dh[][src]

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];
fn privkey(&self) -> &[u8];
fn dh(&self, pubkey: &[u8], out: &mut [u8]) -> Result<(), ()>; }

Diffie-Hellman operations

Required methods

fn name(&self) -> &'static str[src]

The string that the Noise spec defines for the primitive

fn pub_len(&self) -> usize[src]

The length in bytes of a public key for this primitive

fn priv_len(&self) -> usize[src]

The length in bytes of a private key for this primitive

fn set(&mut self, privkey: &[u8])[src]

Set the private key

fn generate(&mut self, rng: &mut dyn Random)[src]

Generate a new private key

fn pubkey(&self) -> &[u8][src]

Get the public key

fn privkey(&self) -> &[u8][src]

Get the private key

fn dh(&self, pubkey: &[u8], out: &mut [u8]) -> Result<(), ()>[src]

Calculate a Diffie-Hellman exchange.

Loading content...

Implementors

Loading content...