I am doubting the file format (I am using ASCII when using the test suite). However, is it correct to save them directly as a text file from MATLAB or should some special characters be used for the test suite to recognize them as ASCII format?
According to the nice manual §5.4.1
Files should contain binary sequences stored as either ASCII characters consisting of zeroes and ones, or as binary data where each byte contains eight bits worth of 0’s and 1’s.
Further, looking at readBinaryDigitsInASCIIFormat
in src/utilities.c
shows that whitespace is ignored when using the ASCII format.
Thus if a text editor shows that the files consist of 0
, 1
, space/tabs/newline only, their format should be probably OK for the ASCII setting.
I use ./assess 500000
with 40 bit streams. (…) Also tried ./assess 1000000
with 20 bit streams
It's told, e.g. at §2.14.7, that at least 1000000 bits per sequence is recommended for some tests (but we don't know which are run).
It keeps give me an error of igamc: underflow
That's generated by an internal function cephes_igamc
in src/utilities.c
computing the incomplete gamma function, as an input sanity check.
The most likely cause is that at at least one sequence tested fails extremely badly at least one of the tests that are run. It would be a good idea to restrict to the frequency/monobit test at first (which result can be manually checked from the line like BITSREAD = 1000000 0s = 500712 1s = 199288
in the diagnostic), and then try other tests to find which fails.
Another possible cause is that the test suite is miscompiled or misused. That can be diagnosed by using the 4 sequences data/data.sqrt3
data/data.sqrt2
data/data.pi
data/data.e
which should not cause this error for any of the tests.
Short for miscompilation or misuse (including but not limited to a not long enough sequence), the reported failure can be interpreted as a practical certainty that the sequence tested is not random.
WARNING: Failing the NIST test (consistently, or ever with igamc: underflow
) shows that the generator is bad or not tested correctly. But passing that test is NOT in itself a valid argument that a bit generator is suitable for cryptographic use. If an argument for the later assertion is needed, consider that a generator that outputs the binary representation of the square root of any small odd integer >2 passes the tests.