pub trait Aes128Cbc {
type EncryptContext;
type DecryptContext;
// Required methods
fn encrypt_init(key: &[u8; 16], iv: &[u8; 16]) -> Self::EncryptContext;
fn decrypt_init(key: &[u8; 16], iv: &[u8; 16]) -> Self::DecryptContext;
fn encrypt_blocks(
ctx: &mut Self::EncryptContext,
blocks: InOutBuf<'_, '_, u8>,
);
fn decrypt_blocks(
ctx: &mut Self::DecryptContext,
blocks: InOutBuf<'_, '_, u8>,
);
}Expand description
AES-128 CBC block cipher trait.
Required Associated Types§
Sourcetype EncryptContext
type EncryptContext
Opaque storage for the encryptor’s key schedule and chaining state.
Sourcetype DecryptContext
type DecryptContext
Opaque storage for the decryptor’s key schedule and chaining state.
Required Methods§
Sourcefn encrypt_init(key: &[u8; 16], iv: &[u8; 16]) -> Self::EncryptContext
fn encrypt_init(key: &[u8; 16], iv: &[u8; 16]) -> Self::EncryptContext
Initialize encryptor with a 128-bit key and 128-bit IV.
Sourcefn decrypt_init(key: &[u8; 16], iv: &[u8; 16]) -> Self::DecryptContext
fn decrypt_init(key: &[u8; 16], iv: &[u8; 16]) -> Self::DecryptContext
Initialize decryptor with a 128-bit key and 128-bit IV.
Sourcefn encrypt_blocks(ctx: &mut Self::EncryptContext, blocks: InOutBuf<'_, '_, u8>)
fn encrypt_blocks(ctx: &mut Self::EncryptContext, blocks: InOutBuf<'_, '_, u8>)
Encrypt 16-byte blocks in-place (updates internal chaining state).
Sourcefn decrypt_blocks(ctx: &mut Self::DecryptContext, blocks: InOutBuf<'_, '_, u8>)
fn decrypt_blocks(ctx: &mut Self::DecryptContext, blocks: InOutBuf<'_, '_, u8>)
Decrypt 16-byte blocks in-place (updates internal chaining state).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".