Trait aead::NewAead [−][src]
pub trait NewAead { type KeySize: ArrayLength<u8>; fn new(key: &Key<Self>) -> Self; fn new_from_slice(key: &[u8]) -> Result<Self, Error>
where
Self: Sized, { ... } fn generate_key(rng: impl CryptoRng + RngCore) -> Key<Self> { ... } }
Associated Types
type KeySize: ArrayLength<u8>
[src]
The size of the key array required by this algorithm.
Required methods
Loading content...Provided methods
fn new_from_slice(key: &[u8]) -> Result<Self, Error> where
Self: Sized,
[src]
Self: Sized,
Create new AEAD instance from key given as a byte slice..
Default implementation will accept only keys with length equal to KeySize
.
fn generate_key(rng: impl CryptoRng + RngCore) -> Key<Self>
[src]
This is supported on crate feature
rand_core
only.Generate a random key for this AEAD using the provided CryptoRng
.