pub trait MacAlgorithmAdapter {
const ALG: MacAlgorithm;
// Required methods
fn authenticate(
params: &MacParams<'_>,
message: &[u8],
) -> Result<Vec<u8>, AlgorithmError>;
fn verify(
params: &MacParams<'_>,
message: &[u8],
tag: &[u8],
) -> Result<(), AlgorithmError>;
}Expand description
Adapter contract for a message authentication code algorithm.
Required Associated Constants§
Sourceconst ALG: MacAlgorithm
const ALG: MacAlgorithm
The MAC algorithm selector this adapter implements.
Required Methods§
Sourcefn authenticate(
params: &MacParams<'_>,
message: &[u8],
) -> Result<Vec<u8>, AlgorithmError>
fn authenticate( params: &MacParams<'_>, message: &[u8], ) -> Result<Vec<u8>, AlgorithmError>
Compute a MAC tag over message.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".