On 07.05.17 08:25, Richard Outerbridge wrote:
On 2017-05-01 18:46:34 +0000, Karl.Frank said:
I have uploaded a short ANSI-C source code that can test the output of
any PRNG using the TESTU01 test battery by reading in 32bit values from
STDIN.
This is pretty handy, especially if one already has TestU01 installed.
The only suggestion I have is to add a warning about how many samples are required for each test: the tests will always fail without enough input.
For example, in my own testing I found that the SmallCrush test consumed 226969476 32-bit samples; the Crush test wanted 33842890314; and the
BigCrush
test chewed through 357112958428 32-bit samples.
Otherwise, pretty neat. Thanks.
__outer
Many thanks for you kind feedback, I'm pleased that you find it useful.
The problem you mentioned on how many samples to pipe in is not an easy
to estimate parameter. In the source code examples I suggested that one
should at least pass 4294967294 (0xfffffffe) samples
./LCG_stdio 0x2ddd6a2c 0xfffffffe | ./TestU01_stdin -s
But I figured out right now that even 72057594037927934 samples are not
enough if you run the Crush test on the sample LCG_stdio. After quite a
while TestU01 will get stuck with the error
./C_Rand_stdio 0x2ddd6a2c 0xfffffffffffffe | ./TestU01_stdin -c
[...]
32-bit stdin
snpair_ClosePairs test:
-----------------------------------------------
N = 10, n = 2000000, r = 0, t = 2, p = 0, m = 30, Torus = TRUE
********* WARNING in file snpair.c on line 294
********* res->NumClose > 50000
As it sems a PRNG that will not survice the SmallCrush is not worth a
Crush test run, let alone BigCrush.
Although this Crush test got through
./bcd32_keystream 2ddd6a2c 0xfffffffffffffe | ./TestU01_stdin -c
finished processing and analysing 33842649805 samples.
If have added a sample counter to the source TestU01_stdin.c so finally
one can read how many samples actually were needed for a certain PRNG
and test run.
Depending on the implementation of RAND for example one might get
different amounts of samples, like this summary below show
========= Summary results of SmallCrush =========
(x86_64)
========
./C_Rand_stdio 0x2ddd6a2c 0xfffffffe | ./TestU01_stdin -s
Total processed 32Bit Samples = 226934364
./LCG_stdio 0x2ddd6a2c 0xfffffffe | ./TestU01_stdin -s
Total processed 32Bit Samples = 218199913
./bcd32_keystream 2ddd6a2c 0xfffffffe | ./TestU01_stdin -s
Total processed 32Bit Samples = 226901346
(i686)
======
./C_Rand_stdio 0x2ddd6a2c 0xfffffffe | ./TestU01_stdin -s
Total processed 32Bit Samples = 226792340
./LCG_stdio 0x2ddd6a2c 0xfffffffe | ./TestU01_stdin -s
Total processed 32Bit Samples = 218199913
./bcd32_keystream 2ddd6a2c 0xfffffffe | ./TestU01_stdin -s
Total processed 32Bit Samples = 226901346
In regards of installing TestU01 in the first place I have added some
very basic instruction on top of the updated source code, which
essentially read
Compile Instructions
=====================
unzip TestU01.zip
cd TestU01-1.2.3/
./configure --prefix=/opt/testu01/
make && make install
now add to your ~/.profile or ~/.bashrc
# TestU01
export LD_LIBRARY_PATH=/opt/testu01/lib:${LD_LIBRARY_PATH}
export LIBRARY_PATH=/opt/testu01/lib:${LIBRARY_PATH}
export C_INCLUDE_PATH=/opt/testu01/include:${C_INCLUDE_PATH}
now activate by
source ~/.profile or ~/.bashrc
I prefer /opt/testu01/ as prefix because in case I'd like to delete
TestU01 for same reason later I need just remove the testu01 folder in /opt
By the way, on which PRNG did you perform the test runs?
Did it survive SmallCrush, Crush and BigCrush?
Updated source code over here
http://www.freecx.co.uk/crypto/cryptanalysis/TestTools/TestU01/
or here
http://paste.debian.net/931418
Cheers,
Karl-Uwe
--
cHNiMUBACG0HAAAAAAAAAAAAAABIZVbDdKVM0w1kM9vxQHw+bkLxsY/Z0czY0uv8/Ks6WULxJVua zjvpoYvtEwDVhP7RGTCBVlzZ+VBWPHg5rqmKWvtzsuVmMSDxAIS6Db6YhtzT+RStzoG9ForBcG8k G97Q3Jml/aBun8Kyf+XOBHpl5gNW4YqhiM0=
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)