pub trait DigestAlg {
    type DigestData: Clone + PartialEq + Hash + Send + AsRef<[u8]>;
    type DigestContext: Clone;

    const HASH_SIZE: usize;

    // Required methods
    fn try_from_slice(slice: &[u8]) -> Result<Self::DigestData, Error>;
    fn new() -> Self::DigestContext;
    fn append_data(ctx: &mut Self::DigestContext, data: &[u8]);
    fn finalize(ctx: Self::DigestContext) -> Self::DigestData;
}

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn try_from_slice(slice: &[u8]) -> Result<Self::DigestData, Error>

source

fn new() -> Self::DigestContext

source

fn append_data(ctx: &mut Self::DigestContext, data: &[u8])

source

fn finalize(ctx: Self::DigestContext) -> Self::DigestData

Implementors§

source§

impl DigestAlg for Blake2b256

source§

const HASH_SIZE: usize = 32usize

§

type DigestData = [u8; 32]

§

type DigestContext = Blake2b