[][src]Trait cipher::NewCipher

pub trait NewCipher: Sized {
    type KeySize: ArrayLength<u8>;
    type NonceSize: ArrayLength<u8>;
    pub fn new(key: &CipherKey<Self>, nonce: &Nonce<Self>) -> Self;

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

Cipher creation trait.

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

Associated Types

type KeySize: ArrayLength<u8>[src]

Key size in bytes

type NonceSize: ArrayLength<u8>[src]

Nonce size in bytes

Loading content...

Required methods

pub fn new(key: &CipherKey<Self>, nonce: &Nonce<Self>) -> Self[src]

Create new stream cipher instance from variable length key and nonce.

Loading content...

Provided methods

pub fn new_var(key: &[u8], nonce: &[u8]) -> Result<Self, InvalidLength>[src]

Create new stream cipher instance from variable length key and nonce.

Loading content...

Implementors

impl<C> NewCipher for C where
    C: FromBlockCipher,
    C::BlockCipher: NewBlockCipher
[src]

type KeySize = <Self::BlockCipher as NewBlockCipher>::KeySize

type NonceSize = Self::NonceSize

Loading content...