SFC64
Small chaotic generators from the PractRand test suite
Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About SFC64
SFC64 is one of 2 SFC (Small Fast Chaotic) variants in the NextSSL registry, a non-cryptographic pseudorandom generator. It uses a 1–268,435,456-byte output and a 24-byte seed. Its registry entry cites SFC64 (Doty-Humphrey, PractRand), NOT cryptographically secure. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
SFC32 and SFC64 are small, fast, nonlinear pseudorandom number generators designed by Chris Doty-Humphrey, author of the PractRand statistical test suite. They pass extensive statistical testing and are a common choice where speed matters, but they are not cryptographic.
Each SFC generator keeps three working words and a counter. Every step adds, shifts and rotates the words into one another and increments the counter. The nonlinear mixing makes the period unknown in general, but the counter guarantees a minimum period of 2^32 or 2^64 for any seed, and in practice periods are vastly longer. Its state is small enough to keep in registers.
Two variants are present: sfc32, operating on 32-bit words with a 128-bit state, and sfc64, operating on 64-bit words with a 256-bit state. SFC64 is one of the bit generators offered by NumPy. Both are suitable for parallel use when each instance is seeded independently, for example with SplitMix64. The 32-bit version is especially fast on platforms without efficient 64-bit multiplication, since SFC uses no multiplication at all.
How it works
- Seed the three words and set the counter, then discard a few initial outputs.
- Compute output as a + b + counter.
- Update a from b and a right shift of b, b from c and a left shift of c, and c by rotating and adding the output.
- Increment the counter.
Security notes
Not cryptographically secure: the small state and simple update allow an attacker to recover the state and predict outputs. Do not use for keys, nonces or tokens.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 1 – 268,435,456 | Output |
| seed | 24 | Seed |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'unverified' is reachable from the root API only
buf = root.call("rng_fill", "sfc64", "seed=42", 32)[0] # not for keys
nextssl_root_rng_fill("sfc64", "seed=42", 32, out);
// prng is a root-only kind: use the C ABI (nextssl_root_*)
// or the Prng trait in nextssl-core/src/traits.rs
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other SFC (Small Fast Chaotic) variants
1Similar names
Looking for something else?More non-cryptographic prngs
All 26Frequently asked questions
What is SFC64?
SFC64 is a PRNG in the SFC (Small Fast Chaotic) family. SFC32 and SFC64 are small, fast, nonlinear pseudorandom number generators designed by Chris Doty-Humphrey, author of the PractRand statistical test suite.
What are the SFC64 sizes?
In NextSSL, SFC64 uses: output 1 to 268,435,456 bytes.
Who designed SFC64 and when?
SFC64 belongs to the SFC (Small Fast Chaotic) family, first published by Chris Doty-Humphrey. Its origin: PractRand.
Which standards define SFC64?
SFC64 is referenced by SFC64 (Doty-Humphrey, PractRand), NOT cryptographically secure.
Is SFC64 safe to use?
SFC64 is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other SFC (Small Fast Chaotic) variants are there?
NextSSL also registers sfc32 in the SFC (Small Fast Chaotic) family.
Related families
Permuted congruential generators: LCG state with a permutation on output
SplitMix64Counter-based 64-bit generator, widely used to seed other generators
xoshiro / xoroshiroFast linear generators from Blackman and Vigna for simulation, not for secrets
Operating system RNGThe kernel's cryptographically secure random number generator, the right default