Example Code

Statistical tests for random and pseudorandom number generators

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

    Operating System

  • Mac OS X
  • Windows

Code and Documents

Attachment

Description

Suite of statistical tests for random and pseudorandom number generators based on the NIST statistical test suite

 

Each implemented test is attached as a separate folder. A simple random generator based on the "Random number (Range) VI" is also provided for test.

Overlapping Template Matching Test makes use of the Kenji HAMANO and Toshinobu KANEKO correction for computation of occurrence probability of template. It is based on a set of recurrence formulas that have been implemented using recursive VIs, a global variable and a file. Results have been saved in a file for fast computing and reduced memory requirements (this for illustration. For repetitive use, a lookup table should be used.).

Maurer's Universal Statistical Test calculates the expected value and the variance of the computed statistic for the given L-bit length approximately, according to the required accuracy in digits and a permitted maximum number of iteration (this for illustration. For repetitive use, a lookup table should be used.).

Advanced signal processing toolkit is required for DFT Spectral Test. 

 

 

 

 

Additional Information

References

 

Lawrence E. Bassham, Andrew L. Rukhin, Juan Soto, James R. Nechvatal, Miles E. Smid, Stefan D. Leigh, M Levenson, M Vangel, Nathanael A. Heckert, D L. Banks, "A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications", NIST SP 800-22 revision 1A, Gaithersburg, 2010.

 

Hamano K., Kaneko T., "The Correction of the Overlapping Template Matching Test Included in NIST Randomness Test Suite", IEEE Transaction of Electronics, Communications and Computer Sciences Vol. E90-A, 2007, pp. 1788-1792.

 

 

 

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors