Trait cipher::block::NewBlockCipher [−][src]
pub trait NewBlockCipher: Sized {
type KeySize: ArrayLength<u8>;
fn new(key: &Key<Self>) -> Self;
fn new_varkey(key: &[u8]) -> Result<Self, InvalidKeyLength> { ... }
}
Expand description
Instantiate a BlockCipher
algorithm.
Associated Types
type KeySize: ArrayLength<u8>
type KeySize: ArrayLength<u8>
Key size in bytes with which cipher guaranteed to be initialized.
Required methods
Provided methods
fn new_varkey(key: &[u8]) -> Result<Self, InvalidKeyLength>
fn new_varkey(key: &[u8]) -> Result<Self, InvalidKeyLength>
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.