Trait cipher::NewBlockCipher [−][src]
pub trait NewBlockCipher: Sized { type KeySize: ArrayLength<u8>; fn new(key: &BlockCipherKey<Self>) -> Self; fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength> { ... } }
Instantiate a BlockCipher
algorithm.
Associated Types
type KeySize: ArrayLength<u8>
[src]
Key size in bytes with which cipher guaranteed to be initialized.
Required methods
fn new(key: &BlockCipherKey<Self>) -> Self
[src]
Create new block cipher instance from key with fixed size.
Provided methods
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
[src]
Create new block cipher instance from key with variable size.
Default implementation will accept only keys with length equal to
KeySize
, but some ciphers can accept range of key lengths.