• Keine Ergebnisse gefunden

5.3 Deterministic Pseudo-Random Number Generator

5.3.3 Randomness Evaluation using NIST Test Suite

The special publication of NIST [43] provides 15 statistical tests that shall be applied to a binary sequence to perform the evaluation and comparison of it to a truly random sequence. The tests examine the sequence looking for some defined sub-sequences or patterns whose presence means that the sequence is non-random. In this thesis the NIST testing suite was used to test the randomness of the binary sequences produced by the proposed deterministic solution. For the randomness assessment of the proposed approach 1000 binary sequences, each 1000000-bit long, were generated.

The NIST testing suite provides a set of statistical tests assessing the ran-domness of an evaluated sequence. The sequence consists of zeros and ones that represent the binary form of the numbers. The aim of a statistical test is to assess the probability that the null hypothesis (H0) is fulfilled, where H0 means that the sequence is random. Each test is focused on checking a different property of the sequence in order to test the H0 and either accepts or rejects it. For this purpose in each test the randomness statistic is used. The randomness statis-tic has a distribution of possible values, and mathemastatis-tical methods determine the reference distribution for it. The reference distribution allows computing a critical value, which determines the boundary between those samples resulting in a randomness statistic that leads to rejecting the H0 and those that lead to accepting the H0. For a given sequence the test statistic value is computed and if it is bigger than the critical value, the H0 is rejected. On the basis of the test statistic thePvalues is computed. The method for computing thePvalues is chosen for each test independently and a special function is used for this purpose. It can be for example the error function or the gamma function. It is the probability, that a perfect random number generator would have produced a sequence less random than the sequence that was tested. If the Pvalues = 1 then the sequence appears to be random. For the NIST test suite the Pvalues has to be larger than 0.01 to accept the null hypothesis. The numberα= 0.01 is called the significance level.

The following tests are part of the NIST Testing Suite:

ˆ Frequency (Monobit) Test: checks if the proportion of zeros and ones in the sequence is about the same and compares it to the values expected from the truly random sequence. The next tests depend on passing this test.

ˆ Frequency Test within a Block: checks if the proportion of ones in the M-bit block is about M/2, what is expected from truly random sequence.

5.3. DETERMINISTIC PSEUDO-RANDOM NUMBER GENERATOR 79

ˆ Runs Test: determines the number of runs in the sequence, where a run is a subsequence consisting of identical bits and bounded with bits of opposite value. The number of runs having various lengths is compared with values expected from truly random sequence.

ˆ Test for the Longest Run of Ones in a Block: checks if the length of the longest run of ones in the sequence is compared to the length of the runs of ones in the truly random sequence.

ˆ Binary Matrix Rank Test: checks for linear dependence among fixed length sub-strings of the original sequence, [43].

ˆ Discrete Fourier Transform (Spectral) Test: detects the periodicities (peaks), e.g. repetition of patterns that are near to each other.

ˆ Non-overlapping Template Matching Test: detects if the sequence contains too many given non-periodic m-bit patterns. For the detection the m-bit window corresponding to the non-periodic pattern is used. The window slides bit by bit as long as the pattern is found and after that the window is reset to the bit after the pattern and the search resumes.

ˆ Overlapping Template Matching Test: determines the number of occur-rences of the given pattern. This test also uses m-bit window to find the pattern and the widow slides bit by bit as long as the pattern is found.

After that the window slides one bit and the search resumes.

ˆ Maurer’s Universal Statistical Test: computes the number of bits between the same patterns, where the number is the measure related to the length of the sequence after compression. The test detects if the sequence can be compressed without loss of information, what implies the sequence to be non-random.

ˆ Linear Complexity Test: measures the length if a linear feedback shift reg-ister. When the computed value is too short it implies non-randomness of the sequence.

ˆ Serial Test: checks the frequency of all possible m-bit patterns in the se-quence. If the probability that a given m-bit sequence is comparable with the probabilities of other m-bit patterns, the sequence appears to be ran-dom.

ˆ Approximate Entropy Test: compares the frequency of overlapping blocks of two consecutive/adjacent lengths (m and m+1) against the expected result for a random sequence, [43].

80 CHAPTER 5. LMRNG: PSEUDO-RANDOM NUMBER GENERATOR

ˆ Cumulative Sums (Cusum) Test: computes the cumulative sum of adjusted digits in the sequence, using (−1,+1). This value is then compared to the one expected from the random sequence. The cumulative sum may be considered as a random walk. For a random sequence, the excursions of the random walk should be near zero, [43]

ˆ Random Excursion Test: computes the number of cycles with K visits in cumulative sum random walk. A cycle of a random walk consists of a sequence of steps of unit length taken at random that begin at and return to the origin. The purpose of this test is to determine if the number of visits to a particular state within a cycle deviates from what one would expect for a random sequence, [43]

ˆ Random Excursion Variant Test: detect deviations from the expected num-ber of visits to various states in the random walk, [43]

After the binary sequences have been tested, there are two approaches for interpreting the empirical test results. In the first approach the proportion of the sequences that passed the test, i.e. having Pvalues >0.01 is computed. The proportion is computed on the basis of the number of sequences to be tested and the sequences that passed the test. Let 1000 be the first number, and 998 the second one. Then the proportion is equal to 0.998 and the range of acceptable proportions is computed using the formula:

(1−α)±3

r(1−α)α

m (5.9)

wheremis the sample size andαis the significance level. Thus, for 1000 sequences the proportion should be larger than 0.9805607. In the second approach the distribution of the Pvalues is determined in order to check the uniformity. For that the PU values of all the Pvalues is computed. ThePU values is computed using the special function as defined in the NIST suite. If PU values ≤0.0001, then the Pvalues can be considered to be uniformly distributed.

Evaluation Results

Table5.2 and Table5.3 present the results of NIST tests performed on the ran-dom bit streams generated by the proposed pseudo-ranran-dom number generator.

For the 1000 tested sequences, the proportion of passed tests should be larger than 0.9805607. All the tests were passed, what means that proposed approach generates pseudo-random numbers.