Trait bdk_chain::bitcoin::hashes::HashEngine

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§

type MidState

Byte array representing the internal state of the hash engine.

Required Associated Constants§

const BLOCK_SIZE: usize

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

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.

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

Add data to the hash engine.

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§

§

impl HashEngine for bdk_chain::bitcoin::hashes::ripemd160::HashEngine

§

type MidState = [u8; 20]

§

const BLOCK_SIZE: usize = 64usize

§

impl HashEngine for bdk_chain::bitcoin::hashes::sha1::HashEngine

§

type MidState = [u8; 20]

§

const BLOCK_SIZE: usize = 64usize

§

impl HashEngine for bdk_chain::bitcoin::hashes::sha256::HashEngine

§

type MidState = Midstate

§

const BLOCK_SIZE: usize = 64usize

§

impl HashEngine for bdk_chain::bitcoin::hashes::sha384::HashEngine

§

type MidState = [u8; 64]

§

const BLOCK_SIZE: usize = 128usize

§

impl HashEngine for bdk_chain::bitcoin::hashes::sha512::HashEngine

§

type MidState = [u8; 64]

§

const BLOCK_SIZE: usize = 128usize

§

impl HashEngine for bdk_chain::bitcoin::hashes::sha512_256::HashEngine

§

type MidState = [u8; 64]

§

const BLOCK_SIZE: usize = 128usize

§

impl HashEngine for bdk_chain::bitcoin::hashes::siphash24::HashEngine

§

type MidState = State

§

const BLOCK_SIZE: usize = 8usize

§

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

§

type MidState = HmacMidState<T>

§

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