# Security Analysis of the Symmetric Cryptosystem Tiny Jambu
## 5 Statistical Analysis of Randomness
### The Diehard Battery of Pseudorandomness Tests  
Random number generators only exist in nature. In practice, we have to settle with pseudorandom number generators, which are tested, and their results should not exhibit neither evidence of regularity nor evidence of a statistical distribution. At this point, we applied the Diehard battery of tests, which consists of 15 independent tests, although some of them are repeated but with distinct parameter values. Diehard tests use the chi-square goodness-to-fit technique for computing uniform \(p\)-values in the interval [0, 1); see [20,21]. In order to apply the previous tests to the TinyJambu sequences, we created a series of sequences, all of them generated using the same generator but with different choices of key, nonces, AD or plain text. From the Diehard battery, we applied the following tests:  
1. Binary Rank Test for 6 \(\times\) 8 matrices;
2. 3 DSPHERES Test;
3. Overlapping 5-permutation Test;
4. SQEEZE Test;
5. Parking lot Test;
6. Binary Rank Test for 31 \(\times\) 31 matrices;
7. Binary Rank Test for 32 \(\times\) 32 matrices;
8. Birthday spacing Test;
9. Overlapping sums Test;
10. Runs Test;
11. Craps Test;
12. Minimum distance Test. For the sake of simplicity, we considered the previous tests among the 15 proposed in the Diehard battery. Since all of these are statistical tests, it is more accurate to determine whether their results (the \(p\)-values) fall inside a determined upper and lower bound. In fact, the \(p\)-values may fluctuate but not trespass these bounds, indicating good statistical properties or good pseudorandomness characteristics. In this work, we established our boundaries in the following margins:  
\[0.03<p\text{-values}<0.97\]  
Figure 8: Fast Fourier Transform (FFT) representation for a TinyJambu sequence of 120,000 bits, where all the harmonics exhibit approximately the same amplitude. Sequences with \(p\)-values greater or lower than these bounds were said to exhibit poor pseudorandomness [27; 28]. At this point, we applied the Diehard battery of tests to a series of sequences generated using TinyJambu. The following results are for tests 1-4, and they are depicted in Figure 9:  
1. Binary Rank Test for 6 \(\times\) 8 matrices: sequence_5 and sequence_10 showed a slightly higher \(p\)-value than the established upper bound. 2. 3 DSPHERES Test: only sequence_11 exhibited a \(p\)-value lower than the bound, which means a slightly deficient pseudorandomness. 3. Overlapping 5-permutation Test: here, the \(p\)-values were too low for sequences 1 and 2, showing poor pseudorandomness characteristics. 4. SQEEZE TEST: all sequences passed this test satisfactorily. Next, the following results are for tests 5-8, and they are depicted in Figure 10:  
5. Parking lot Test: sequence_6 slightly surpassed the upper bound, which indicates a slight deficiency in pseudorandomness. 6. Binary Rank Test for 31 \(\times\) 31 matrices: all sequences showed good pseudorandomness characteristics. 7. Binary Rank Test for 32 \(\times\) 32 matrices: all sequences showed good pseudorandomness characteristics. 8. Birthday spacing Test: all sequences exhibited good pseudorandom characteristics, although sequence_6 was near the bound. For tests 9-12, Figure 11 shows the results, and the results are as follows:  
9. Overlapping sums Test: all sequences exhibited \(p\)-values within the boundaries. 10. Runs Test: all sequences showed good pseudorandomness characteristics. 11. Craps Test: all sequences showed good pseudorandomness characteristics. 12. Minimum distance Test: all sequences showed good pseudorandomness characteristics, except for sequence_7, which showed a poorer pseudorandomness. Figure 9: This figure shows the results of the first four DIEHARD tests applied to sequences_1 up to sequence_15. As we have seen from the above results, in general, the TinyJambu sequences pass the tests. Some sequences exhibit \(p\)-values beyond the boundaries for any test.