Trait fs_verity::InnerHash

source ·
pub trait InnerHash: Digest + BlockSizeUser + Clone + Default {
    const INNER_HASH_ALGORITHM: InnerHashAlgorithm;

    // Provided methods
    fn update_padded(&mut self, data: &[u8], padded_size: usize) { ... }
    fn update_zeroes(&mut self, amount: usize) { ... }
}
Expand description

Trait for the inner hash algorithms we support (currently implemented for Sha256 and Sha512).

It adds some information we need, some useful functions, and declares all the trait bounds we need so we have them in one place.

Required Associated Constants§

source

const INNER_HASH_ALGORITHM: InnerHashAlgorithm

The value of InnerHashAlgorithm that corresponds to this hash algorithm.

Provided Methods§

source

fn update_padded(&mut self, data: &[u8], padded_size: usize)

Update the hash state with given data, padded with zero bytes to the given size. This will panic if data.len() > padded_size.

source

fn update_zeroes(&mut self, amount: usize)

Update the hash state with the given amount of zero bytes

Implementations on Foreign Types§

source§

impl InnerHash for Sha256

source§

const INNER_HASH_ALGORITHM: InnerHashAlgorithm = InnerHashAlgorithm::Sha256

source§

impl InnerHash for Sha512

source§

const INNER_HASH_ALGORITHM: InnerHashAlgorithm = InnerHashAlgorithm::Sha512

Implementors§