fn new_from_slice(key: &[u8]) -> Result<Self>
    where
        Self: Sized,
    {
        if key.len() != Self::KeySize::to_usize() {
            Err(Error)
        } else {
            Ok(Self::new(GenericArray::from_slice(key)))
        }
    }
/// Create new AEAD instance from key given as a byte slice..
///
/// Default implementation will accept only keys with length equal to `KeySize`.
Create new AEAD instance from key given as a byte slice
Default implementation will accept only keys with length equal to `KeySize`.
Create new AEAD instance from key given as a byte slice Default implementation will accept only keys with length equal to ` KeySize ` .
fn new_from_slice(key: &[u8]) -> Result<Self>
    where
        Self: Sized,
    {
        if key.len() != Self::KeySize::to_usize() {
            Err(Error)
        } else {
            Ok(Self::new(GenericArray::from_slice(key)))
        }
    }
fn new_from_slice ( key : & [ u8 ] ) -> Result < Self > where Self : Sized , { if key . len ( ) != Self :: KeySize :: to_usize ( ) { Err ( Error ) } else { Ok ( Self :: new ( GenericArray :: from_slice ( key ) ) ) } }
Create new AEAD instance from key given as a byte slice..
Create new AEAD instance from key given as a byte slice ..
key
&[u8]
key
&[u8]