[][src]Trait tea_soft::block_cipher::NewBlockCipher

pub trait NewBlockCipher {
    type KeySize: ArrayLength<u8>;
    pub fn new(key: &GenericArray<u8, Self::KeySize>) -> Self;

    pub fn new_varkey(key: &[u8]) -> Result<Self, InvalidKeyLength> { ... }
}

Instantiate a BlockCipher algorithm.

Associated Types

type KeySize: ArrayLength<u8>[src]

Key size in bytes with which cipher guaranteed to be initialized.

Loading content...

Required methods

pub fn new(key: &GenericArray<u8, Self::KeySize>) -> Self[src]

Create new block cipher instance from key with fixed size.

Loading content...

Provided methods

pub fn new_varkey(key: &[u8]) -> Result<Self, InvalidKeyLength>[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.

Loading content...

Implementors

impl NewBlockCipher for Tea16[src]

type KeySize = U16

impl NewBlockCipher for Tea32[src]

type KeySize = U16

impl NewBlockCipher for Tea64[src]

type KeySize = U16

Loading content...