pub enum RNGFactory {
HashDRBG_SHA256(HashDRBG_SHA256),
HashDRBG_SHA512(HashDRBG_SHA512),
}Expand description
Wrapper object for all algorithms that impl RNG.
Variants§
HashDRBG_SHA256(HashDRBG_SHA256)
HashDRBG_SHA512(HashDRBG_SHA512)
Trait Implementations§
Source§impl AlgorithmFactory for RNGFactory
impl AlgorithmFactory for RNGFactory
Source§fn default_128_bit() -> Self
fn default_128_bit() -> Self
Get the default configured algorithm at the 128-bit security level.
Source§fn default_256_bit() -> Self
fn default_256_bit() -> Self
Get the default configured algorithm at the 256-bit security level.
Source§impl Default for RNGFactory
impl Default for RNGFactory
Source§impl RNG for RNGFactory
impl RNG for RNGFactory
Source§fn add_seed_keymaterial(
&mut self,
additional_seed: &dyn KeyMaterialTrait,
) -> Result<(), RNGError>
fn add_seed_keymaterial( &mut self, additional_seed: &dyn KeyMaterialTrait, ) -> Result<(), RNGError>
Provide additional key material to be mixed in to the existing RNG instance.
The exact behaviour will be implementation-specific, but this is intended for injecting
additional entropy, not as the primary method of seeding the RNG.
Source§fn next_bytes(&mut self, len: usize) -> Result<Vec<u8>, RNGError>
fn next_bytes(&mut self, len: usize) -> Result<Vec<u8>, RNGError>
Returns the number of requested bytes.
Source§fn next_bytes_out(&mut self, out: &mut [u8]) -> Result<usize, RNGError>
fn next_bytes_out(&mut self, out: &mut [u8]) -> Result<usize, RNGError>
Returns the number of bytes written.
The entire output buffer is zeroized before the random bytes are written.
Source§fn fill_keymaterial_out(
&mut self,
out: &mut dyn KeyMaterialTrait,
) -> Result<usize, RNGError>
fn fill_keymaterial_out( &mut self, out: &mut dyn KeyMaterialTrait, ) -> Result<usize, RNGError>
Fill the provided
KeyMaterial with random bytes.Source§fn security_strength(&self) -> SecurityStrength
fn security_strength(&self) -> SecurityStrength
Returns the Security Strength of this RNG.
Auto Trait Implementations§
impl Freeze for RNGFactory
impl RefUnwindSafe for RNGFactory
impl Send for RNGFactory
impl Sync for RNGFactory
impl Unpin for RNGFactory
impl UnsafeUnpin for RNGFactory
impl UnwindSafe for RNGFactory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more