Skip to main content

KeyIvInit

Trait KeyIvInit 

pub trait KeyIvInit:
    Sized
    + KeySizeUser
    + IvSizeUser {
    // Required method
    fn new(
        key: &GenericArray<u8, Self::KeySize>,
        iv: &GenericArray<u8, Self::IvSize>,
    ) -> Self;

    // Provided method
    fn new_from_slices(key: &[u8], iv: &[u8]) -> Result<Self, InvalidLength> { ... }
}
Expand description

Types which can be initialized from key and initialization vector (nonce).

Required Methods§

fn new( key: &GenericArray<u8, Self::KeySize>, iv: &GenericArray<u8, Self::IvSize>, ) -> Self

Create new value from fixed length key and nonce.

Provided Methods§

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

Create new value from variable length key and nonce.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl KeyIvInit for ChaCha20LegacyCore

§

fn new( key: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>, iv: &GenericArray<u8, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>, ) -> ChaCha20LegacyCore

Source§

impl<H, S, B> KeyIvInit for Lioness<H, S, B>
where H: KeySizeUser + OutputSizeUser, S: KeySizeUser + IvSizeUser, B: ArrayLength<u8> + IsGreater<<S as KeySizeUser>::KeySize, Output = B1>, <H as OutputSizeUser>::OutputSize: IsEqual<<S as KeySizeUser>::KeySize, Output = B1> + Mul<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>, <H as KeySizeUser>::KeySize: IsEqual<<S as KeySizeUser>::KeySize, Output = B1>, <S as IvSizeUser>::IvSize: Mul<UInt<UInt<UTerm, B1>, B0>>, <<H as OutputSizeUser>::OutputSize as Mul<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>>::Output: ArrayLength<u8>, <<S as IvSizeUser>::IvSize as Mul<UInt<UInt<UTerm, B1>, B0>>>::Output: ArrayLength<u8>,

Source§

fn new( key: &GenericArray<u8, <Lioness<H, S, B> as KeySizeUser>::KeySize>, iv: &GenericArray<u8, <Lioness<H, S, B> as IvSizeUser>::IvSize>, ) -> Lioness<H, S, B>

Source§

impl<R> KeyIvInit for SalsaCore<R>
where R: Unsigned,

Source§

fn new( key: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>, iv: &GenericArray<u8, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>, ) -> SalsaCore<R>

Source§

impl<R> KeyIvInit for XSalsaCore<R>
where R: Unsigned,

Source§

fn new( key: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>, iv: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>, ) -> XSalsaCore<R>

§

impl<R> KeyIvInit for ChaChaCore<R>
where R: Unsigned,

§

fn new( key: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>, iv: &GenericArray<u8, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>, ) -> ChaChaCore<R>

§

impl<R> KeyIvInit for XChaChaCore<R>
where R: Unsigned,

§

fn new( key: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>, iv: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>, ) -> XChaChaCore<R>

§

impl<T> KeyIvInit for StreamCipherCoreWrapper<T>

§

fn new( key: &GenericArray<u8, <StreamCipherCoreWrapper<T> as KeySizeUser>::KeySize>, iv: &GenericArray<u8, <StreamCipherCoreWrapper<T> as IvSizeUser>::IvSize>, ) -> StreamCipherCoreWrapper<T>

Implementors§

Source§

impl<T> KeyIvInit for IvKey<T>
where T: KeyIvInit,

§

impl<T> KeyIvInit for T
where T: InnerIvInit, <T as InnerUser>::Inner: KeyInit,