Trait hmac::Mac[][src]

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

The Mac trait defines methods for a Message Authentication algorithm.

Associated Types

type OutputSize: ArrayLength<u8>[src]

Output size of the [Mac]

Loading content...

Required methods

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

Update MAC state with the given data.

pub fn reset(&mut self)[src]

Reset Mac instance.

pub fn finalize(self) -> Output<Self>[src]

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

Loading content...

Provided methods

pub fn finalize_reset(&mut self) -> Output<Self>[src]

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

pub fn verify(self, tag: &[u8]) -> Result<(), MacError>[src]

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

Loading content...

Implementors

impl<D> Mac for Hmac<D> where
    D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
    D::BlockSize: ArrayLength<u8>,
    D::OutputSize: ArrayLength<u8>, 
[src]

type OutputSize = D::OutputSize

Loading content...