embassy-crypto

Crates

git

Versions

default

Flavors

Skip to main content

Aes256Ctr

Trait Aes256Ctr 

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

    // Required methods
    fn init(key: &[u8; 32], iv: &[u8; 16]) -> Self::Context;
    fn apply_keystream(ctx: &mut Self::Context, buf: InOutBuf<'_, '_, u8>);
}
Expand description

AES-256 CTR mode driver.

Required Associated Types§

Source

type Context: Send + Sync + Clone

Opaque storage for the key schedule, counter and partial keystream.

Required Methods§

Source

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

Initialize with a 256-bit key and 128-bit initial counter block.

Source

fn apply_keystream(ctx: &mut Self::Context, buf: InOutBuf<'_, '_, u8>)

XOR the keystream into buf.

The counter and any unused keystream are carried in the context, so buf need not be block-aligned.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§