#ifndef _NIST_DEFS_H_ #define _NIST_DEFS_H_ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * D E B U G G I N G A I D E S * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "config.h" /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * M A C R O S * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #define MAX(x,y) ((x) < (y) ? (y) : (x)) #define MIN(x,y) ((x) > (y) ? (y) : (x)) #define isNonPositive(x) ((x) <= 0.e0 ? 1 : 0) #define isPositive(x) ((x) > 0.e0 ? 1 : 0) #define isNegative(x) ((x) < 0.e0 ? 1 : 0) #define isGreaterThanOne(x) ((x) > 1.e0 ? 1 : 0) #define isZero(x) ((x) == 0.e0 ? 1 : 0) #define isOne(x) ((x) == 1.e0 ? 1 : 0) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * G L O B A L C O N S T A N T S * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #define ALPHA 0.01 /* SIGNIFICANCE LEVEL */ #define MAXNUMOFTEMPLATES 148 /* APERIODIC TEMPLATES: 148=>temp_length=9 */ #define NUMOFGENERATORS 10 /* MAX PRNGs */ #define MAXFILESPERMITTEDFORPARTITION 148 #define TEST_FREQUENCY 1 #define TEST_BLOCK_FREQUENCY 2 #define TEST_CUSUM 3 #define TEST_RUNS 4 #define TEST_LONGEST_RUN 5 #define TEST_RANK 6 #define TEST_FFT 7 #define TEST_NONPERIODIC 8 #define TEST_OVERLAPPING 9 #define TEST_UNIVERSAL 10 #define TEST_APEN 11 #define TEST_RND_EXCURSION 12 #define TEST_RND_EXCURSION_VAR 13 #define TEST_SERIAL 14 #define TEST_LINEARCOMPLEXITY 15 #define TEST_POKER_DETECT 16 #define TEST_RUNS_DISTRIBUTION 17 #define TEST_BIN_DERIVATE 18 #define TEST_SELF_CORR 19 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * G L O B A L D A T A S T R U C T U R E S * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ typedef unsigned char BitSequence; typedef struct _testParameters { int n; int blockFrequencyBlockLength; int nonOverlappingTemplateBlockLength; int overlappingTemplateBlockLength; int serialBlockLength; int linearComplexitySequenceLength; int approximateEntropyBlockLength; int PokerDetectMLength; int BinaryDerivateKLength; int SelfCorrelationDLength; int numOfBitStreams; } TP; #endif