P. 1
NIST: Statistical Test Suite for Random and Pseudo-Random

NIST: Statistical Test Suite for Random and Pseudo-Random

4.8

|Views: 2,439|Likes:
Published by Kevin G. Rhoads
US Federal Government publication -- a group of statistical tests for randomness for the purposes of evaluating RNG and PRNG (Random Number Generators and Pseudo-Random Number Generators)

NIST - National Institute of Science and Technology (Formerly NBS, National Bureau of Standards) provides technical standards and metrology expertise to the the Department of Commerce and interested parties outside the governement

As a publication of the Federal Government, there is no copyright within the US of A (I am unsure about status outside US of A)

Together with George Marsaglia's DIEHARD test suite, this provides the means for an extremely thorough evaluation of RNGs and PRNGs.
US Federal Government publication -- a group of statistical tests for randomness for the purposes of evaluating RNG and PRNG (Random Number Generators and Pseudo-Random Number Generators)

NIST - National Institute of Science and Technology (Formerly NBS, National Bureau of Standards) provides technical standards and metrology expertise to the the Department of Commerce and interested parties outside the governement

As a publication of the Federal Government, there is no copyright within the US of A (I am unsure about status outside US of A)

Together with George Marsaglia's DIEHARD test suite, this provides the means for an extremely thorough evaluation of RNGs and PRNGs.

More info:

Published by: Kevin G. Rhoads on Jan 24, 2009
Copyright:Public Domain

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/21/2015

pdf

text

original

125

Example #2: The binary expansion of e

Statistical Test

P-value

Frequency

0.953749

Block Frequency (m = 100)

0.619340

Cusum-Forward

0.669887

Cusum-Reverse

0.724266

Runs

0.561917

Long Runs of Ones (M = 10000)

0.718945

Rank

0.306156

Spectral DFT

0.443864

NonOverlapping Templates (m = 9, B = 000000001)

0.078790

Overlapping Templates (m = 9)

0.110434

Universal (L = 7, Q = 1280)

0.282568

Approximate Entropy (m = 5)

0.361688

Random Excursions (x = +1)

0.778616

Random Excursions Variant (x = -1)

0.826009

Lempel Ziv Complexity

0.000322

Linear Complexity (M = 500)

0.826335

Serial (m = 5,

2

m

Ψ

)

0.225783

Example #3: A G-SHA-1 binary sequence

Statistical Test

P-value

Frequency

0.604458

Block Frequency (m = 100)

0.833026

Cusum-Forward

0.451231

Cusum-Reverse

0.550134

Runs

0.309757

Long Runs of Ones (M = 10000)

0.657812

Rank

0.577829

Spectral DFT

0.086702

NonOverlapping Templates (m = 9, B = 000000001)

0.496601

Overlapping Templates (m = 9)

0.339426

Universal (L = 7, Q = 1280)

0.411079

Approximate Entropy (m = 5)

0.731449

Random Excursions (x = +1)

0.000000

Random Excursions Variant (x = -1)

0.000000

Lempel Ziv Complexity

0.398475

Linear Complexity (M = 500)

0.309412

Serial (m = 5,

2

m

Ψ

)

0.742275

126

Example #4: The binary expansion of 2

Statistical Test

P-value

Frequency

0.811881

Block Frequency (m = 100)

0.289410

Cusum-Forward

0.879009

Cusum-Reverse

0.957206

Runs

0.313427

Long Runs of Ones (M = 10000)

0.012117

Rank

0.823810

Spectral DFT

0.267174

NonOverlapping Templates (m = 9, B = 000000001)

0.569461

Overlapping Templates (m = 9)

0.791982

Universal (L = 7, Q = 1280)

0.130805

Approximate Entropy (m = 5)

0.853227

Random Excursions (x = +1)

0.216235

Random Excursions Variant (x = -1)

0.566118

Lempel Ziv Complexity

0.949310

Linear Complexity (M = 500)

0.317127

Serial (m = 5,

2

m

Ψ

)

0.873914

Example #5: The binary expansion of 3

Statistical Test

P-value

Frequency

0.610051

Block Frequency (m = 100)

0.573925

Cusum-Forward

0.917121

Cusum-Reverse

0.689519

Runs

0.261123

Long Runs of Ones (M = 10000)

0.446726

Rank

0.314498

Spectral DFT

0.463412

NonOverlapping Templates (m = 9, B = 000000001)

0.532235

Overlapping Templates (m = 9)

0.082716

Universal (L = 7, Q = 1280)

0.165981

Approximate Entropy (m = 5)

0.404616

Random Excursions (x = +1)

0.783283

Random Excursions Variant (x = -1)

0.155066

Lempel Ziv Complexity

0.989651

Linear Complexity (M = 500)

0.346469

Serial (m = 5,

2

m

Ψ

)

0.100780

127

For the purposes of executing the Non-overlapping Template Matching statistical test, all 2m

m-

bit binary sequences which are aperiodic were pre-computed. These templates, or patterns, were
stored in a file for m = 2 to m = 21. The ANSI-C program utilized in finding these templates is
provided below. By modifying the parameter M, the template library corresponding to the
template can be constructed. This parameter value should not exceed B, since the dec2bin
conversion routine will not operate correctly. Conceivably, this source code can be easily
modified to construct arbitrary 2m

m-bit binary sequences for larger m.

#include
#include

#define B 32
#define M 6

int *A;
static long nonPeriodic;
unsigned displayBits(FILE*, long, long);

int main()
{

FILE *fp1, *fp2;
long i, j, count, num;

A = (unsigned*) calloc(B,sizeof(unsigned));
fp1 = fopen("template", "w");
fp2 = fopen("dataInfo", "a");
num = pow(2,M);
count = log(num)/log(2);
nonPeriodic = 0;
for(i = 1; i < num; i++) displayBits(fp1, i,count);
fprintf(fp2,"M = %d\n", M);
fprintf(fp2,"# of nonperiodic templates = %u\n",
nonPeriodic);
fprintf(fp2,"# of all possible templates = %u\n", num);
fprintf(fp2,"{# nonperiodic}/{# templates} = %f\n",
(double)nonPeriodic/num);
fprintf(fp2,"==========================================");
fprintf(fp2,"===============\n");
fclose(fp1);
fclose(fp2);
free(A);
return 0;

}

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->