pub trait Aes256Cbc {
type EncryptContext: Send + Sync + Clone;
type DecryptContext: Send + Sync + Clone;
// Required methods
fn encrypt_init(key: &[u8; 32], iv: &[u8; 16]) -> Self::EncryptContext;
fn decrypt_init(key: &[u8; 32], 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-256 CBC mode driver.
Required Associated Types§
Sourcetype EncryptContext: Send + Sync + Clone
type EncryptContext: Send + Sync + Clone
Opaque storage for the encryptor’s key schedule and chaining state.
Sourcetype DecryptContext: Send + Sync + Clone
type DecryptContext: Send + Sync + Clone
Opaque storage for the decryptor’s key schedule and chaining state.
Required Methods§
Sourcefn encrypt_init(key: &[u8; 32], iv: &[u8; 16]) -> Self::EncryptContext
fn encrypt_init(key: &[u8; 32], iv: &[u8; 16]) -> Self::EncryptContext
Initialize an encryptor with a 256-bit key and 128-bit IV.
Sourcefn decrypt_init(key: &[u8; 32], iv: &[u8; 16]) -> Self::DecryptContext
fn decrypt_init(key: &[u8; 32], iv: &[u8; 16]) -> Self::DecryptContext
Initialize a decryptor with a 256-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 blocks, a whole number of 16-byte blocks.
The chaining state is carried in the context, so a message may be processed in several calls.
Sourcefn decrypt_blocks(ctx: &mut Self::DecryptContext, blocks: InOutBuf<'_, '_, u8>)
fn decrypt_blocks(ctx: &mut Self::DecryptContext, blocks: InOutBuf<'_, '_, u8>)
Decrypt blocks, a whole number of 16-byte blocks.
The chaining state is carried in the context, so a message may be processed in several calls.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".