-
Notifications
You must be signed in to change notification settings - Fork 102
Description
Hello everybody,
Please, I have being trying to run the entropy assessment tools in a Windows computer and I think I am having problems with the libdivsufsort library.
I got the same results on Ubuntu VMWare and Windows with the exception of the IID tests.
When running the IID test with the provided truerand_8bit.bin dataset in Windows, there is one test that gives me different results than in Ubuntu.
The results that are unexpected are:
Literal Longest Repeated Substring results: Pr(X >= 1) = -0.08935833987813369874015
Length of longest repeated substring test: Failed
This probability value should not be negative. The LRS tests passed on Ubuntu with this dataset.
Please I would like to know if anyone has a solution or has an idea of what to do to fix this problem.
I am using the following command to run the entropy estiamators:
./ea_iid.exe -i -a -vv ../bin/truerand_8bit.bin 8 > truernd8.txt
I am using MSYS2 MinGW64 to compile the programs. The only library I could not find at the msys2 repository was libdivsufsort, and this is the reason I think this is the library giving me problems. All the other libraries needed were found in https://repo.msys2.org/msys/x86_64/
I installed the last version of the libdivsufsort from the https://github.com/y-256/libdivsufsort, as suggested in the wiki/Installing-Packages.
I used the following commands to build this library:
mkdir build
cd build
cmake .. -G "MinGW Makefiles"
cmake --build .
cmake --install .
Then I moved libdivsufsort.dll, divsufsort.h, libdivsufsort.dll.a and libdivsufsort.pc to their correct places in MinGW64.
The linux /dev/urandom was also not working because it is not available on windows, so I did a modification in the seed(uint64_t *xoshiro256starstarState) function in utils.h.
There was a comment in this function suggesting the use of the builtin function RdRand, so I changed the function to:
void seed(uint64_t *xoshiro256starstarState)
{
uint64_t rand64;
int retries = 10;
int mem_elements = 4;
while(mem_elements--)
{
while(retries--)
{
if( __builtin_ia32_rdrand64_step(&rand64) != 1)
{
perror("Can't read random seed");
exit(-1);
}
}
xoshiro256starstarState[mem_elements] = rand64;
retries = 10;
}
}