pub struct RawNoiseHealthMonitor { /* private fields */ }Expand description
Lifecycle monitor connecting SP 800-90B startup, continuous, and on-demand health tests for an unconditioned raw noise source.
Blocks readiness (Self::is_ready returns false) until STARTUP_SAMPLE_COUNT (1,024)
consecutive raw samples pass both RCT and APT, then seamlessly carries RCT/APT state into
continuous monitoring. Any failure latches permanently on the monitor.
Implementations§
Source§impl RawNoiseHealthMonitor
impl RawNoiseHealthMonitor
Sourcepub fn new(
rct_cutoff: u32,
kind: AptSourceKind,
apt_cutoff: u32,
) -> Result<Self>
pub fn new( rct_cutoff: u32, kind: AptSourceKind, apt_cutoff: u32, ) -> Result<Self>
Creates a new monitor with SP 800-90B mandated APT window (1,024 binary / 512 non-binary)
and assessed cutoffs derived from the noise source’s min-entropy and false-positive bound.
Sourcepub fn observe(&mut self, sample: u64) -> Result<bool>
pub fn observe(&mut self, sample: u64) -> Result<bool>
Observes one unconditioned raw noise sample.
Returns:
Ok(false)while still executing the 1,024-sample startup test (output MUST remain blocked),Ok(true)once startup has completed and continuous health holds,Err(Error::EntropyHealthCheckFailed)on any RCT/APT failure (latched permanently).
Sourcepub fn run_on_demand_test(&mut self, samples: &[u64]) -> Result<()>
pub fn run_on_demand_test(&mut self, samples: &[u64]) -> Result<()>
Runs an SP 800-90B Section 4.2 on-demand health test over at least 1,024 consecutive raw
samples; any failure permanently latches this monitor.
Trait Implementations§
Source§impl Drop for RawNoiseHealthMonitor
impl Drop for RawNoiseHealthMonitor
Auto Trait Implementations§
impl Freeze for RawNoiseHealthMonitor
impl RefUnwindSafe for RawNoiseHealthMonitor
impl Send for RawNoiseHealthMonitor
impl Sync for RawNoiseHealthMonitor
impl Unpin for RawNoiseHealthMonitor
impl UnsafeUnpin for RawNoiseHealthMonitor
impl UnwindSafe for RawNoiseHealthMonitor
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