Student or educator? Sign up with your school email and get 6 months of Pro free.
CoChat

The DOI matches its Crossref record; 30 of the 30 references it cites were found in a registry or an index; 2 of the 16 sources its claims cite were checked for support.

On Statistical Tests for Randomness Included in the NIST SP800-22 Test Suite and Based on the Binomial Distribution

Open access
Pareschi, Fabio, Rovatti, Riccardo, Setti, Gianluca · 2012 · IEEE Transactions on Information Forensics and Security

Abstract

In this paper we review some statistical tests included in the NIST SP 800-22 suite, which is a collection of tests for the evaluation of both true-random (physical) and pseudorandom (algorithmic) number generators for cryptographic applications. The output of these tests is the so-called$p$-value which is a random variable whose distribution converges to the uniform distribution in the interval [0,1] when testing an increasing number of samples from an ideal generator. Here, we compute the exact non-asymptotic distribution of$p$-values produced by few of the tests in the suite, and propose some computation-friendly approximations. This allows us to explain why intensive testing produces false-positives with a probability much higher than the expected one when considering asymptotic distribution instead of the true one. We also propose a new approximation for the Spectral Test reference distribution, which is more coherent with experimental results.

Overview

CoChat Summary

## TL;DR

The paper analyzes how the p-values in three NIST SP800-22 randomness tests are actually distributed under an ideal generator, showing they are discrete and often deviate from the uniform assumption used in standard interpretations. It derives feasible approximations for the Frequency, Runs, and Spectral tests and uses them to explain and reduce false positives, especially in two-level testing.

## Key findings

  • For the Frequency test and Runs test, the paper derives approximations to the exact p-value CDFs and reports that the theoretical densities match the experimental ones well for BBS and Mersenne Twister simulations.
  • For the Spectral test, the paper finds that NIST’s reference variance for the distribution of \(N_1\) is better fit by \(\sigma^2 = 0.95 \cdot 0.05 \cdot n / 3.8\) rather than \(0.95 \cdot 0.05 \cdot n / 4\).
  • Using the refined Spectral-test variance, the reported standard-approach significance is \(1.01258 \cdot 10^{-2}\) for \(n=10^6\) and \(0.99742 \cdot 10^{-2}\) for \(n=2^{20}\); with the NIST variance, the corresponding values are \(1.01258 \cdot 10^{-2}\) and \(0.99742 \cdot 10^{-2}\)? Not stated in the paper.
  • For reliability of two-level tests, the paper gives concrete bounds such as \(N < 4798\) and \(N < 36448\) for the Frequency test under specific error requirements, \(N < 5975\) and \(N < 17524\) for a chi-square-based two-level test, and \(N < 102\) and \(N < 685\) for a Kolmogorov-Smirnov-based two-level test.

## Methods

  • The paper is a mathematical/review study of three NIST SP800-22 tests: Frequency, Runs, and Spectral, all treated as binomial-based tests on bit sequences.
  • It derives exact or approximated p-value distributions under the null hypothesis, then compares those distributions to simulations from BBS and Mersenne Twister generators; Table I and Table II report numerical results for two-level testing.
  • It analyzes standard one-level testing, NIST-style two-level testing (fraction passing and chi-square goodness-of-fit), and an additional Kolmogorov-Smirnov-based two-level approach.

## Limitations

  • The paper states that the standard approach’s exact power cannot be computed in a general way because it depends on the specific non-ideal generator under test.
  • The Kolmogorov-Smirnov-based two-level analysis requires “strong hypotheses and approximations” to build a theoretical framework. This is stated in the paper.
  • Evident from the text: much of the derivation is asymptotic or approximation-based, and several formulas are presented as approximations rather than exact closed forms.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.1109/tifs.2012.2185227

Cites

30 of 30 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Figures

Fig. 1 Comparison between the uniform density, the theoretically expected one and the observed experimental one, discretized in k = 16bins , for the p -values in the Frequency Test, with n = 2 20 .
Fig. 1 Comparison between the uniform density, the theoretically expected one and the observed experimental one, discretized in k = 16bins , for the p -values in the Frequency Test, with n = 2 20 .From the PDF
Fig. 2 Comparison between the uniform density, the theoretically expected one and the observed experimental one, discretized in k = 16bins , for the p -values in the Runs Test, with n = 100 · 2 10 .
Fig. 2 Comparison between the uniform density, the theoretically expected one and the observed experimental one, discretized in k = 16bins , for the p -values in the Runs Test, with n = 100 · 2 10 .From the PDF
Fig. 3 (a) Comparison between the theoretical probability density function (PDF) of N 1 according to [2], [14], [15] and the experimental one observed in N = 10 6 sequences generated with the BBS algorithm and with n = 2 20 bits . (b) Normalized L 2 distances between the observed PDF of N 1 in the Spectral Test and a normal PDF with σ 2 = 0 . 95 · 0 . 05 · n/c , with c ranging from 3 . 5 to 4 , and with n = 2 20 bits , n = 100 · 2 10 bits and n = 10 · 2 10 bits . In all cases, the minimum distance is achieved for c ≃ 3 . 8 .
Fig. 3 (a) Comparison between the theoretical probability density function (PDF) of N 1 according to [2], [14], [15] and the experimental one observed in N = 10 6 sequences generated with the BBS algorithm and with n = 2 20 bits . (b) Normalized L 2 distances between the observed PDF of N 1 in the Spectral Test and a normal PDF with σ 2 = 0 . 95 · 0 . 05 · n/c , with c ranging from 3 . 5 to 4 , and with n = 2 20 bits , n = 100 · 2 10 bits and n = 10 · 2 10 bits . In all cases, the minimum distance is achieved for c ≃ 3 . 8 .From the PDF
Fig. 4 Comparison between the uniform density, the theoretically expected one and the observed experimental ones achieved with the BBS and the Mersenne-Twister algorithms, all discretized in k = 16 bins, for the p -values in the Spectral Test, with n = 2 20 , for the cases (a) the variance is computed as σ 2 = 0 . 95 · 0 . 05 · n/ 4 . 0 as indicated by the NIST document [2]; (b) the variance is computed as σ 2 = 0 . 95 · 0 . 05 · n/ 3 . 8 . Note that the experimental densities in (a) and (b) are different since the p -values are computed with two different functions. The matching in the case (b) is almost perfect.
Fig. 4 Comparison between the uniform density, the theoretically expected one and the observed experimental ones achieved with the BBS and the Mersenne-Twister algorithms, all discretized in k = 16 bins, for the p -values in the Spectral Test, with n = 2 20 , for the cases (a) the variance is computed as σ 2 = 0 . 95 · 0 . 05 · n/ 4 . 0 as indicated by the NIST document [2]; (b) the variance is computed as σ 2 = 0 . 95 · 0 . 05 · n/ 3 . 8 . Note that the experimental densities in (a) and (b) are different since the p -values are computed with two different functions. The matching in the case (b) is almost perfect.From the PDF
Fig. 5 Comparison between the average observed value of χ 2 / ( k -1) in a two-level Frequency Test for different values of N , with k = 16 and n = 2 20 (solid line), n = 100 · 2 10 (dashed line), n = 10 · 2 10 (dotted-dashed line), along with their values expected from (15) (dotted lines).
Fig. 5 Comparison between the average observed value of χ 2 / ( k -1) in a two-level Frequency Test for different values of N , with k = 16 and n = 2 20 (solid line), n = 100 · 2 10 (dashed line), n = 10 · 2 10 (dotted-dashed line), along with their values expected from (15) (dotted lines).From the PDF
Fig. 6 Comparison between the average observed value of D N -E[ D N 0 ] in a two-level Frequency Test for different values of N , with n = 2 20 (solid line), n = 100 · 2 10 (dashed line), n = 10 · 2 10 (dotted-dashed line), along with the approximated theoretically expected values (dotted horizontal lines).
Fig. 6 Comparison between the average observed value of D N -E[ D N 0 ] in a two-level Frequency Test for different values of N , with n = 2 20 (solid line), n = 100 · 2 10 (dashed line), n = 10 · 2 10 (dotted-dashed line), along with the approximated theoretically expected values (dotted horizontal lines).From the PDF
Fig. 7 Example of p -values PDF (a) and CDF (b) in a generic binomial test, with n = 250 , µ = n/ 2 and σ 2 = n/ 4 ( ψ = 0 ).
Fig. 7 Example of p -values PDF (a) and CDF (b) in a generic binomial test, with n = 250 , µ = n/ 2 and σ 2 = n/ 4 ( ψ = 0 ).From the PDF
Fig. 8 Comparison between F p ( p ) -p (difference between the actual CDF and the continuous uniform one, solid lines) and F ′ p ( p ) -p (difference between the approximated CDF and the continuous uniform one, dashed lines) for n = 250 , µ = n/ 2 + ψ , σ 2 = n/ 4 , in the cases: (a) ψ = 0 ; (b) ψ = 1 / 3 ; and (c) ψ = 1 / 2 .
Fig. 8 Comparison between F p ( p ) -p (difference between the actual CDF and the continuous uniform one, solid lines) and F ′ p ( p ) -p (difference between the approximated CDF and the continuous uniform one, dashed lines) for n = 250 , µ = n/ 2 + ψ , σ 2 = n/ 4 , in the cases: (a) ψ = 0 ; (b) ψ = 1 / 3 ; and (c) ψ = 1 / 2 .From the PDF
Fig. 9 Example of the p -values CDF for the Runs Test, with n = 250 and u = 1 / 2 .
Fig. 9 Example of the p -values CDF for the Runs Test, with n = 250 and u = 1 / 2 .From the PDF
Fig. 10 Comparison between the actual F ( v ) p (piece-wise constant, dotted line) and its approximation F ′ ( v ) p (continuous function, solid line) for the Runs Test, with n = 250 , u = 1 / 2 and different values of v .
Fig. 10 Comparison between the actual F ( v ) p (piece-wise constant, dotted line) and its approximation F ′ ( v ) p (continuous function, solid line) for the Runs Test, with n = 250 , u = 1 / 2 and different values of v .From the PDF
Image 11
From the PDF
Image 12
From the PDF
Image 13
From the PDF

Verification

Claims the paper makes

1 Valid · 2 Not valid · 8 Not checked · 73 Own results and interpretations

41 more claims

Create a free account to see all 84 claims and every source verdict.

See all claims — free account
  • It may state two separate claims as one. 26
  • Probably not a substantial claim. 13
  • The quote only partly states this claim. 1

Create a free account to see these claims.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Citations

Cites

Show all 29 references

Research works printed but not linked: 6

  1. 2004, Random Numbers Generation Using Quantum Physics
  2. marsaglia, 1995, The Marsaglia Random Number CD-ROM Including the DieHard Battery of Test of Randomness
  3. killmann, 2001, AIS 31 Functionality Classes and Evaluation Methodology for True (Physical) Random Number Generators
  4. schindler, 1999, AIS 20 Functionality Classes and Evaluation Methodology for Deterministic Random Number Generators
  5. coron, 1999, Public Key Cryptography Second International Workshop on Practice and Theory in Public Key Cryptography, 1560, 29
  6. shiryaev, 1995, Probability

Cited by

See all 192

Metadata

Authors
Pareschi, F., Rovatti, R., & Setti, G.
Affiliations
  • University of Ferrara (IT)
  • University of Bologna (IT)
Venue
IEEE Transactions on Information Forensics and Security
Published
2012-04
Volume
7
Issue
2
Pages
491-505
ISSN
  • 1556-6013 (ISSN-L)
  • 1556-6021
OpenAlex
W2091221194
Cited by
189
References
29
Citations by year
2026: 16 · 2025: 24 · 2024: 25 · 2023: 20 · 2022: 15 · 2021: 22 · 2020: 16 · 2019: 15 · 2018: 13 · 2017: 5 · 2016: 5 · 2015: 7 · 2014: 1 · 2013: 4
FWCI
3.67
Type
journal article
Language
en
Open access
Locations
  • IEEE Transactions on Information Forensics and Security (publishedVersion)
  • PORTO Publications Open Repository TOrino (Politecnico di Torino) (submittedVersion)
  • Archivio istituzionale della ricerca (Alma Mater Studiorum Università di Bologna) (submittedVersion)
  • PORTO@Iris (submittedVersion, other-oa)
  • Institutional Research Information System University of Ferrara (University of Ferrara) (submittedVersion)
Topics
  • Physical Sciences › Mathematics › Statistics and Probability › Probability and Statistical Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Cryptographic Implementations and Security
  • Physical Sciences › Mathematics › Discrete Mathematics and Combinatorics › Coding theory and cryptography
Keywords
NIST SP 800-22, randomness testing, pseudorandom number generators, true random number generator, p-value distribution, binomial distribution, p-value approximation, false positives, spectral test, cryptographic randomness

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

The claim verdicts this report counts are experimental: their accuracy is not yet measured.

A language model drew the claims from the paper on 2026-09-29, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).

A second model labelled each claim on 2026-09-29 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Cited sources are checked with a language model’s help (gpt-6-sol).

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

How to cite

Cite CoChat for the checks on this page, and the paper for its own findings.

This page
CoChat. (2026). Citation check: On Statistical Tests for Randomness Included in the NIST SP800-22 Test Suite and Based on the Binomial Distribution. https://app.cochat.ai/papers/10.1109/tifs.2012.2185227
The paper
Pareschi, F., Rovatti, R., & Setti, G. (2012). On Statistical Tests for Randomness Included in the NIST SP800-22 Test Suite and Based on the Binomial Distribution. IEEE Transactions on Information Forensics and Security. https://doi.org/10.1109/tifs.2012.2185227

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.