nx_xoshiro.nx
buildroot/runtime/nx_xoshiro.nx
about
xoshiro.nx -- xoshiro256++ pseudorandom number generator.
David Blackman + Sebastiano Vigna 2018. 256-bit state,
64-bit output per step, period 2^256 - 1. Passes BigCrush
statistical tests. Used by: Rust `rand` standard generator,
Lua 5.4, GNU FORTRAN, .NET 6+.
NOT cryptographically secure -- an attacker who observes
enough output can reconstruct state. For crypto use rand.nx
(/dev/urandom) or HMAC-DRBG (pending).
Used for: simulation, deterministic test data, sampling,
fuzzing. When you need REPRODUCIBLE pseudorandom from a seed.
Invariants:
X1 64-bit output per step; full state advances.
X2 Same seed -> same output sequence forever.
X3 All-zeros state forbidden (would produce all zeros).
seed_with implements the SplitMix64 trick to safely
initialise from any 64-bit seed including 0.
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/nist/sp_800_90a
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_bits.nx
imported by: nx_proptest.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 35 | struct Xoshiro |
consts
| none |
functions
| 43 | func xs_rotl(x: i64, k: i64) -> i64 |
| 50 | func xs_splitmix(state_p: *i64) -> i64 called by 1: xoshiro_seed |
| 59 | func xoshiro_seed(rng: *Xoshiro, seed: i64) -> i64 |
| 71 | func xoshiro_new(seed: i64) -> *Xoshiro |
| 80 | func xoshiro_next(rng: *Xoshiro) -> i64 |
| 94 | func xoshiro_bounded(rng: *Xoshiro, bound: i64) -> i64 |
| 105 | func main() -> i64 |