Trait KeyInit

pub trait KeyInit: KeySizeUser + Sized

Types which can be initialized from a key.

Required Methods

fn new(key: &Key<Self>) -> Self

Create new value from fixed size key.

Provided Methods

fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>

Create new value from variable size key.

Errors

Returns InvalidLength in the event the length of the provided slice is not equal to <Self as KeySizeUser>::KeySize::USIZE.

Implementors