embassy-crypto-driver

Crates

git

Versions

default

Flavors

Skip to main content

Aes128Cbc

Trait Aes128Cbc 

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

Source

type EncryptContext

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

Source

type DecryptContext

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

Required Methods§

Source

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

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

Source

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

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

Source

fn encrypt_blocks(ctx: &mut Self::EncryptContext, blocks: InOutBuf<'_, '_, u8>)

Encrypt 16-byte blocks in-place (updates internal chaining state).

Source

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

Implementors§