Trait ShortMac

Source
pub trait ShortMac<const MAC_LEN: usize> {
    // Required methods
    fn mac(&self, input: &[u8]) -> CtByteArray<MAC_LEN>;
    fn validate(&self, input: &[u8], mac: &[u8; MAC_LEN]) -> Choice;
}
Expand description

A simple trait to describe a keyed message authentication code.

Unlike RustCrypto’s crypto_mac::Mac, this trait does not support incremental processing.

Required Methods§

Source

fn mac(&self, input: &[u8]) -> CtByteArray<MAC_LEN>

Calculate a message authentication code for input using this key.

Source

fn validate(&self, input: &[u8], mac: &[u8; MAC_LEN]) -> Choice

Check whether mac is a valid message authentication code for input using this key.

Implementors§

impl<'a> ShortMac<HS_MAC_LEN> for HsMacKey<'a>