Skip to main content

Crate openentropy_core

Crate openentropy_core 

Source
Expand description

§openentropy-core

Your computer is a hardware noise observatory.

openentropy-core is the core entropy harvesting library that extracts randomness from 38 unconventional hardware sources — clock jitter, DRAM row buffer timing, CPU speculative execution, Bluetooth RSSI, NVMe latency, and more.

§Quick Start

use openentropy_core::EntropyPool;

// Auto-detect all available sources and create a pool
let pool = EntropyPool::auto();

// Get conditioned random bytes
let random_bytes = pool.get_random_bytes(256);
assert_eq!(random_bytes.len(), 256);

// Check pool health
let health = pool.health_report();
println!("{}/{} sources healthy", health.healthy, health.total);

§Architecture

Sources → Pool (concatenate) → Conditioning → Output

Three output modes:

  • Sha256 (default): SHA-256 conditioning mixes all source bytes with state, counter, timestamp, and OS entropy. Cryptographically strong output.
  • VonNeumann: debiases raw bytes without destroying noise structure.
  • Raw (get_raw_bytes): source bytes pass through unchanged — no hashing, no whitening, no mixing between sources.

Raw mode preserves the actual hardware noise signal for researchers studying device entropy characteristics. Most QRNG APIs (ANU, Outshift) run DRBG post-processing that destroys the raw hardware signal. We don’t.

Every source implements the EntropySource trait. The EntropyPool collects from all registered sources and concatenates their byte streams.

Re-exports§

pub use conditioning::ConditioningMode;
pub use conditioning::MinEntropyReport;
pub use conditioning::QualityReport;
pub use conditioning::condition;
pub use conditioning::grade_min_entropy;
pub use conditioning::min_entropy_estimate;
pub use conditioning::quick_min_entropy;
pub use conditioning::quick_quality;
pub use conditioning::quick_shannon;
pub use platform::detect_available_sources;
pub use platform::platform_info;
pub use pool::EntropyPool;
pub use pool::HealthReport;
pub use pool::SourceHealth;
pub use pool::SourceInfoSnapshot;
pub use source::EntropySource;
pub use source::SourceCategory;
pub use source::SourceInfo;

Modules§

conditioning
Centralized entropy conditioning module.
platform
Platform detection and source discovery.
pool
Multi-source entropy pool with health monitoring.
source
Abstract entropy source trait and runtime state.
sources
All 38 entropy source implementations.

Constants§

VERSION
Library version (from Cargo.toml).