pub trait NewAead {
type KeySize: ArrayLength<u8>;
// Required method
fn new(key: &Key<Self>) -> Self;
// Provided method
fn new_from_slice(key: &[u8]) -> Result<Self>
where Self: Sized { ... }
}
Required Associated Types§
sourcetype KeySize: ArrayLength<u8>
type KeySize: ArrayLength<u8>
The size of the key array required by this algorithm.
Required Methods§
Provided Methods§
sourcefn new_from_slice(key: &[u8]) -> Result<Self>where
Self: Sized,
fn new_from_slice(key: &[u8]) -> Result<Self>where Self: Sized,
Create new AEAD instance from key given as a byte slice..
Default implementation will accept only keys with length equal to KeySize
.