pub trait HmacUtils {
    // Required methods
    fn bits(&self) -> usize;
    fn kdf_hash_length(
        &self,
        key: &[u8],
        label: &str,
        context: &[u8],
        bits: usize
    ) -> Vec<u8> ;
    fn hkdf_extract(&self, salt: &[u8], ikm: &[u8]) -> Vec<u8> ;
    fn hkdf_expand(&self, prk: &[u8], info: &str, length: usize) -> Vec<u8> ;
    fn confirm(&self, key: &[u8], counter: u16, data: &[&[u8]]) -> Vec<u8> ;
}
Expand description

Trait encapsulating implementations of the HMAC constructions for a given hasher type.

Required Methods§

source

fn bits(&self) -> usize

The number of bits in the digest length of the HMAC type.

source

fn kdf_hash_length( &self, key: &[u8], label: &str, context: &[u8], bits: usize ) -> Vec<u8>

source

fn hkdf_extract(&self, salt: &[u8], ikm: &[u8]) -> Vec<u8>

source

fn hkdf_expand(&self, prk: &[u8], info: &str, length: usize) -> Vec<u8>

source

fn confirm(&self, key: &[u8], counter: u16, data: &[&[u8]]) -> Vec<u8>

See: confirm()

Implementors§

source§

impl<H> HmacUtils for HmacUtilsImpl<H>
where H: Hasher, <<H as Hasher>::Digest as Digest>::Bytes: AsMut<[u8]> + AsRef<[u8]>,