On Unix machines, the throughput of the HAVEGE generator is generally higher than the typical throughput of standard random generators rand() or random(). For application domains requiring huge volume of high quality random numbers, we provide the ndrand() function.2CAUTION: ndrand() passes all statistical tests for uniform distribution and is irreproducible.

However ndrand() has been designed for providing both high throughput and high quality, but not for unpredictability.

3.

- cryptondrand() produces several megabytes of unpredictable random numbers per cycle.
- Each 1 Mbyte sequence of cryptondrand() results is the exclusive-OR of the previous sequence with
32consecutive 1 Mbyte sequences of a ndrand()-like function results.- Each of these
33individual sequences are already high quality random number sequences.- Total collection of a 1 Mbyte sequence spans over several tens of operating system interrupts.
- The 31 intermediate sequences are hidden from the outside world.
Hiding a single intermediate sequence is sufficient to ensure irreproducibiliy.

A single procedure,Back to HAVEGE main pageHAVEGE_COLLECTRAND(),is used both to initialize the predictor and to generate unpredictable random numbers.The main loop in

HAVEGE_COLLECTRAND()is embedded in fileLoopBody.h. The iterations are unrolled in order to fully gather and expand entropy from the instruction cache and branch predictor. Precise number of iterations depend on the compiler, the processor and the operating system. An iteration is coded in fileOneIteration.h.Two parallel self-modifying walks in a table called

Walktwice as large as the data cache are performed (gather and expand entropy from the L1 data cache).

16 results data (from the RESULT array) are updated per iteration.

21 conditonal tests on random data are per iteration and the hardware clock counter is read two times to collect the entropy.The initialisation phase runs

HAVEGE_COLLECTRAND()a sufficient number of times to guarantee that all internal variables (i.e theRESULT, Walkarrays andPTandPT2pointers) are unpredictable.