pub struct AdaptiveProportionTest { /* private fields */ }Expand description
SP 800-90B Section 4.4.2 Adaptive Proportion Test (APT) for raw noise samples.
Counts occurrences of the first sample in each fixed window of size window_size (512 for
non-binary sources or 1,024 for binary sources) and fails permanently with
[Error::EntropyHealthCheckFailed] if the count reaches cutoff.
Implementations§
Source§impl AdaptiveProportionTest
impl AdaptiveProportionTest
Sourcepub const fn new(window_size: usize, cutoff: u32) -> Result<Self>
pub const fn new(window_size: usize, cutoff: u32) -> Result<Self>
Creates a new APT with window_size >= 2 and 2 <= cutoff <= window_size.
For approved SP 800-90B noise sources, prefer Self::for_source_kind or
RawNoiseHealthMonitor::new, which lock window_size to 1,024 (binary) or 512
(non-binary).
Sourcepub const fn for_source_kind(kind: AptSourceKind, cutoff: u32) -> Result<Self>
pub const fn for_source_kind(kind: AptSourceKind, cutoff: u32) -> Result<Self>
Creates an APT locked to the SP 800-90B Section 4.4.2 standard window for kind.
Trait Implementations§
Source§impl Drop for AdaptiveProportionTest
impl Drop for AdaptiveProportionTest
Auto Trait Implementations§
impl Freeze for AdaptiveProportionTest
impl RefUnwindSafe for AdaptiveProportionTest
impl Send for AdaptiveProportionTest
impl Sync for AdaptiveProportionTest
impl Unpin for AdaptiveProportionTest
impl UnsafeUnpin for AdaptiveProportionTest
impl UnwindSafe for AdaptiveProportionTest
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