embassy-crypto-driver

Crates

git

Versions

default

Flavors

Skip to main content

Aes256Cmac

Trait Aes256Cmac 

Source
pub trait Aes256Cmac {
    type Context: Clone;

    // Required methods
    fn init(key: &[u8; 32]) -> Self::Context;
    fn update(ctx: &mut Self::Context, data: &[u8]);
    fn finalize(ctx: Self::Context, out: &mut [u8; 16]);
    fn reset(ctx: &mut Self::Context);
}
Expand description

AES-256 CMAC (Cipher-based Message Authentication Code) trait.

Produces a 128-bit authentication tag using AES-256 as the underlying block cipher (NIST SP 800-38B).

Required Associated Types§

Source

type Context: Clone

Opaque storage for the implementation’s CMAC state.

Required Methods§

Source

fn init(key: &[u8; 32]) -> Self::Context

Initialize with a 256-bit key.

Source

fn update(ctx: &mut Self::Context, data: &[u8])

Update the CMAC state with message data.

Source

fn finalize(ctx: Self::Context, out: &mut [u8; 16])

Finalize and write the 16-byte tag to out.

Source

fn reset(ctx: &mut Self::Context)

Reset the context to its post-init, pre-message state.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§