cipher

Trait InnerIvInit

Source
pub trait InnerIvInit:
    Sized
    + InnerUser
    + IvSizeUser {
    // Required method
    fn inner_iv_init(
        inner: Self::Inner,
        iv: &GenericArray<u8, Self::IvSize>,
    ) -> Self;

    // Provided methods
    fn inner_iv_slice_init(
        inner: Self::Inner,
        iv: &[u8],
    ) -> Result<Self, InvalidLength> { ... }
    fn generate_iv(
        rng: impl CryptoRng + RngCore,
    ) -> GenericArray<u8, Self::IvSize> { ... }
}
Expand description

Types which can be initialized from another type and additional initialization vector/nonce.

Usually used for initializing types from block ciphers.

Required Methods§

Source

fn inner_iv_init( inner: Self::Inner, iv: &GenericArray<u8, Self::IvSize>, ) -> Self

Initialize value using inner and iv array.

Provided Methods§

Source

fn inner_iv_slice_init( inner: Self::Inner, iv: &[u8], ) -> Result<Self, InvalidLength>

Initialize value using inner and iv slice.

Source

fn generate_iv(rng: impl CryptoRng + RngCore) -> GenericArray<u8, Self::IvSize>

Generate random IV using the provided CryptoRng.

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.

Implementors§