[][src]Trait stream_cipher::NewStreamCipher

pub trait NewStreamCipher: Sized {
    type KeySize: ArrayLength<u8>;
    type NonceSize: ArrayLength<u8>;
    fn new(
        key: &GenericArray<u8, Self::KeySize>,
        nonce: &GenericArray<u8, Self::NonceSize>
    ) -> Self; fn new_var(key: &[u8], nonce: &[u8]) -> Result<Self, InvalidKeyNonceLength> { ... } }

Stream cipher creation trait.

It can be used for creation of synchronous and asynchronous ciphers.

Associated Types

type KeySize: ArrayLength<u8>

Key size in bytes

type NonceSize: ArrayLength<u8>

Nonce size in bytes

Loading content...

Required methods

fn new(
    key: &GenericArray<u8, Self::KeySize>,
    nonce: &GenericArray<u8, Self::NonceSize>
) -> Self

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

Loading content...

Provided methods

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

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

Loading content...

Implementors

impl<C> NewStreamCipher for C where
    C: FromBlockCipher
[src]

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

type NonceSize = <Self::BlockCipher as BlockCipher>::BlockSize

Loading content...