Trait ring_compat::aead::NewAead[][src]

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

    pub fn new_from_slice(key: &[u8]) -> Result<Self, Error> { ... }
}
This is supported on crate feature aead only.

Instantiate either a stateless Aead or stateful AeadMut algorithm.

Associated Types

type KeySize: ArrayLength<u8>[src]

The size of the key array required by this algorithm.

Loading content...

Required methods

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

Create a new AEAD instance with the given key.

Loading content...

Provided methods

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

Create new AEAD instance from key given as a byte slice..

Default implementation will accept only keys with length equal to KeySize.

Loading content...

Implementors

impl NewAead for Aes128Gcm[src]

type KeySize = U16

impl NewAead for Aes256Gcm[src]

type KeySize = U32

impl NewAead for ChaCha20Poly1305[src]

type KeySize = U32

Loading content...