//! # Authenticate
//!//! `authenticate` is the module providing the trait used to implement cryptographic authentication.
usebase::Result;usebase::ConstantSize;usebase::Datable;/// Trait used by types that implements cryptographic authentication.
pubtraitAuthenticate<K, T>
where K: Datable + ConstantSize,
T: Datable + ConstantSize
{/// Generates an authentication key.
fngenerate_key(&mutself)->Result<K>;/// Authenticates cryptographhically the message using an authentication key
/// and returning its authentication tag.
fnauthenticate(&mutself, msg:&[u8], key:&K)->Result<T>;/// Verifies an authentication tag against a message using an authentication key.
fnverify(&mutself, msg:&[u8], key:&K, tag:&T)->Result<bool>;/// Checks an authentication tag against a message using an authentication key.
fncheck(&mutself, msg:&[u8], key:&K, tag:&T)->Result<()>;}