c2_chacha::stream_cipher

Trait FromBlockCipher

Source
pub trait FromBlockCipher {
    type BlockCipher: BlockCipher;
    type NonceSize: ArrayLength<u8>;

    // Required method
    fn from_block_cipher(
        cipher: Self::BlockCipher,
        nonce: &GenericArray<u8, Self::NonceSize>,
    ) -> Self;
}
Expand description

Trait for initializing a stream cipher from a block cipher

Required Associated Types§

Source

type BlockCipher: BlockCipher

Block cipher

Source

type NonceSize: ArrayLength<u8>

Nonce size in bytes

Required Methods§

Source

fn from_block_cipher( cipher: Self::BlockCipher, nonce: &GenericArray<u8, Self::NonceSize>, ) -> Self

Instantiate a stream cipher from a block cipher

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§