pub struct KqueueEventsSource {
pub config: KqueueEventsConfig,
}Expand description
Harvests timing jitter from kqueue event notification multiplexing.
§What it measures
Nanosecond timing of kevent() calls with multiple registered event
types (timers, file watchers, socket monitors) firing concurrently.
§Why it’s entropic
kqueue is the macOS/BSD kernel event notification system. Registering diverse event types simultaneously creates rich interference:
- Timer events —
EVFILT_TIMERwith different intervals fire at kernel-determined times affected by timer coalescing, interrupt handling, and power management state - File watchers —
EVFILT_VNODEon temp files monitors inode changes; traverses VFS, APFS/HFS event queues, and the kqueue knote hash table - Socket events —
EVFILT_READ/EVFILT_WRITEon socket pairs monitors buffer state; interacts with the network stack’s mbuf allocator - Knote lock contention — many registered watchers all compete for the kqueue’s internal knote lock and dispatch queue
§What makes it unique
No prior work has combined multiple kqueue event types as an entropy source. The cross-event-type interference (timer delivery affecting socket notification timing) produces entropy that is independent from any single event source.
§Configuration
See KqueueEventsConfig for tunable parameters. Key options:
num_timers: controls timer coalescing interferencenum_sockets: controls mbuf allocator contentionnum_file_watchers: controls VFS notification path diversitytimeout_ms: controlskevent()wait duration
Fields§
§config: KqueueEventsConfigSource configuration. Use Default::default() for recommended settings.
Trait Implementations§
Source§impl Default for KqueueEventsSource
impl Default for KqueueEventsSource
Source§fn default() -> KqueueEventsSource
fn default() -> KqueueEventsSource
Returns the “default value” for a type. Read more
Source§impl EntropySource for KqueueEventsSource
impl EntropySource for KqueueEventsSource
Auto Trait Implementations§
impl Freeze for KqueueEventsSource
impl RefUnwindSafe for KqueueEventsSource
impl Send for KqueueEventsSource
impl Sync for KqueueEventsSource
impl Unpin for KqueueEventsSource
impl UnwindSafe for KqueueEventsSource
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