pub trait InnerIvInit: InnerUser + IvSizeUser + Sized {
    fn inner_iv_init(inner: Self::Inner, iv: &Iv<Self>) -> Self;

    fn inner_iv_slice_init(
        inner: Self::Inner,
        iv: &[u8]
    ) -> Result<Self, InvalidLength> { ... } fn generate_iv(rng: impl CryptoRng + RngCore) -> Iv<Self> { ... } }
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§

Initialize value using inner and iv array.

Provided Methods§

Initialize value using inner and iv slice.

Examples found in repository?
src/lib.rs (line 278)
277
278
279
    fn new_from_slices(key: &[u8], iv: &[u8]) -> Result<Self, InvalidLength> {
        T::Inner::new_from_slice(key).and_then(|i| T::inner_iv_slice_init(i, iv))
    }
Available on crate feature rand_core only.

Generate random IV using the provided CryptoRng.

Implementors§