pub trait InnerIvInit:
InnerUser
+ IvSizeUser
+ Sized {
// Required method
fn inner_iv_init(inner: Self::Inner, iv: &Iv<Self>) -> Self;
// Provided methods
fn inner_iv_slice_init(
inner: Self::Inner,
iv: &[u8],
) -> Result<Self, InvalidLength> { ... }
fn generate_iv() -> Result<Iv<Self>, OsError> { ... }
fn generate_iv_with_rng<R: CryptoRng + ?Sized>(rng: &mut R) -> Iv<Self> { ... }
fn try_generate_iv_with_rng<R: TryCryptoRng + ?Sized>(
rng: &mut R,
) -> Result<Iv<Self>, R::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: &Iv<Self>) -> Self
fn inner_iv_init(inner: Self::Inner, iv: &Iv<Self>) -> 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() -> Result<Iv<Self>, OsError>
Available on crate feature os_rng
only.
fn generate_iv() -> Result<Iv<Self>, OsError>
os_rng
only.Generate random IV using the operating system’s secure RNG.
Sourcefn generate_iv_with_rng<R: CryptoRng + ?Sized>(rng: &mut R) -> Iv<Self>
Available on crate feature rand_core
only.
fn generate_iv_with_rng<R: CryptoRng + ?Sized>(rng: &mut R) -> Iv<Self>
rand_core
only.Generate random IV using the provided CryptoRng
.
Sourcefn try_generate_iv_with_rng<R: TryCryptoRng + ?Sized>(
rng: &mut R,
) -> Result<Iv<Self>, R::Error>
Available on crate feature rand_core
only.
fn try_generate_iv_with_rng<R: TryCryptoRng + ?Sized>( rng: &mut R, ) -> Result<Iv<Self>, R::Error>
rand_core
only.Generate random IV using the provided TryCryptoRng
.
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.