Trait bitcoin_hashes::HashEngine

source ·
pub trait HashEngine: Clone + Default {
    type MidState;

    const BLOCK_SIZE: usize;

    // Required methods
    fn midstate(&self) -> Self::MidState;
    fn input(&mut self, data: &[u8]);
    fn n_bytes_hashed(&self) -> usize;
}
Expand description

A hashing engine which bytes can be serialized into.

Required Associated Types§

source

type MidState

Byte array representing the internal state of the hash engine.

Required Associated Constants§

source

const BLOCK_SIZE: usize

Length of the hash’s internal block size, in bytes.

Required Methods§

source

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.

source

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

Add data to the hash engine.

source

fn n_bytes_hashed(&self) -> usize

Return the number of bytes already n_bytes_hashed(inputted).

Object Safety§

This trait is not object safe.

Implementors§

source§

impl HashEngine for bitcoin_hashes::ripemd160::HashEngine

§

type MidState = [u8; 20]

source§

const BLOCK_SIZE: usize = 64usize

source§

impl HashEngine for bitcoin_hashes::sha1::HashEngine

§

type MidState = [u8; 20]

source§

const BLOCK_SIZE: usize = 64usize

source§

impl HashEngine for bitcoin_hashes::sha256::HashEngine

source§

impl HashEngine for bitcoin_hashes::sha512::HashEngine

§

type MidState = [u8; 64]

source§

const BLOCK_SIZE: usize = 128usize

source§

impl HashEngine for bitcoin_hashes::sha512_256::HashEngine

§

type MidState = [u8; 64]

source§

const BLOCK_SIZE: usize = 128usize

source§

impl HashEngine for bitcoin_hashes::siphash24::HashEngine

source§

impl<T: Hash> HashEngine for HmacEngine<T>

§

type MidState = HmacMidState<T>

source§

const BLOCK_SIZE: usize = <T::Engine>::BLOCK_SIZE