embassy-crypto

Crates

git

Versions

default

Flavors

Skip to main content

Aes256Cbc

Trait Aes256Cbc 

Source
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§

Source

type EncryptContext: Send + Sync + Clone

Opaque storage for the encryptor’s key schedule and chaining state.

Source

type DecryptContext: Send + Sync + Clone

Opaque storage for the decryptor’s key schedule and chaining state.

Required Methods§

Source

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

Initialize an encryptor with a 256-bit key and 128-bit IV.

Source

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

Initialize a decryptor with a 256-bit key and 128-bit IV.

Source

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.

Source

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".

Implementors§