pub trait Mac: OutputSizeUser + Sized {
// Required methods
fn update(&mut self, data: &[u8]);
fn chain_update(self, data: impl AsRef<[u8]>) -> Self;
fn finalize(self) -> CtOutput<Self>;
fn finalize_reset(&mut self) -> CtOutput<Self>
where Self: FixedOutputReset;
fn reset(&mut self)
where Self: Reset;
fn verify(self, tag: &Output<Self>) -> Result<(), MacError>;
fn verify_reset(&mut self, tag: &Output<Self>) -> Result<(), MacError>
where Self: FixedOutputReset;
fn verify_slice(self, tag: &[u8]) -> Result<(), MacError>;
fn verify_slice_reset(&mut self, tag: &[u8]) -> Result<(), MacError>
where Self: FixedOutputReset;
fn verify_truncated_left(self, tag: &[u8]) -> Result<(), MacError>;
fn verify_truncated_right(self, tag: &[u8]) -> Result<(), MacError>;
}Expand description
Convenience wrapper trait covering functionality of Message Authentication algorithms.
This trait wraps Update, FixedOutput, and MacMarker traits
and provides additional convenience methods.
Required Methods§
Sourcefn chain_update(self, data: impl AsRef<[u8]>) -> Self
fn chain_update(self, data: impl AsRef<[u8]>) -> Self
Process input data in a chained manner.
Sourcefn finalize_reset(&mut self) -> CtOutput<Self>where
Self: FixedOutputReset,
fn finalize_reset(&mut self) -> CtOutput<Self>where
Self: FixedOutputReset,
Sourcefn verify_reset(&mut self, tag: &Output<Self>) -> Result<(), MacError>where
Self: FixedOutputReset,
fn verify_reset(&mut self, tag: &Output<Self>) -> Result<(), MacError>where
Self: FixedOutputReset,
Sourcefn verify_slice_reset(&mut self, tag: &[u8]) -> Result<(), MacError>where
Self: FixedOutputReset,
fn verify_slice_reset(&mut self, tag: &[u8]) -> Result<(), MacError>where
Self: FixedOutputReset,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.