Trait cipher::NewCipher

source ·
pub trait NewCipher: Sized {
    type KeySize: ArrayLength<u8>;
    type NonceSize: ArrayLength<u8>;

    fn new(key: &CipherKey<Self>, nonce: &Nonce<Self>) -> Self;

    fn new_from_slices(key: &[u8], nonce: &[u8]) -> Result<Self, InvalidLength> { ... }
}
Expand description

Cipher creation trait.

It can be used for creation of block modes, synchronous and asynchronous stream ciphers.

Required Associated Types§

Key size in bytes

Nonce size in bytes

Required Methods§

Create new stream cipher instance from key and nonce arrays.

Provided Methods§

Create new stream cipher instance from variable length key and nonce given as byte slices.

Implementors§