Skip to main content

Module env

Module env 

Source
Expand description

Deterministic environment for reproducible NIST evaluation runs.

A DeterministicEnv bundles the four knobs a vector needs to be replayable bit-for-bit across machines and runs:

  • a seeded DeterministicRng (a Splittable-style PRNG built on rand_chacha’s design without pulling in rand — we seed a simple ChaCha8-like counter stream here, but the concrete implementation is a 128-bit splitmix64 that is fully self-contained)
  • a DeterministicClock that advances only when the harness tells it to (no wall-clock dependence, no flaky timeouts)
  • a MemoryCounter that tallies bytes the harness attributes to a party so the bench can report peak allocation per scheme

The harness never reads the OS clock or getrandom directly — every source of nondeterminism is funneled through this module so the same vector + seed yields the same transcript every time.

Structs§

DeterministicClock
Stepping clock that ignores wall time.
DeterministicEnv
The four-knob deterministic bundle handed to a vector run.
DeterministicRng
Self-contained deterministic PRNG.
ForkedEnv
Per-party view of a DeterministicEnv: its own RNG, borrowed clock and memory counter shared with siblings.
MemoryCounter
Per-party allocation tally.