Trait noise_protocol::Hash[][src]

pub trait Hash: Default {
    type Block: U8Array;
    type Output: U8Array;
    fn name() -> &'static str;
fn input(&mut self, data: &[u8]);
fn result(&mut self) -> Self::Output; fn block_len() -> usize { ... }
fn hash_len() -> usize { ... }
fn reset(&mut self) { ... }
fn hash(data: &[u8]) -> Self::Output { ... }
fn hmac_many(key: &[u8], data: &[&[u8]]) -> Self::Output { ... }
fn hmac(key: &[u8], data: &[u8]) -> Self::Output { ... }
fn hkdf(
        chaining_key: &[u8],
        input_key_material: &[u8]
    ) -> (Self::Output, Self::Output) { ... }
fn hkdf3(
        chaining_key: &[u8],
        input_key_material: &[u8]
    ) -> (Self::Output, Self::Output, Self::Output) { ... } }

A hash function.

Associated Types

Type of a block.

Type of output.

Required Methods

Name of the hash function.

Update hash context with some input.

Get hash result.

Provided Methods

Length of block.

Length of hash output, in number of bytes.

Reset state of hash context.

Calculate hash of some data.

Calculate HMAC-THIS-HASH, with some key and several messages.

Calculate HMAC-THIS-HASH, with some key and a message.

Calculate HKDF, as specified in the noise spec.

Triple output HKDF.

Implementors