Code Monkey home page Code Monkey logo

nist-statistical-test-suite's Issues

Universal test failure?

Hi,

I noticed there is one failure in your sample report, but it's not supposed to be there for data/data.pi? maybe a wrong parameter configuration?
10 0 0 0 0 0 0 0 0 0 0.000000 * 0/10 * Universal

LinearComplexity

why LinearComplexity test so slow,is there any way to optimize

I have error of Running the Test Code

I'm doing README.md.
I have a trouble for "Sample run for known input".

./assess 100000
Enter Choice : 0
User Prescribed Input File: data/data.pi
Enter Choice: 1
Select Test (0 to continue): 0

After Select Test (0 to continue): 0, I get the following error:
ERROR: LOG FILES COULD NOT BE OPENED.
MAX # OF OPENED FILES HAS BEEN REACHED = 0
-OR- THE OUTPUT DIRECTORY DOES NOT EXIST.

My environment is
OS : Ubuntu20.04 on wsl2 on windows10 Pro

Could you help me?

image

Error about 2.6.8 Example

Hello. I think there is some kind of error during applying 2.6.8 Example.

According to 2.6.8 Example, Page 36 of NIST SP800-22 Revision 1a.

input

epsilon = "1100100100001111110110101010001000100001011010001100001000110100110001001100011001100010100010111000"

in C form

double X[] = {1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1};

Total length

n = 100

in Paper, N_1 = 46 (correct answer)
However this source code gave me N_1 = 48 not 46.
(And also, In my implementation, N_1 = 48 seems to correct)

I checked that DFT(this code used Fast Fourier Transform but whatever.) function is correct. (with cross-check source code, matlab, my implementation of page 69 DFT equation, online Discrete Fourier Transform (DFT) Calculator).

Question

Please tell me what is error? Paper's example is wrong? or source code is wrong?
the only thing I doubt is "the actual observed number of peaks" in 2.6.4 Test Description (6)
In this code, it doesn't look count peaks as statistical definition.

below is my code that for testing DFT, almost same as ./sts/src/discreteFourierTransform.c

int main() {
    double	p_value, upperBound, percentile, N_l, N_o, d, *m = NULL, *wsave = NULL;
	int		i, count, ifac[15];

    int n = 100;
    wsave = (double *)calloc(2*n,sizeof(double));
    m = (double*)calloc(n/2+1, sizeof(double));

    double X[] = {1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1};

	__ogg_fdrffti(n, wsave, ifac);		/* INITIALIZE WORK ARRAYS */
	__ogg_fdrfftf(n, X, wsave, ifac);	/* APPLY FORWARD FFT */

	m[0] = sqrt(X[0]*X[0]);	    /* COMPUTE MAGNITUDE */
	
	for ( i=0; i<n/2; i++ )
		m[i+1] = sqrt(pow(X[2*i+1],2)+pow(X[2*i+2],2)); 
	count = 0;				       /* CONFIDENCE INTERVAL */
	upperBound = sqrt(2.995732274*n);
	for ( i=0; i<n/2; i++ )
		if ( m[i] < upperBound )
			count++;
	percentile = (double)count/(n/2)*100;
	N_l = (double) count;       /* number of peaks less than h = sqrt(3*n) */
	N_o = (double) 0.95*n/2.0;
	d = (N_l - N_o)/sqrt(n/4.0*0.95*0.05);
	p_value = erfc(fabs(d)/sqrt(2.0));
	printf("N_l\t: %lf\n", N_l);
	printf("N_o\t: %lf\n", N_o);
	printf("d\t: %lf\n", d);
	printf("p_value\t: %lf\n", p_value);
        // Returns
        /*
        N_l        : 48.000000
        N_o       : 47.500000
        d           : 0.458831
        p_value : 0.646355
        */
}

Input file format

Hi,
I'd like to test whether the sequence of data is random (Float32 datatype). Could you please tell me what the NIST test input format should be? In the command ''./assess datastream>'', what should be the value of datastream?
My data looks like this: {1.2,1.3,1.2,1.6,.....}

I took a look at the sample 'data.pi' files, but it was not clear.

Regards,
Nivedita

Add pdf

The document is not part of the source download, and is also offline.

Problem on running the tests.

First of all, thank you for your work.

I am facing a problem when I try to run any tests, even the example test you gave on the README. The program gets stuck at line 388 of utilities.c, and then stops the execution.

ERROR: LOG FILES COULD NOT BE OPENED.
MAX # OF OPENED FILES HAS BEEN REACHED = 0
-OR- THE OUTPUT DIRECTORY DOES NOT EXIST.

What could it be?

I found the "Out of Bound" Error in discreteFourierTransform.c

And also I found the "Out of Bound" Error in for loop which is in line 41~42 ./sts/src/discreteFourierTransform.c

for ( i=0; i < n/2; i++ )
    m[i+1] = sqrt(pow(X[2*i+1],2)+pow(X[2*i+2],2));

This line will cause unexpected behavior.
Let's think n = 10, then maximum i will be 4. because i < 10/2
2 * i + 2 = 2 * 4 + 2 = 10 then, but, the range of X is [0, 9] So, this is out of bound.


As far as I know, this is out of bound. And also in C, X[n] would be un-initialized value. (It could be dump variable)
Is there any reason that I don't know C grammer?

Originally posted by @TyeolRik in #9 (comment)

How many bitstreams?

Could you help me to explain the question "How many bitstreams?". Because we already initialize the parameter of bitstream length ./assess 100000.

I don't understand why we have to again initialize the bitstreams during this process? what does it mean and what for?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.