[][src]Trait nettle::mac::Mac

pub trait Mac {
    fn mac_size(&self) -> usize;
fn update(&mut self, data: &[u8]);
fn digest(&mut self, digest: &mut [u8]) -> Result<()>; }

A message authentication code.

A MAC is a symmetric signature primitive.

Required methods

fn mac_size(&self) -> usize

Size of the MAC tag i.e. the signature in bytes.

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

Add data to be signed.

fn digest(&mut self, digest: &mut [u8]) -> Result<()>

Produce the MAC tag digest for all data fed via update().

Returns InvalidArgument if digest is not Self::mac_size.

Loading content...

Implementors

impl Mac for Umac32[src]

impl Mac for Umac64[src]

impl Mac for Umac96[src]

impl Mac for Umac128[src]

impl Mac for Poly1305[src]

impl<H: NettleHash> Mac for Hmac<H>[src]

Loading content...