Trait gost_modes::NewCipher [−][src]
pub trait NewCipher { type KeySize: ArrayLength<u8>; type NonceSize: ArrayLength<u8>; pub fn new(
key: &GenericArray<u8, Self::KeySize>,
nonce: &GenericArray<u8, Self::NonceSize>
) -> Self; pub fn new_from_slices(
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
Required methods
pub fn new(
key: &GenericArray<u8, Self::KeySize>,
nonce: &GenericArray<u8, Self::NonceSize>
) -> Self
[src]
key: &GenericArray<u8, Self::KeySize>,
nonce: &GenericArray<u8, Self::NonceSize>
) -> Self
Create new stream cipher instance from key and nonce arrays.
Provided methods
pub fn new_from_slices(key: &[u8], nonce: &[u8]) -> Result<Self, InvalidLength>
[src]
Create new stream cipher instance from variable length key and nonce given as byte slices.
Implementors
impl<C> NewCipher for C where
C: FromBlockCipher,
<C as FromBlockCipher>::BlockCipher: NewBlockCipher,
[src]
impl<C> NewCipher for C where
C: FromBlockCipher,
<C as FromBlockCipher>::BlockCipher: NewBlockCipher,
[src]type KeySize = <<C as FromBlockCipher>::BlockCipher as NewBlockCipher>::KeySize
type NonceSize = <C as FromBlockCipher>::NonceSize
pub fn new(
key: &GenericArray<u8, <C as NewCipher>::KeySize>,
nonce: &GenericArray<u8, <C as NewCipher>::NonceSize>
) -> C
[src]
key: &GenericArray<u8, <C as NewCipher>::KeySize>,
nonce: &GenericArray<u8, <C as NewCipher>::NonceSize>
) -> C