wangyi-fudan / wyhash

The FASTEST QUALITY hash function, random number generators (PRNG) and hash map.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WyRand64 (bit reversed) fails PractRand at 32TB

vigna opened this issue · comments

rng=WyRand64-rev, seed=0x7cb0345e
length= 32 terabytes (2^45 bytes), time= 2032274 seconds
  Test Name                         Raw       Processed     Evaluation
  [Low1/8]BCFN(0+0,13-0,T)          R= +12.9  p =  1.9e-6   mildly suspicious
  [Low8/32]Gap-16:B                 R=  +5.8  p =  6.6e-5   unusual
  [Low8/64]BCFN(0+9,13-0,T)         R= +12.3  p =  4.1e-6   unusual
  [Low8/64]BCFN(0+10,13-0,T)        R= +20.6  p =  1.5e-10  very suspicious
  [Low8/64]BCFN(0+11,13-0,T)        R= +14.7  p =  2.2e-7   mildly suspicious
  [Low8/64]Gap-16:A                 R= +10.7  p =  2.1e-7   very suspicious
  [Low8/64]Gap-16:B                 R= +16.2  p =  8.3e-14    FAIL
  ...and 2410 test result(s) without anomalies

This test examines the bits produced by Wyrand64 after reversing them. PractRand examines in more detail the lower bits, so testing after a bit reversal is essential to discover weaknesses in the upper bits. The options used were -tf 2 -te 1 -tlmaxonly -tlmax 128TB

The normal (without bit inversion) test starts to give problem at 32TB but still does not fail:

rng=WyRand64, seed=0xdc6a32fb
length= 32 terabytes (2^45 bytes), time= 2032770 seconds
  Test Name                         Raw       Processed     Evaluation
  [Low4/64]Gap-16:B                 R=  +5.7  p =  8.2e-5   unusual
  [Low8/64]DC6-9x1Bytes-1           R=  -6.8  p =1-6.7e-4   unusual
  ...and 2415 test result(s) without anomalies

I expect to to fail at 64TB. Will report later the output.

do{
torture;
}while(!fail)
return fail;

Yes, the hero failed, but he is still my hero.

Frankly, if you think that running one of the most popular test suites for PRNG is "torture" you should revise your research methods. Running PractRand is one of the first thing I do with any generator.

Thanks man! I updated the readme.