Trait AesBlockCipher

Source
pub trait AesBlockCipher:
    'static
    + Clone
    + Sync
    + Send {
    type Key: 'static + Clone + Sync + Send;

    const BLOCK_COUNT_HINT: usize;

    // Required methods
    fn new_with_key(key: Self::Key) -> Self;
    fn encrypt_many<const N: usize>(&self, blocks: [U8x16; N]) -> [U8x16; N]
       where ArrayUnrolledOps: UnrollableArraySize<N>;

    // Provided method
    fn encrypt(&self, block: U8x16) -> U8x16 { ... }
}
Expand description

An AES block cipher, suitable for encryption.

This cipher can be used for encryption. Decryption operations are handled in the subtrait AesBlockCipherDecrypt.

Required Associated Constants§

Source

const BLOCK_COUNT_HINT: usize

Running encrypt_many with this many blocks will typically result in good performance.

Required Associated Types§

Source

type Key: 'static + Clone + Sync + Send

The type of the AES key.

Required Methods§

Source

fn new_with_key(key: Self::Key) -> Self

Run the AES key schedule operation with a given key.

Source

fn encrypt_many<const N: usize>(&self, blocks: [U8x16; N]) -> [U8x16; N]

Encrypt an array of N 128-bit AES blocks using ECB mode.

Provided Methods§

Source

fn encrypt(&self, block: U8x16) -> U8x16

Encrypt a single 128-bit AES block.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§