HashEngine

Trait 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 Constants§

Source

const BLOCK_SIZE: usize

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

Required Associated Types§

Source

type MidState

Byte array representing the internal state of the hash engine.

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).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl HashEngine for rgb::invoice::bitcoin::hashes::ripemd160::HashEngine

Source§

const BLOCK_SIZE: usize = 64usize

Source§

type MidState = [u8; 20]

Source§

impl HashEngine for rgb::invoice::bitcoin::hashes::sha1::HashEngine

Source§

const BLOCK_SIZE: usize = 64usize

Source§

type MidState = [u8; 20]

Source§

impl HashEngine for rgb::invoice::bitcoin::hashes::sha256::HashEngine

Source§

impl HashEngine for rgb::invoice::bitcoin::hashes::sha384::HashEngine

Source§

const BLOCK_SIZE: usize = 128usize

Source§

type MidState = [u8; 64]

Source§

impl HashEngine for rgb::invoice::bitcoin::hashes::sha512::HashEngine

Source§

const BLOCK_SIZE: usize = 128usize

Source§

type MidState = [u8; 64]

Source§

impl HashEngine for rgb::invoice::bitcoin::hashes::sha512_256::HashEngine

Source§

const BLOCK_SIZE: usize = 128usize

Source§

type MidState = [u8; 64]

Source§

impl HashEngine for rgb::invoice::bitcoin::hashes::siphash24::HashEngine

Source§

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

Source§

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

Source§

type MidState = HmacMidState<T>