Expand description
Entropy Quality Monitoring
This module provides tools for monitoring and assessing the quality of entropy sources used for cryptographic key generation and random number generation.
§Features
- Statistical tests: Chi-squared, Monte Carlo Pi estimation, serial correlation
- Entropy estimation: Shannon entropy, min-entropy calculations
- NIST SP 800-90B compliance: Health tests for entropy sources
- Continuous monitoring: Track entropy quality over time
- Anomaly detection: Detect degraded or compromised entropy sources
- Compliance reporting: Generate reports for auditing
§Example
use chie_crypto::entropy::{EntropyMonitor, EntropySource};
// Create an entropy monitor
let mut monitor = EntropyMonitor::new();
// Test random bytes from system RNG
let mut rng_source = EntropySource::system_rng();
let random_data = rng_source.get_bytes(1000);
// Evaluate entropy quality
let quality = monitor.evaluate(&random_data).unwrap();
println!("Entropy quality: {:?}", quality);
println!("Shannon entropy: {:.2} bits/byte", quality.shannon_entropy);
println!("Passes health tests: {}", quality.passes_health_tests());Structs§
- Entropy
Monitor - Entropy monitor for continuous quality assessment
- Entropy
Quality - Entropy quality assessment result
- Entropy
Source - Entropy source wrapper
Enums§
- Entropy
Error - Entropy error types
Type Aliases§
- Entropy
Result - Result type for entropy operations