[][src]Trait bitcoin_hashes::HashEngine

pub trait HashEngine: Clone + Write {
    type MidState;

    const BLOCK_SIZE: usize;

    fn midstate(&self) -> Self::MidState;

    fn input(&mut self, data: &[u8]) { ... }
}

A hashing engine which bytes can be serialized into. It is expected to implement the io::Write trait, but to never return errors under any conditions.

Associated Types

type MidState

Byte array representing the internal state of the hash engine

Loading content...

Associated Constants

const BLOCK_SIZE: usize

Length of the hash's internal block size, in bytes

Loading content...

Required methods

fn midstate(&self) -> Self::MidState

Outputs the midstate of the hash engine. This function should not be used directly unless you really know what you're doing.

Loading content...

Provided methods

fn input(&mut self, data: &[u8])

Add data to the hash engine without any error return type to deal with

Loading content...

Implementors

impl HashEngine for bitcoin_hashes::ripemd160::HashEngine[src]

type MidState = [u8; 20]

fn input(&mut self, data: &[u8])[src]

impl HashEngine for bitcoin_hashes::sha1::HashEngine[src]

type MidState = [u8; 20]

fn input(&mut self, data: &[u8])[src]

impl HashEngine for bitcoin_hashes::sha256::HashEngine[src]

type MidState = [u8; 32]

fn input(&mut self, data: &[u8])[src]

impl HashEngine for bitcoin_hashes::sha512::HashEngine[src]

type MidState = [u8; 64]

fn input(&mut self, data: &[u8])[src]

impl<T: Hash> HashEngine for HmacEngine<T>[src]

type MidState = <<T as Hash>::Engine as HashEngine>::MidState

fn input(&mut self, data: &[u8])[src]

Loading content...