|
1 /* |
|
2 * Portions Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * The original NIST Statistical Test Suite code is placed in public domain. |
|
16 * (http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html) |
|
17 * |
|
18 * This software was developed at the National Institute of Standards and Technology by |
|
19 * employees of the Federal Government in the course of their official duties. Pursuant |
|
20 * to title 17 Section 105 of the United States Code this software is not subject to |
|
21 * copyright protection and is in the public domain. The NIST Statistical Test Suite is |
|
22 * an experimental system. NIST assumes no responsibility whatsoever for its use by other |
|
23 * parties, and makes no guarantees, expressed or implied, about its quality, reliability, |
|
24 * or any other characteristic. We would appreciate acknowledgment if the software is used. |
|
25 */ |
|
26 |
|
27 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|
28 D E B U G G I N G A I D E S |
|
29 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
|
30 #ifndef _DEFS_H_ |
|
31 #define _DEFS_H_ |
|
32 |
|
33 #include "config.h" |
|
34 |
|
35 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|
36 M A C R O S |
|
37 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
|
38 |
|
39 #define MAX(x,y) ((x) < (y) ? (y) : (x)) |
|
40 #define MIN(x,y) ((x) > (y) ? (y) : (x)) |
|
41 #define isNonPositive(x) ((x) <= 0.e0 ? 1 : 0) |
|
42 #define isPositive(x) ((x) > 0.e0 ? 1 : 0) |
|
43 #define isNegative(x) ((x) < 0.e0 ? 1 : 0) |
|
44 #define isGreaterThanOne(x) ((x) > 1.e0 ? 1 : 0) |
|
45 #define isZero(x) ((x) == 0.e0 ? 1 : 0) |
|
46 #define isOne(x) ((x) == 1.e0 ? 1 : 0) |
|
47 |
|
48 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|
49 G L O B A L C O N S T A N T S |
|
50 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
|
51 |
|
52 #define ALPHA 0.01 /* SIGNIFICANCE LEVEL */ |
|
53 #define MAXNUMOFTEMPLATES 148 /* APERIODIC TEMPLATES: 148=>temp_length=9 */ |
|
54 #define NUMOFTESTS 15 /* MAX TESTS DEFINED */ |
|
55 #define NUMOFGENERATORS 11 /* MAX PRNGs */ |
|
56 #define MAXFILESPERMITTEDFORPARTITION 148 |
|
57 #define TEST_FREQUENCY 1 |
|
58 #define TEST_BLOCK_FREQUENCY 2 |
|
59 #define TEST_CUSUM 3 |
|
60 #define TEST_RUNS 4 |
|
61 #define TEST_LONGEST_RUN 5 |
|
62 #define TEST_RANK 6 |
|
63 #define TEST_FFT 7 |
|
64 #define TEST_NONPERIODIC 8 |
|
65 #define TEST_OVERLAPPING 9 |
|
66 #define TEST_UNIVERSAL 10 |
|
67 #define TEST_APEN 11 |
|
68 #define TEST_RND_EXCURSION 12 |
|
69 #define TEST_RND_EXCURSION_VAR 13 |
|
70 #define TEST_SERIAL 14 |
|
71 #define TEST_LINEARCOMPLEXITY 15 |
|
72 |
|
73 |
|
74 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|
75 G L O B A L D A T A S T R U C T U R E S |
|
76 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
|
77 |
|
78 typedef unsigned char BitSequence; |
|
79 |
|
80 typedef struct _testParameters { |
|
81 int n; |
|
82 int blockFrequencyBlockLength; |
|
83 int nonOverlappingTemplateBlockLength; |
|
84 int overlappingTemplateBlockLength; |
|
85 int serialBlockLength; |
|
86 int linearComplexitySequenceLength; |
|
87 int approximateEntropyBlockLength; |
|
88 int numOfBitStreams; |
|
89 } TP; |
|
90 |
|
91 #endif // _DEFS_H_ |
|
92 |