Skip to main content

StreamingMac

Trait StreamingMac 

Source
pub trait StreamingMac: Send {
    // Required methods
    fn update(&mut self, data: &[u8]);
    fn finalize(self, out: &mut [u8]) -> Result<(), CryptoError>;
    fn verify(self, expected: &[u8]) -> Result<(), CryptoError>;
}
Expand description

Incremental (streaming) MAC computation.

Required Methods§

Source

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

Feed additional data into the MAC state.

Source

fn finalize(self, out: &mut [u8]) -> Result<(), CryptoError>

Consume the MAC state and write the tag into out.

Source

fn verify(self, expected: &[u8]) -> Result<(), CryptoError>

Consume the MAC state, compute the tag, and verify against expected in constant time.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§