pub struct EntropySourceFactory;Expand description
Entropy source factory
This factory provides convenient methods for creating different types of entropy sources based on requirements and platform capabilities.
Implementations§
Source§impl EntropySourceFactory
impl EntropySourceFactory
Sourcepub fn create_best_available() -> Result<Box<dyn EntropySource>>
pub fn create_best_available() -> Result<Box<dyn EntropySource>>
Create the best available entropy source
This method attempts to create the highest quality entropy source available on the current platform.
Sourcepub fn create_best_available_with_config(
config: &EntropyConfig,
) -> Result<Box<dyn EntropySource>>
pub fn create_best_available_with_config( config: &EntropyConfig, ) -> Result<Box<dyn EntropySource>>
Create the best available entropy source with configuration
This method attempts to create the highest quality entropy source available on the current platform that meets the specified requirements.
Sourcepub fn create_os_entropy() -> Result<Box<dyn EntropySource>>
pub fn create_os_entropy() -> Result<Box<dyn EntropySource>>
Create an OS entropy source
Sourcepub fn create_os_entropy_with_config(
config: &EntropyConfig,
) -> Result<Box<dyn EntropySource>>
pub fn create_os_entropy_with_config( config: &EntropyConfig, ) -> Result<Box<dyn EntropySource>>
Create an OS entropy source with configuration
Sourcepub fn create_hardware_entropy() -> Result<Box<dyn EntropySource>>
pub fn create_hardware_entropy() -> Result<Box<dyn EntropySource>>
Create a hardware entropy source
Sourcepub fn create_hardware_entropy_with_config(
config: &EntropyConfig,
) -> Result<Box<dyn EntropySource>>
pub fn create_hardware_entropy_with_config( config: &EntropyConfig, ) -> Result<Box<dyn EntropySource>>
Create a hardware entropy source with configuration
Sourcepub fn create_deterministic_entropy(seed: [u8; 32]) -> Box<dyn EntropySource>
pub fn create_deterministic_entropy(seed: [u8; 32]) -> Box<dyn EntropySource>
Create a deterministic entropy source (KT128 XOF from seed).
Sourcepub fn create_deterministic_entropy_from_u64(
seed: u64,
) -> Box<dyn EntropySource>
pub fn create_deterministic_entropy_from_u64( seed: u64, ) -> Box<dyn EntropySource>
Create a deterministic entropy source from a u64 test seed (SplitMix64 → KT128).
Sourcepub fn create_user_entropy(entropy_data: Vec<u8>) -> Box<dyn EntropySource>
pub fn create_user_entropy(entropy_data: Vec<u8>) -> Box<dyn EntropySource>
Create a user entropy source
Sourcepub fn create_user_entropy_with_quality(
entropy_data: Vec<u8>,
quality: f64,
) -> Box<dyn EntropySource>
pub fn create_user_entropy_with_quality( entropy_data: Vec<u8>, quality: f64, ) -> Box<dyn EntropySource>
Create a user entropy source with quality assessment