Konton in Kanji

Appendix: Results of Statistical Tests of Randomness on Konton2, RC4, and Snow2


[Back to Konton2]

Here are sample outputs from the program created by compiling and linking together KonStat2.c, Konton2.c, and snow2.c. All these tests are documented in the The Tests in KonStat2.c section of the Konton2 page. For the source code, see the Konton2 Source Code section of the Konton2 page.

KonStat2.c times each of the ciphers. These timings are useful only for comparison. The timings reported by the program are subject to inaccuracy caused by variations in system load (on systems that use preemptive multitasking), by inaccuracy of the standard C clock() function, and by several other factors.


Below are the results of a test run of four gigabytes on Konton2 with indices. In this test run, a set of 2048 keys was used with a sequence length of 2 megabytes.

The index is a 32-bit value which, along with the key, is used to initialize the state data. "Indices" like this are sometimes called "nonces." The sequences tested here were created by encrypting (in synchronous mode) 2 MB blocks of zeros with the key (and no index) and then decrypting (again, in synchronous mode) with the same key and an index. The purpose is to ensure that use of the index creates a keystream unrelated to the keystream produced without the index.

the key-generating-LCG seed = 0
the test sequence length = 2 MB
------------------------------------------------------------------------------
  Konton2 (indexed) cumulative sums, 2048 (128-byte) keys
  speed = 1612.69 KB/second
the bit runs statistic         	=    20222.40966 [MAD = 0.25][P = 0.8988]
the alt. 1 bit runs statistic  	=    20302.68693 [MAD = 0.25][P = 0.8093]
the alt. 2 bit runs statistic  	=    20441.69735 [MAD = 0.25][P = 0.5738]
the alt. 3 bit runs statistic  	=    20488.60822 [MAD = 0.25][P = 0.4817]
the alt. 4 bit runs statistic  	=    20424.31665 [MAD = 0.25][P = 0.6072]
the alt. 5 bit runs statistic  	=    20103.71974 [MAD = 0.25][P = 0.9691]^
the block bit freq. statistic  	=   525045.98114 [MAD = 0.25][P = 0.2295]
the bit frequency statistic    	=     2062.22237 [MAD = 0.25][P = 0.4082]
the tidbit frequency statistic 	=     6199.50583 [MAD = 0.25][P = 0.3067]
the nibble frequency statistic 	=    30480.57500 [MAD = 0.25][P = 0.8329]
the byte frequency statistic   	=   522936.60889 [MAD = 0.25][P = 0.2476]
the bit 0 statistic            	=     2118.70431 [MAD = 0.25][P = 0.1351]
the bit 1 statistic            	=     2020.14495 [MAD = 0.25][P = 0.6652]
the bit 2 statistic            	=     2065.57933 [MAD = 0.25][P = 0.3881]
the bit 3 statistic            	=     2111.33254 [MAD = 0.25][P = 0.1611]
the bit 4 statistic            	=     2063.13079 [MAD = 0.25][P = 0.4027]
the bit 5 statistic            	=     1991.17395 [MAD = 0.25][P = 0.8121]
the bit 6 statistic            	=     2111.74725 [MAD = 0.25][P = 0.1596]
the bit 7 statistic            	=     2023.36080 [MAD = 0.25][P = 0.6466]
the overall bit statistic      	=    16505.17392 [MAD = 0.25][P = 0.2510]
the 8-bit-sum statistic        	=    16141.72076 [MAD = 0.25][P = 0.9101]^
the 16-bit-sum statistic       	=     4125.61539 [MAD = 0.25][P = 0.3693]
the 32-bit-sum statistic       	=     4142.73632 [MAD = 0.25][P = 0.3009]
the odd/even-bit-sum statistic 	=   128469.73228 [MAD = 0.25][P = 0.8624]
the 64-bit matrix statistic    	=   521561.84619 [MAD = 0.25][P = 0.7464]
the 128-bit matrix statistic   	=   521974.97729 [MAD = 0.25][P = 0.6021]
the 256-bit matrix statistic   	=   522751.54150 [MAD = 0.25][P = 0.3082]
the 512-bit matrix statistic   	=   522534.78345 [MAD = 0.25][P = 0.3863]
the 1024-bit matrix statistic  	=   522492.96875 [MAD = 0.25][P = 0.4020]
the 2048-bit matrix statistic  	=   522310.95239 [MAD = 0.25][P = 0.4721]
the bit prediction A statistic 	=     2058.47102 [MAD = 0.25][P = 0.4310]
the bit prediction B statistic 	=     2062.22653 [MAD = 0.25][P = 0.4082]
the bit prediction C statistic 	=     2069.40171 [MAD = 0.25][P = 0.3656]
the bit prediction D statistic 	=     2111.98470 [MAD = 0.25][P = 0.1587]
the bit prediction E statistic 	=     1948.59729 [MAD = 0.25][P = 0.9416]^
the byte prediction A statistic	=     2141.59142 [MAD = 0.25][P = 0.0734]*
the byte prediction B statistic	=     2097.53174 [MAD = 0.25][P = 0.2182]
the byte prediction C statistic	=     1987.65074 [MAD = 0.25][P = 0.8269]
the byte prediction D statistic	=     1928.89694 [MAD = 0.24][P = 0.9705]^
the byte repetition statistic  	=     2034.33701 [MAD = 0.25][P = 0.5806]
the 2-byte AND statistic       	=    12158.26741 [MAD = 0.25][P = 0.7957]
the 4-byte AND statistic       	=     3939.67235 [MAD = 0.25][P = 0.9593]^
the 4-byte AND-OR statistic    	=     4040.75759 [MAD = 0.25][P = 0.7277]
the 2-byte up/down statistic   	=     4107.64848 [MAD = 0.25][P = 0.4459]
the 4-byte up/down statistic   	=    14239.23824 [MAD = 0.25][P = 0.7153]
the rect. distance statistic   	=    11973.46114 [MAD = 0.25][P = 0.9783]^
the 4-byte collision statistic 	=     2024.51017 [MAD = 0.25][P = 0.6398]
the 6-byte collision statistic 	=     2075.43490 [MAD = 0.25][P = 0.3310]
the 8-byte collision statistic 	=     1952.93385 [MAD = 0.25][P = 0.9330]^
the 12-byte collision statistic	=     2011.74423 [MAD = 0.25][P = 0.7121]
the 16-byte collision statistic	=     2021.63216 [MAD = 0.25][P = 0.6567]
the 24-byte collision statistic	=     1965.40944 [MAD = 0.25][P = 0.9028]^
the 32-byte collision statistic	=     1981.55792 [MAD = 0.25][P = 0.8506]
the 1-byte offset XOR statistic	=   521423.49707 [MAD = 0.25][P = 0.7878]
the 2-byte offset XOR statistic	=   522130.48535 [MAD = 0.25][P = 0.5424]
the 6-byte offset XOR statistic	=   522988.70264 [MAD = 0.25][P = 0.2318]
the 24-byte offset XOR stat.   	=   521546.34424 [MAD = 0.26][P = 0.7512]
the 120-byte offset XOR stat.  	=   520330.06689 [MAD = 0.25][P = 0.9693]^
the 720-byte offset XOR stat.  	=   524473.68164 [MAD = 0.25][P = 0.0145]*
the 5040-byte offset XOR stat. 	=   521717.90039 [MAD = 0.25][P = 0.6951]
the 40320-byte offset XOR stat.	=   524048.89209 [MAD = 0.25][P = 0.0385]*
the 362880-byte off. XOR stat. 	=   522728.46094 [MAD = 0.25][P = 0.3162]
the mod 3 statistic            	=     4229.79006 [MAD = 0.25][P = 0.0708]*
the mod 5 statistic            	=     8381.54531 [MAD = 0.25][P = 0.0701]*
the mod 7 statistic            	=    12434.44709 [MAD = 0.25][P = 0.1750]
the mod 11 statistic           	=    20694.63021 [MAD = 0.25][P = 0.1445]
the mod 13 statistic           	=    24565.31420 [MAD = 0.25][P = 0.5180]
the mod 17 statistic           	=    32644.57118 [MAD = 0.25][P = 0.6844]
the mod 19 statistic           	=    36860.28874 [MAD = 0.25][P = 0.5045]
the mod 23 statistic           	=    45396.77392 [MAD = 0.25][P = 0.1283]
------------------------------------------------------------------------------

Below are the results of Konton2 without indices. A set of 1024 keys were used to encrypt 2 MB blocks.

the key-generating-LCG seed = 3
the test sequence length = 2 MB
------------------------------------------------------------------------------
  Konton2 cumulative sums, 1024 (128-byte) keys
  speed = 1613.57 KB/second
the bit runs statistic         	=    10428.18696 [MAD = 0.25][P = 0.0948]*
the alt. 1 bit runs statistic  	=    10415.97134 [MAD = 0.25][P = 0.1099]
the alt. 2 bit runs statistic  	=    10340.14855 [MAD = 0.25][P = 0.2413]
the alt. 3 bit runs statistic  	=    10363.77718 [MAD = 0.24][P = 0.1932]
the alt. 4 bit runs statistic  	=    10469.63176 [MAD = 0.25][P = 0.0551]*
the alt. 5 bit runs statistic  	=    10373.62114 [MAD = 0.24][P = 0.1751]
the block bit freq. statistic  	=   260644.52240 [MAD = 0.26][P = 0.9810]^
the bit frequency statistic    	=     1144.73861 [MAD = 0.26][P = 0.0049]**
the tidbit frequency statistic 	=     3318.56898 [MAD = 0.25][P = 0.0011]**
the nibble frequency statistic 	=    15514.78165 [MAD = 0.25][P = 0.1884]
the byte frequency statistic   	=   260839.53711 [MAD = 0.25][P = 0.6507]
the bit 0 statistic            	=     1128.68571 [MAD = 0.25][P = 0.0121]*
the bit 1 statistic            	=     1054.85473 [MAD = 0.24][P = 0.2452]
the bit 2 statistic            	=     1000.66726 [MAD = 0.24][P = 0.6931]
the bit 3 statistic            	=      979.09094 [MAD = 0.25][P = 0.8395]
the bit 4 statistic            	=     1065.72724 [MAD = 0.25][P = 0.1776]
the bit 5 statistic            	=     1113.78904 [MAD = 0.25][P = 0.0260]*
the bit 6 statistic            	=     1045.89025 [MAD = 0.25][P = 0.3103]
the bit 7 statistic            	=      996.84134 [MAD = 0.25][P = 0.7227]
the overall bit statistic      	=     8385.54651 [MAD = 0.26][P = 0.0661]*
the 8-bit-sum statistic        	=     8409.60983 [MAD = 0.25][P = 0.0455]*
the 16-bit-sum statistic       	=     2079.75485 [MAD = 0.25][P = 0.3071]
the 32-bit-sum statistic       	=     2124.33973 [MAD = 0.25][P = 0.1173]
the odd/even-bit-sum statistic 	=    65194.35854 [MAD = 0.25][P = 0.0291]*
the 64-bit matrix statistic    	=   262000.55298 [MAD = 0.25][P = 0.1116]
the 128-bit matrix statistic   	=   260911.81030 [MAD = 0.26][P = 0.6130]
the 256-bit matrix statistic   	=   260619.17651 [MAD = 0.25][P = 0.7557]
the 512-bit matrix statistic   	=   260272.70532 [MAD = 0.26][P = 0.8796]
the 1024-bit matrix statistic  	=   261972.60352 [MAD = 0.26][P = 0.1191]
the 2048-bit matrix statistic  	=   260280.02368 [MAD = 0.25][P = 0.8775]
the bit prediction A statistic 	=     1088.05566 [MAD = 0.25][P = 0.0805]*
the bit prediction B statistic 	=     1105.26810 [MAD = 0.25][P = 0.0388]*
the bit prediction C statistic 	=     1031.57281 [MAD = 0.25][P = 0.4279]
the bit prediction D statistic 	=     1072.33877 [MAD = 0.26][P = 0.1431]
the bit prediction E statistic 	=     1028.92468 [MAD = 0.25][P = 0.4509]
the byte prediction A statistic	=     1015.11801 [MAD = 0.25][P = 0.5722]
the byte prediction B statistic	=     1040.16850 [MAD = 0.25][P = 0.3556]
the byte prediction C statistic	=     1011.60208 [MAD = 0.25][P = 0.6027]
the byte prediction D statistic	=     1057.95441 [MAD = 0.26][P = 0.2246]
the byte repetition statistic  	=      979.26250 [MAD = 0.26][P = 0.8386]
the 2-byte AND statistic       	=     6124.54240 [MAD = 0.25][P = 0.5674]
the 4-byte AND statistic       	=     2066.43728 [MAD = 0.26][P = 0.3830]
the 4-byte AND-OR statistic    	=     2133.76026 [MAD = 0.25][P = 0.0914]*
the 2-byte up/down statistic   	=     1988.01469 [MAD = 0.25][P = 0.8254]
the 4-byte up/down statistic   	=     7126.95629 [MAD = 0.25][P = 0.6323]
the rect. distance statistic   	=     6173.29197 [MAD = 0.25][P = 0.3936]
the 4-byte collision statistic 	=     1129.16106 [MAD = 0.26][P = 0.0118]*
the 6-byte collision statistic 	=     1068.49470 [MAD = 0.25][P = 0.1626]
the 8-byte collision statistic 	=     1056.05273 [MAD = 0.25][P = 0.2371]
the 12-byte collision statistic	=     1055.02234 [MAD = 0.25][P = 0.2440]
the 16-byte collision statistic	=     1000.95959 [MAD = 0.25][P = 0.6908]
the 24-byte collision statistic	=      961.00854 [MAD = 0.24][P = 0.9202]^
the 32-byte collision statistic	=     1007.86141 [MAD = 0.26][P = 0.6345]
the 1-byte offset XOR statistic	=   261240.21143 [MAD = 0.25][P = 0.4336]
the 2-byte offset XOR statistic	=   260454.91992 [MAD = 0.25][P = 0.8213]
the 6-byte offset XOR statistic	=   261888.59717 [MAD = 0.24][P = 0.1438]
the 24-byte offset XOR stat.   	=   261369.72998 [MAD = 0.25][P = 0.3645]
the 120-byte offset XOR stat.  	=   261046.85840 [MAD = 0.25][P = 0.5399]
the 720-byte offset XOR stat.  	=   261768.15869 [MAD = 0.25][P = 0.1848]
the 5040-byte offset XOR stat. 	=   259026.02100 [MAD = 0.24][P = 0.9982]^^
the 40320-byte offset XOR stat.	=   260627.57227 [MAD = 0.25][P = 0.7520]
the 362880-byte off. XOR stat. 	=   261446.22949 [MAD = 0.25][P = 0.3256]
the mod 3 statistic            	=     2099.03995 [MAD = 0.25][P = 0.2115]
the mod 5 statistic            	=     4059.63196 [MAD = 0.25][P = 0.6538]
the mod 7 statistic            	=     6162.06763 [MAD = 0.26][P = 0.4330]
the mod 11 statistic           	=    10345.36058 [MAD = 0.25][P = 0.2301]
the mod 13 statistic           	=    12321.10855 [MAD = 0.25][P = 0.4148]
the mod 17 statistic           	=    16274.42355 [MAD = 0.25][P = 0.7267]
the mod 19 statistic           	=    18362.99398 [MAD = 0.25][P = 0.6392]
the mod 23 statistic           	=    22718.69021 [MAD = 0.26][P = 0.1843]
------------------------------------------------------------------------------

Below are the results of a test run of two gigabytes on Konton2. In this test run, a set of 2048 keys was used with a sequence length of 2 megabytes.

the key-generating-LCG seed = 17
the test sequence length = 2 MB
------------------------------------------------------------------------------
  Konton2 cumulative sums, 2048 (128-byte) keys
  speed = 1598.90 KB/second
the bit runs statistic         	=    20284.23210 [MAD = 0.25][P = 0.8333]
the alt. 1 bit runs statistic  	=    20354.13131 [MAD = 0.25][P = 0.7323]
the alt. 2 bit runs statistic  	=    20275.43203 [MAD = 0.25][P = 0.8440]
the alt. 3 bit runs statistic  	=    20365.05204 [MAD = 0.25][P = 0.7142]
the alt. 4 bit runs statistic  	=    20286.45069 [MAD = 0.25][P = 0.8305]
the alt. 5 bit runs statistic  	=    20203.21621 [MAD = 0.25][P = 0.9147]^
the block bit freq. statistic  	=   523430.94324 [MAD = 0.25][P = 0.7986]
the bit frequency statistic    	=     2026.47255 [MAD = 0.25][P = 0.6282]
the tidbit frequency statistic 	=     6098.34694 [MAD = 0.25][P = 0.6579]
the nibble frequency statistic 	=    30839.20419 [MAD = 0.25][P = 0.3146]
the byte frequency statistic   	=   519813.99756 [MAD = 0.25][P = 0.9913]^^
the bit 0 statistic            	=     2124.06348 [MAD = 0.25][P = 0.1181]
the bit 1 statistic            	=     2049.42628 [MAD = 0.25][P = 0.4870]
the bit 2 statistic            	=     2061.80614 [MAD = 0.25][P = 0.4107]
the bit 3 statistic            	=     1907.63828 [MAD = 0.24][P = 0.9873]^
the bit 4 statistic            	=     2040.72579 [MAD = 0.25][P = 0.5412]
the bit 5 statistic            	=     2011.67674 [MAD = 0.25][P = 0.7124]
the bit 6 statistic            	=     1948.12887 [MAD = 0.24][P = 0.9425]^
the bit 7 statistic            	=     1996.16345 [MAD = 0.25][P = 0.7900]
the overall bit statistic      	=    16139.62902 [MAD = 0.25][P = 0.9120]^
the 8-bit-sum statistic        	=    16049.96366 [MAD = 0.25][P = 0.9682]^
the 16-bit-sum statistic       	=     3972.04209 [MAD = 0.25][P = 0.9156]^
the 32-bit-sum statistic       	=     4245.86383 [MAD = 0.25][P = 0.0502]*
the odd/even-bit-sum statistic 	=   128894.58231 [MAD = 0.25][P = 0.6001]
the 64-bit matrix statistic    	=   522307.45435 [MAD = 0.25][P = 0.4734]
the 128-bit matrix statistic   	=   521407.19043 [MAD = 0.25][P = 0.7924]
the 256-bit matrix statistic   	=   521295.13770 [MAD = 0.25][P = 0.8224]
the 512-bit matrix statistic   	=   521277.66992 [MAD = 0.25][P = 0.8268]
the 1024-bit matrix statistic  	=   522586.75024 [MAD = 0.25][P = 0.3670]
the 2048-bit matrix statistic  	=   522048.69263 [MAD = 0.25][P = 0.5740]
the bit prediction A statistic 	=     1946.06404 [MAD = 0.25][P = 0.9462]^
the bit prediction B statistic 	=     2099.27505 [MAD = 0.25][P = 0.2104]
the bit prediction C statistic 	=     2075.86952 [MAD = 0.25][P = 0.3286]
the bit prediction D statistic 	=     2139.86592 [MAD = 0.25][P = 0.0771]*
the bit prediction E statistic 	=     2004.98574 [MAD = 0.25][P = 0.7474]
the byte prediction A statistic	=     1996.64314 [MAD = 0.25][P = 0.7878]
the byte prediction B statistic	=     2024.45613 [MAD = 0.25][P = 0.6402]
the byte prediction C statistic	=     1985.68113 [MAD = 0.25][P = 0.8348]
the byte prediction D statistic	=     2146.24657 [MAD = 0.25][P = 0.0641]*
the byte repetition statistic  	=     2089.10944 [MAD = 0.25][P = 0.2583]
the 2-byte AND statistic       	=    12242.85219 [MAD = 0.25][P = 0.6118]
the 4-byte AND statistic       	=     4022.20669 [MAD = 0.25][P = 0.7919]
the 4-byte AND-OR statistic    	=     4136.41031 [MAD = 0.25][P = 0.3255]
the 2-byte up/down statistic   	=     4007.27209 [MAD = 0.25][P = 0.8365]
the 4-byte up/down statistic   	=    14326.53895 [MAD = 0.25][P = 0.5207]
the rect. distance statistic   	=    12409.56038 [MAD = 0.25][P = 0.2185]
the 4-byte collision statistic 	=     2155.48489 [MAD = 0.25][P = 0.0483]*
the 6-byte collision statistic 	=     2118.15135 [MAD = 0.25][P = 0.1369]
the 8-byte collision statistic 	=     2113.20108 [MAD = 0.25][P = 0.1542]
the 12-byte collision statistic	=     2168.42798 [MAD = 0.26][P = 0.0317]*
the 16-byte collision statistic	=     2007.89092 [MAD = 0.25][P = 0.7325]
the 24-byte collision statistic	=     2100.43811 [MAD = 0.25][P = 0.2053]
the 32-byte collision statistic	=     2120.94034 [MAD = 0.25][P = 0.1278]
the 1-byte offset XOR statistic	=   522336.35889 [MAD = 0.25][P = 0.4622]
the 2-byte offset XOR statistic	=   522831.01465 [MAD = 0.26][P = 0.2814]
the 6-byte offset XOR statistic	=   523284.41992 [MAD = 0.25][P = 0.1534]
the 24-byte offset XOR stat.   	=   520608.86279 [MAD = 0.25][P = 0.9449]^
the 120-byte offset XOR stat.  	=   523663.32764 [MAD = 0.25][P = 0.0819]*
the 720-byte offset XOR stat.  	=   522171.79980 [MAD = 0.25][P = 0.5263]
the 5040-byte offset XOR stat. 	=   523264.40137 [MAD = 0.26][P = 0.1581]
the 40320-byte offset XOR stat.	=   521138.07275 [MAD = 0.24][P = 0.8596]
the 362880-byte off. XOR stat. 	=   523326.58301 [MAD = 0.24][P = 0.1439]
the mod 3 statistic            	=     4149.11266 [MAD = 0.25][P = 0.2770]
the mod 5 statistic            	=     8200.07927 [MAD = 0.25][P = 0.4728]
the mod 7 statistic            	=    12137.87634 [MAD = 0.26][P = 0.8308]
the mod 11 statistic           	=    20481.32723 [MAD = 0.25][P = 0.4961]
the mod 13 statistic           	=    24750.09434 [MAD = 0.25][P = 0.2158]
the mod 17 statistic           	=    32130.13174 [MAD = 0.25][P = 0.9939]^^
the mod 19 statistic           	=    36656.38041 [MAD = 0.25][P = 0.7775]
the mod 23 statistic           	=    44725.93652 [MAD = 0.25][P = 0.8643]
------------------------------------------------------------------------------

Below are the results of a test run of two gigabytes on RC4. In this test run, a set of 1024 keys was used with a sequence length of 2 megabytes.

the key-generating-LCG seed = 0
the test sequence length = 2 MB
------------------------------------------------------------------------------
  RC4 cumulative sums, 1024 (256-byte) keys
  speed = 16765.15 KB/second
the bit runs statistic         	=    10202.35271 [MAD = 0.25][P = 0.6021]
the alt. 1 bit runs statistic  	=    10408.78426 [MAD = 0.25][P = 0.1195]
the alt. 2 bit runs statistic  	=    10328.64156 [MAD = 0.25][P = 0.2669]
the alt. 3 bit runs statistic  	=    10430.05419 [MAD = 0.25][P = 0.0927]*
the alt. 4 bit runs statistic  	=    10396.29260 [MAD = 0.26][P = 0.1376]
the alt. 5 bit runs statistic  	=    10181.47536 [MAD = 0.25][P = 0.6573]
the block bit freq. statistic  	=   261684.82886 [MAD = 0.25][P = 0.7368]
the bit frequency statistic    	=     1010.41958 [MAD = 0.25][P = 0.6128]
the tidbit frequency statistic 	=     3159.71174 [MAD = 0.26][P = 0.1320]
the nibble frequency statistic 	=    15457.10761 [MAD = 0.25][P = 0.2889]
the byte frequency statistic   	=   261260.08813 [MAD = 0.25][P = 0.4228]
the bit 0 statistic            	=     1000.25506 [MAD = 0.25][P = 0.6964]
the bit 1 statistic            	=     1041.36666 [MAD = 0.25][P = 0.3459]
the bit 2 statistic            	=     1056.41677 [MAD = 0.25][P = 0.2347]
the bit 3 statistic            	=      990.97983 [MAD = 0.25][P = 0.7651]
the bit 4 statistic            	=     1038.11757 [MAD = 0.26][P = 0.3725]
the bit 5 statistic            	=     1097.83991 [MAD = 0.25][P = 0.0538]*
the bit 6 statistic            	=      957.64241 [MAD = 0.24][P = 0.9312]^
the bit 7 statistic            	=     1099.63364 [MAD = 0.25][P = 0.0498]*
the overall bit statistic      	=     8282.25186 [MAD = 0.25][P = 0.2396]
the 8-bit-sum statistic        	=     8256.19950 [MAD = 0.25][P = 0.3066]
the 16-bit-sum statistic       	=     2107.51974 [MAD = 0.26][P = 0.1758]
the 32-bit-sum statistic       	=     1964.52865 [MAD = 0.25][P = 0.9052]^
the odd/even-bit-sum statistic 	=    64729.03131 [MAD = 0.26][P = 0.2725]
the 64-bit matrix statistic    	=   261376.28467 [MAD = 0.25][P = 0.3611]
the 128-bit matrix statistic   	=   260958.35815 [MAD = 0.25][P = 0.5882]
the 256-bit matrix statistic   	=   260716.64575 [MAD = 0.25][P = 0.7114]
the 512-bit matrix statistic   	=   261536.04346 [MAD = 0.25][P = 0.2822]
the 1024-bit matrix statistic  	=   261169.33643 [MAD = 0.25][P = 0.4724]
the 2048-bit matrix statistic  	=   261194.13989 [MAD = 0.24][P = 0.4588]
the bit prediction A statistic 	=      993.84910 [MAD = 0.25][P = 0.7448]
the bit prediction B statistic 	=     1075.18109 [MAD = 0.24][P = 0.1298]
the bit prediction C statistic 	=     1073.54992 [MAD = 0.25][P = 0.1373]
the bit prediction D statistic 	=      974.05122 [MAD = 0.24][P = 0.8659]
the bit prediction E statistic 	=      993.40350 [MAD = 0.25][P = 0.7480]
the byte prediction A statistic	=     1005.65466 [MAD = 0.25][P = 0.6529]
the byte prediction B statistic	=      954.87108 [MAD = 0.25][P = 0.9393]^
the byte prediction C statistic	=     1001.16495 [MAD = 0.25][P = 0.6892]
the byte prediction D statistic	=     1054.27770 [MAD = 0.25][P = 0.2491]
the byte repetition statistic  	=      939.43517 [MAD = 0.24][P = 0.9718]^
the 2-byte AND statistic       	=     6030.15971 [MAD = 0.24][P = 0.8479]
the 4-byte AND statistic       	=     2086.02859 [MAD = 0.25][P = 0.2739]
the 4-byte AND-OR statistic    	=     2110.96431 [MAD = 0.25][P = 0.1625]
the 2-byte up/down statistic   	=     1930.56386 [MAD = 0.24][P = 0.9686]^
the 4-byte up/down statistic   	=     7245.99411 [MAD = 0.25][P = 0.2564]
the rect. distance statistic   	=     6049.30693 [MAD = 0.25][P = 0.8031]
the 4-byte collision statistic 	=     1028.51984 [MAD = 0.25][P = 0.4544]
the 6-byte collision statistic 	=     1035.61496 [MAD = 0.24][P = 0.3934]
the 8-byte collision statistic 	=     1071.89169 [MAD = 0.25][P = 0.1453]
the 12-byte collision statistic	=     1005.65782 [MAD = 0.25][P = 0.6528]
the 16-byte collision statistic	=     1034.63773 [MAD = 0.26][P = 0.4017]
the 24-byte collision statistic	=      929.01901 [MAD = 0.24][P = 0.9843]^
the 32-byte collision statistic	=     1004.81974 [MAD = 0.25][P = 0.6597]
the 1-byte offset XOR statistic	=   259431.99512 [MAD = 0.25][P = 0.9904]^^
the 2-byte offset XOR statistic	=   262605.77637 [MAD = 0.25][P = 0.0200]*
the 6-byte offset XOR statistic	=   260474.09229 [MAD = 0.25][P = 0.8142]
the 24-byte offset XOR stat.   	=   261223.73291 [MAD = 0.25][P = 0.4426]
the 120-byte offset XOR stat.  	=   260956.25488 [MAD = 0.24][P = 0.5893]
the 720-byte offset XOR stat.  	=   260875.14355 [MAD = 0.24][P = 0.6323]
the 5040-byte offset XOR stat. 	=   262112.79590 [MAD = 0.24][P = 0.0849]*
the 40320-byte offset XOR stat.	=   261936.32129 [MAD = 0.25][P = 0.1294]
the 362880-byte off. XOR stat. 	=   259813.29688 [MAD = 0.25][P = 0.9649]^
the mod 3 statistic            	=     2038.61311 [MAD = 0.25][P = 0.5543]
the mod 5 statistic            	=     4115.74942 [MAD = 0.25][P = 0.4109]
the mod 7 statistic            	=     6135.98228 [MAD = 0.25][P = 0.5264]
the mod 11 statistic           	=    10175.70894 [MAD = 0.26][P = 0.6720]
the mod 13 statistic           	=    12434.37958 [MAD = 0.25][P = 0.1751]
the mod 17 statistic           	=    16048.13807 [MAD = 0.26][P = 0.9689]^
the mod 19 statistic           	=    18242.34860 [MAD = 0.25][P = 0.8384]
the mod 23 statistic           	=    22800.64114 [MAD = 0.25][P = 0.0998]*
------------------------------------------------------------------------------

Below are the results of a test run of two gigabytes on Snow 2.0. In this test run, a set of 1024 keys was used with a sequence length of 2 megabytes.

the key-generating-LCG seed = 0
the test sequence length = 2 MB
------------------------------------------------------------------------------
  Snow2 cumulative sums, 1024 (32-byte) keys
  speed = 13232.91 KB/second
the bit runs statistic         	=    10258.51686 [MAD = 0.25][P = 0.4467]
the alt. 1 bit runs statistic  	=    10230.59441 [MAD = 0.25][P = 0.5244]
the alt. 2 bit runs statistic  	=    10168.89696 [MAD = 0.25][P = 0.6891]
the alt. 3 bit runs statistic  	=    10338.08462 [MAD = 0.25][P = 0.2458]
the alt. 4 bit runs statistic  	=    10263.15559 [MAD = 0.25][P = 0.4339]
the alt. 5 bit runs statistic  	=    10154.09925 [MAD = 0.25][P = 0.7248]
the block bit freq. statistic  	=   263500.91083 [MAD = 0.24][P = 0.0306]*
the bit frequency statistic    	=     1033.46420 [MAD = 0.26][P = 0.4117]
the tidbit frequency statistic 	=     3106.56244 [MAD = 0.26][P = 0.3272]
the nibble frequency statistic 	=    15373.15331 [MAD = 0.25][P = 0.4686]
the byte frequency statistic   	=   260840.99268 [MAD = 0.24][P = 0.6500]
the bit 0 statistic            	=      994.05203 [MAD = 0.25][P = 0.7433]
the bit 1 statistic            	=     1058.56960 [MAD = 0.26][P = 0.2206]
the bit 2 statistic            	=     1125.43785 [MAD = 0.25][P = 0.0144]*
the bit 3 statistic            	=     1015.42984 [MAD = 0.25][P = 0.5695]
the bit 4 statistic            	=     1001.26211 [MAD = 0.25][P = 0.6884]
the bit 5 statistic            	=     1000.48465 [MAD = 0.25][P = 0.6946]
the bit 6 statistic            	=      992.27934 [MAD = 0.25][P = 0.7560]
the bit 7 statistic            	=     1024.43888 [MAD = 0.25][P = 0.4903]
the overall bit statistic      	=     8211.95429 [MAD = 0.26][P = 0.4361]
the 8-bit-sum statistic        	=     8112.57804 [MAD = 0.24][P = 0.7315]
the 16-bit-sum statistic       	=     2076.98487 [MAD = 0.25][P = 0.3223]
the 32-bit-sum statistic       	=     2082.63681 [MAD = 0.25][P = 0.2916]
the odd/even-bit-sum statistic 	=    65017.25179 [MAD = 0.24][P = 0.0800]*
the 64-bit matrix statistic    	=   261248.50684 [MAD = 0.24][P = 0.4291]
the 128-bit matrix statistic   	=   260786.23242 [MAD = 0.25][P = 0.6776]
the 256-bit matrix statistic   	=   261252.71265 [MAD = 0.25][P = 0.4268]
the 512-bit matrix statistic   	=   261450.38184 [MAD = 0.25][P = 0.3235]
the 1024-bit matrix statistic  	=   260973.85449 [MAD = 0.25][P = 0.5798]
the 2048-bit matrix statistic  	=   261390.51440 [MAD = 0.25][P = 0.3538]
the bit prediction A statistic 	=     1038.32500 [MAD = 0.25][P = 0.3708]
the bit prediction B statistic 	=      966.63241 [MAD = 0.25][P = 0.8993]
the bit prediction C statistic 	=     1032.72605 [MAD = 0.25][P = 0.4180]
the bit prediction D statistic 	=     1022.01020 [MAD = 0.25][P = 0.5117]
the bit prediction E statistic 	=     1055.77081 [MAD = 0.25][P = 0.2390]
the byte prediction A statistic	=      962.40502 [MAD = 0.25][P = 0.9154]^
the byte prediction B statistic	=      927.95662 [MAD = 0.25][P = 0.9853]^
the byte prediction C statistic	=     1089.43824 [MAD = 0.25][P = 0.0762]*
the byte prediction D statistic	=     1008.84804 [MAD = 0.25][P = 0.6262]
the byte repetition statistic  	=      965.35294 [MAD = 0.25][P = 0.9043]^
the 2-byte AND statistic       	=     6047.58401 [MAD = 0.24][P = 0.8074]
the 4-byte AND statistic       	=     2145.19898 [MAD = 0.25][P = 0.0661]*
the 4-byte AND-OR statistic    	=     2063.59349 [MAD = 0.25][P = 0.4000]
the 2-byte up/down statistic   	=     2082.10563 [MAD = 0.25][P = 0.2945]
the 4-byte up/down statistic   	=     7115.87734 [MAD = 0.25][P = 0.6667]
the rect. distance statistic   	=     6411.01190 [MAD = 0.24][P = 0.0086]**
the 4-byte collision statistic 	=     1046.75049 [MAD = 0.25][P = 0.3037]
the 6-byte collision statistic 	=     1077.12962 [MAD = 0.26][P = 0.1212]
the 8-byte collision statistic 	=     1044.52712 [MAD = 0.26][P = 0.3209]
the 12-byte collision statistic	=     1061.75975 [MAD = 0.24][P = 0.2007]
the 16-byte collision statistic	=     1064.25476 [MAD = 0.26][P = 0.1860]
the 24-byte collision statistic	=     1074.53301 [MAD = 0.25][P = 0.1328]
the 32-byte collision statistic	=     1092.66384 [MAD = 0.24][P = 0.0669]*
the 1-byte offset XOR statistic	=   261486.22705 [MAD = 0.25][P = 0.3059]
the 2-byte offset XOR statistic	=   261122.61670 [MAD = 0.25][P = 0.4982]
the 6-byte offset XOR statistic	=   262077.77832 [MAD = 0.25][P = 0.0926]*
the 24-byte offset XOR stat.   	=   260713.67529 [MAD = 0.26][P = 0.7128]
the 120-byte offset XOR stat.  	=   261652.10254 [MAD = 0.25][P = 0.2306]
the 720-byte offset XOR stat.  	=   261680.11084 [MAD = 0.25][P = 0.2190]
the 5040-byte offset XOR stat. 	=   260695.02783 [MAD = 0.25][P = 0.7216]
the 40320-byte offset XOR stat.	=   260895.05518 [MAD = 0.25][P = 0.6219]
the 362880-byte off. XOR stat. 	=   261810.94189 [MAD = 0.24][P = 0.1695]
the mod 3 statistic            	=     1962.31282 [MAD = 0.24][P = 0.9111]^
the mod 5 statistic            	=     4065.73876 [MAD = 0.25][P = 0.6285]
the mod 7 statistic            	=     6016.51162 [MAD = 0.25][P = 0.8754]
the mod 11 statistic           	=    10322.59694 [MAD = 0.25][P = 0.2809]
the mod 13 statistic           	=    12311.58841 [MAD = 0.25][P = 0.4386]
the mod 17 statistic           	=    16420.10394 [MAD = 0.25][P = 0.4196]
the mod 19 statistic           	=    18426.84891 [MAD = 0.26][P = 0.5093]
the mod 23 statistic           	=    22574.57947 [MAD = 0.26][P = 0.4120]
------------------------------------------------------------------------------

Below are the results of some of Marsaglia's and Tsang's tests of randomness on Konton2. I took the liberty of correcting some mistakes in the code for the Birthday Spacings Test. The calculation of the expected count for >=10 was wrong, and the zeroth element of an array was misused. The source code for these tests (uncorrected), is at www.csis.hku.hk/cisc/download/idetect/rng_src.zip. My suggested changes are in RNGTestPatch.txt.

The tests were run on the PRNG output from 4 keys. The keys were generated by the same truncated LCG that creates keys in KonStat2.c.

Notice the results for Maurer's test. I have never seen any generator produce a P-value for this test which not almost exactly 0.5. Is this implementation of the test faulty in some way?

#####Frequency test ( on 10000000 32-bit numbers) starts ...

### Frequency test (320000000 bits): returned value is: 0.193946


#####Maurer's test ( on 10000000 32-bit numbers) starts ...

### Maurer's universal test (32x10000000 bits): returned value is: 0.499988

#####GCD test ( 10000000 pairs of 32-bit integers) starts ...
Euclid's algorithm:
 p-value, steps to gcd:   0.389844
 p-value, dist. of gcd's: 0.646638

#####GCD ## The test is completes. Overall p is 0.3898 #####


#####Birthday spacings test ( 4096 birthdays, 2^32 days in year) starts ...
           Table of Expected vs. Observed counts:
     0     1     2     3     4     5     6     7     8     9   >=10
   91.6 366.3 732.6 976.8 976.8 781.5 521.0 297.7 148.9  66.2  40.7
    91   376   716  1011   968   776   531   292   151    55    33

#####Birthday Spacings ## The test is complete. Overall p is 0.1529 #####


#####Gorilla test starts ...
p:<b32>...<b25>| 0.6539  0.6285  0.0624  0.2553  0.1195  0.4943  0.1877  0.5743
p:<b24>...<b17>| 0.9915  0.0335  0.2535  0.8551  0.4866  0.7442  0.6822  0.3913
p:<b16>...<b 9>| 0.5513  0.0332  0.7719  0.1630  0.0253  0.5426  0.7737  0.3595
p:<b 8>...<b 1>| 0.9085  0.7205  0.5942  0.8053  0.7152  0.8406  0.5155  0.4888
#####Gorilla ## The test is completes. Overall p is 0.2221 #####


#####Collision test (No. of holes = 2^24; No. of balls = 2^24) starts ...
p:<b32>...<b25>| 0.7294  0.5795  0.9673  0.6129  0.3264  0.2847  0.4305  0.2452
p:<b24>...<b17>| 0.6903  0.5518  0.2796  0.7901  0.3466  0.5537  0.5954  0.8073
p:<b16>...<b 9>| 0.6498  0.6087  0.9620  0.7784  0.4923  0.7567  0.0893  0.5847
p:<b 8>...<b 1>| 0.5216  0.5875  0.9513  0.4379  0.0102  0.9112  0.7366  0.5341
#####Collision ## The test is completes. Overall p is 0.8915 #####



#####Frequency test ( on 10000000 32-bit numbers) starts ...

### Frequency test (320000000 bits): returned value is: 0.291666


#####Maurer's test ( on 10000000 32-bit numbers) starts ...

### Maurer's universal test (32x10000000 bits): returned value is: 0.500030

#####GCD test ( 10000000 pairs of 32-bit integers) starts ...
Euclid's algorithm:
 p-value, steps to gcd:   0.522080
 p-value, dist. of gcd's: 0.688900

#####GCD ## The test is completes. Overall p is 0.5221 #####


#####Birthday spacings test ( 4096 birthdays, 2^32 days in year) starts ...
           Table of Expected vs. Observed counts:
     0     1     2     3     4     5     6     7     8     9   >=10
   91.6 366.3 732.6 976.8 976.8 781.5 521.0 297.7 148.9  66.2  40.7
    83   369   760   919   985   787   536   305   157    61    38

#####Birthday Spacings ## The test is complete. Overall p is 0.2757 #####


#####Gorilla test starts ...
p:<b32>...<b25>| 0.2897  0.1615  0.8977  0.9833  0.9188  0.4239  0.9281  0.8605
p:<b24>...<b17>| 0.9891  0.5189  0.8545  0.2649  0.1601  0.7173  0.4102  0.0791
p:<b16>...<b 9>| 0.3141  0.8381  0.2109  0.9999  0.6451  0.5485  0.8229  0.9919
p:<b 8>...<b 1>| 0.0291  0.0844  0.3523  0.6413  0.0168  0.0577  0.1210  0.4935
#####Gorilla ## The test is completes. Overall p is 0.8346 #####


#####Collision test (No. of holes = 2^24; No. of balls = 2^24) starts ...
p:<b32>...<b25>| 0.7415  0.8963  0.5719  0.8321  0.9793  0.7460  0.1377  0.6381
p:<b24>...<b17>| 0.9023  0.8720  0.9248  0.9339  0.8489  0.8056  0.2760  0.7630
p:<b16>...<b 9>| 0.4951  0.5756  0.4339  0.3438  0.0760  0.3638  0.4097  0.4139
p:<b 8>...<b 1>| 0.5978  0.9808  0.4339  0.1664  0.5555  0.9439  0.2130  0.6254
#####Collision ## The test is completes. Overall p is 0.9471 #####



#####Frequency test ( on 10000000 32-bit numbers) starts ...

### Frequency test (320000000 bits): returned value is: 0.879324


#####Maurer's test ( on 10000000 32-bit numbers) starts ...

### Maurer's universal test (32x10000000 bits): returned value is: 0.499975

#####GCD test ( 10000000 pairs of 32-bit integers) starts ...
Euclid's algorithm:
 p-value, steps to gcd:   0.407943
 p-value, dist. of gcd's: 0.396380

#####GCD ## The test is completes. Overall p is 0.4079 #####


#####Birthday spacings test ( 4096 birthdays, 2^32 days in year) starts ...
           Table of Expected vs. Observed counts:
     0     1     2     3     4     5     6     7     8     9   >=10
   91.6 366.3 732.6 976.8 976.8 781.5 521.0 297.7 148.9  66.2  40.7
    97   344   707  1051   974   802   491   296   144    54    40

#####Birthday Spacings ## The test is complete. Overall p is 0.7702 #####


#####Gorilla test starts ...
p:<b32>...<b25>| 0.6416  0.7053  0.3359  0.4450  0.8961  0.4830  0.5438  0.0060
p:<b24>...<b17>| 0.8744  0.3749  0.3449  0.3417  0.2490  0.5381  0.3484  0.8431
p:<b16>...<b 9>| 0.7056  0.9307  0.8240  0.1773  0.1669  0.4939  0.6793  0.5660
p:<b 8>...<b 1>| 0.2158  0.1604  0.9309  0.6420  0.2014  0.7442  0.2422  0.0368
#####Gorilla ## The test is completes. Overall p is 0.0761 #####


#####Collision test (No. of holes = 2^24; No. of balls = 2^24) starts ...
p:<b32>...<b25>| 0.4736  0.4904  0.4543  0.7292  0.0486  0.7749  0.9254  0.8109
p:<b24>...<b17>| 0.8178  0.1542  0.1963  0.4636  0.8763  0.0209  0.5743  0.2082
p:<b16>...<b 9>| 0.0933  0.0739  0.8935  0.9376  0.6825  0.8901  0.1372  0.9782
p:<b 8>...<b 1>| 0.6375  0.9854  0.7754  0.6222  0.4839  0.3380  0.1019  0.0691
#####Collision ## The test is completes. Overall p is 0.4641 #####



#####Frequency test ( on 10000000 32-bit numbers) starts ...

### Frequency test (320000000 bits): returned value is: 0.878493


#####Maurer's test ( on 10000000 32-bit numbers) starts ...

### Maurer's universal test (32x10000000 bits): returned value is: 0.499929

#####GCD test ( 10000000 pairs of 32-bit integers) starts ...
Euclid's algorithm:
 p-value, steps to gcd:   0.539022
 p-value, dist. of gcd's: 0.476715

#####GCD ## The test is completes. Overall p is 0.5390 #####


#####Birthday spacings test ( 4096 birthdays, 2^32 days in year) starts ...
           Table of Expected vs. Observed counts:
     0     1     2     3     4     5     6     7     8     9   >=10
   91.6 366.3 732.6 976.8 976.8 781.5 521.0 297.7 148.9  66.2  40.7
    81   358   769   974   969   808   509   298   132    64    38

#####Birthday Spacings ## The test is complete. Overall p is 0.2389 #####


#####Gorilla test starts ...
p:<b32>...<b25>| 0.7972  0.2540  0.8292  0.6977  0.4604  0.1238  0.4396  0.5177
p:<b24>...<b17>| 0.6530  0.9937  0.4310  0.4784  0.5164  0.5833  0.2764  0.7993
p:<b16>...<b 9>| 0.1821  0.2320  0.9384  0.9043  0.6284  0.1886  0.8832  0.6919
p:<b 8>...<b 1>| 0.0280  0.9137  0.5224  0.4841  0.4228  0.0286  0.9737  0.4910
#####Gorilla ## The test is completes. Overall p is 0.3789 #####


#####Collision test (No. of holes = 2^24; No. of balls = 2^24) starts ...
p:<b32>...<b25>| 0.2094  0.0744  0.4360  0.7860  0.2132  0.7112  0.1748  0.5694
p:<b24>...<b17>| 0.8776  0.9304  0.1119  0.9707  0.6761  0.9108  0.6057  0.0936
p:<b16>...<b 9>| 0.0626  0.6434  0.2442  0.9645  0.0200  0.1342  0.6183  0.0365
p:<b 8>...<b 1>| 0.7678  0.7232  0.3565  0.7064  0.1968  0.2121  0.7770  0.6366
#####Collision ## The test is completes. Overall p is 0.4376 #####

[Back to Konton2]