embassy-crypto

Crates

git

Versions

default

Flavors

Skip to main content

Aes128Cmac

Trait Aes128Cmac 

Source
pub trait Aes128Cmac {
    type Context: Send + Sync + Clone;

    // Required methods
    fn init(key: &[u8; 16]) -> 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-128 CMAC driver (NIST SP 800-38B).

Required Associated Types§

Source

type Context: Send + Sync + Clone

Opaque storage for the implementation’s CMAC state.

Required Methods§

Source

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

Initialize with a 128-bit key.

Source

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

Absorb message data.

Source

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

Finish the computation, writing the 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§