Trait block_cipher_trait::BlockCipher
[−]
[src]
pub trait BlockCipher { type BlockSize: ArrayLength<u8>; fn encrypt_block(&self, block: &mut GenericArray<u8, Self::BlockSize>); fn decrypt_block(&self, block: &mut GenericArray<u8, Self::BlockSize>); fn encrypt_blocks(&self, blocks: &mut [u8]) { ... } fn decrypt_blocks(&self, blocks: &mut [u8]) { ... } }
Main block cipher trait which defines in-place encryption and decryption over single block
Associated Types
type BlockSize: ArrayLength<u8>
Required Methods
fn encrypt_block(&self, block: &mut GenericArray<u8, Self::BlockSize>)
Encrypt block in-place
fn decrypt_block(&self, block: &mut GenericArray<u8, Self::BlockSize>)
Decrypt block in-place
Provided Methods
fn encrypt_blocks(&self, blocks: &mut [u8])
Encrypt several blocks in-place. Will panic if slice length is not multiple of block size.
Default implementations will just iterate over blocks and will use
encrypt_block
on them, but some ciphers could utilize instruction
level parallelism to speed-up computations
fn decrypt_blocks(&self, blocks: &mut [u8])
Decrypt several blocks in-place. Will panic if slice length is not multiple of block size.
Default implementations will just iterate over blocks and will use
decrypt_block
on them, but some ciphers could utilize instruction
level parallelism to speed-up computations