logo

Trait hmac::Mac

source · []
pub trait Mac: Clone {
    type OutputSize: ArrayLength<u8>;
    fn update(&mut self, data: &[u8]);
fn reset(&mut self);
fn finalize(self) -> Output<Self>; fn finalize_reset(&mut self) -> Output<Self> { ... }
fn verify(self, tag: &[u8]) -> Result<(), MacError> { ... } }
Expand description

The Mac trait defines methods for a Message Authentication algorithm.

Associated Types

Output size of the [Mac]

Required methods

Update MAC state with the given data.

Reset Mac instance.

Obtain the result of a Mac computation as a Output and consume Mac instance.

Provided methods

Obtain the result of a Mac computation as a Output and reset Mac instance.

Check if tag/code value is correct for the processed input.

Implementors