Trait cipher::InnerIvInit
source · pub trait InnerIvInit: InnerUser + IvSizeUser + Sized {
// Required method
fn inner_iv_init(inner: Self::Inner, iv: &Array<u8, Self::IvSize>) -> Self;
// Provided methods
fn inner_iv_slice_init(
inner: Self::Inner,
iv: &[u8]
) -> Result<Self, InvalidLength> { ... }
fn generate_iv_with_rng(
rng: &mut impl CryptoRngCore
) -> Result<Array<u8, Self::IvSize>, Error> { ... }
}
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§
sourcefn inner_iv_init(inner: Self::Inner, iv: &Array<u8, Self::IvSize>) -> Self
fn inner_iv_init(inner: Self::Inner, iv: &Array<u8, Self::IvSize>) -> Self
Initialize value using inner
and iv
array.
Provided Methods§
sourcefn inner_iv_slice_init(
inner: Self::Inner,
iv: &[u8]
) -> Result<Self, InvalidLength>
fn inner_iv_slice_init( inner: Self::Inner, iv: &[u8] ) -> Result<Self, InvalidLength>
Initialize value using inner
and iv
slice.
sourcefn generate_iv_with_rng(
rng: &mut impl CryptoRngCore
) -> Result<Array<u8, Self::IvSize>, Error>
fn generate_iv_with_rng( rng: &mut impl CryptoRngCore ) -> Result<Array<u8, Self::IvSize>, Error>
Available on crate feature
rand_core
only.Generate random IV using the provided CryptoRngCore
.
Object Safety§
This trait is not object safe.