pub trait Aes128Ctr {
type Context;
// Required methods
fn init(key: &[u8; 16], iv: &[u8; 16]) -> Self::Context;
fn apply_keystream(ctx: &mut Self::Context, buf: InOutBuf<'_, '_, u8>);
}Expand description
AES-128 CTR stream cipher trait.
CTR mode turns a block cipher into a synchronous stream cipher. Encryption and decryption are identical: XOR data with the AES-ECB encrypted counter keystream. The counter is a 128-bit big-endian integer incremented after each block, matching NIST SP 800-38A.
Required Associated Types§
Required Methods§
Sourcefn init(key: &[u8; 16], iv: &[u8; 16]) -> Self::Context
fn init(key: &[u8; 16], iv: &[u8; 16]) -> Self::Context
Initialize with a 128-bit key and 128-bit initial counter (IV).
Sourcefn apply_keystream(ctx: &mut Self::Context, buf: InOutBuf<'_, '_, u8>)
fn apply_keystream(ctx: &mut Self::Context, buf: InOutBuf<'_, '_, u8>)
Apply keystream to buf in-place (encrypt == decrypt for CTR).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".