PRNG family

SFC (Small Fast Chaotic)

Small chaotic generators from the PractRand test suite

unverified 2 variants PractRand

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

  1. Seed the three words and set the counter, then discard a few initial outputs.
  2. Compute output as a + b + counter.
  3. 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.
  4. 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

High-speed simulationGames and graphicsRandomised testing

Variants in NextSSL

2
AlgorithmTierSizes (bytes)StandardsAPI
SFC32
sfc32
unverified out 1–268435456 · seed 12 SFC32 (Doty-Humphrey, PractRand), NOT cryptographically… root
SFC64
sfc64
unverified out 1–268435456 · seed 24 SFC64 (Doty-Humphrey, PractRand), NOT cryptographically… root

Frequently asked questions

Which SFC (Small Fast Chaotic) variants does NextSSL include?

NextSSL registers 2 SFC (Small Fast Chaotic) variants: sfc32, sfc64.