Skip to main content

HmacImpl

Trait HmacImpl 

Source
pub trait HmacImpl: Clone + OutputSizeUser {
    // Required methods
    fn new_from_slice(key: &[u8]) -> Self;
    fn update(&mut self, data: &[u8]);
    fn finalize(self) -> Output<Self>;
}
Expand description

Trait representing a HMAC implementation.

Most users should use Hmac or SimpleHmac.

Required Methods§

Source

fn new_from_slice(key: &[u8]) -> Self

Create new HMAC state with the given key.

Source

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

Update HMAC state.

Source

fn finalize(self) -> Output<Self>

Finalize the HMAC state and get generated tag.

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.

Implementations on Foreign Types§

Source§

impl<H> HmacImpl for SimpleHmac<H>
where H: Digest + BlockSizeUser + Clone,

Source§

fn new_from_slice(key: &[u8]) -> Self

Source§

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

Source§

fn finalize(self) -> Output<H>

Source§

impl<H: EagerHash> HmacImpl for Hmac<H>

Source§

fn new_from_slice(key: &[u8]) -> Self

Source§

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

Source§

fn finalize(self) -> Output<Self>

Implementors§