Instead of Hello World: FG Tests

October 22nd, 2018

I will use the first blogpost to remove one item off my backlog: publish the results of FUCKGOATS (FG) testing.

FG is, as you all certainly know, the republican RNG, and perhaps the only one that works1. While the FG shop has been closed for quite some time already, you can still rent FUCKGOATS from Pizarro, and there are some signs that it might open one day again. I got my FG from danielpbarron back in the days before entering the WoT.

The standard suite for performing RNG tests includes two utilities, ent and dieharder. Both work2 by reading RNG samples from a file, which must be rather large; I used 849M worth of random data as input3.

So, here are the results for ent:

% ./ent ../fg.bin
Entropy = 8.000000 bits per byte.

Optimum compression would reduce the size
of this 889678745 byte file by 0 percent.

Chi square distribution for 889678745 samples is 244.21, and randomly
would exceed this value 67.55 percent of the times.

Arithmetic mean value of data bytes is 127.5007 (127.5 = random).
Monte Carlo value for Pi is 3.141574371 (error 0.00 percent).
Serial correlation coefficient is -0.000031 (totally uncorrelated = 0.0).

And for dieharder:

% ./dieharder -a -g 201 -f ../../fg.bin
#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
#=============================================================================#
   rng_name    |           filename             |rands/second|
 file_input_raw|                    ../../fg.bin|  2.67e+07  |
#=============================================================================#
        test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
   diehard_birthdays|   0|       100|     100|0.44399854|  PASSED
      diehard_operm5|   0|   1000000|     100|0.57088270|  PASSED
# The file file_input_raw was rewound 1 times
  diehard_rank_32x32|   0|     40000|     100|0.63557220|  PASSED
# The file file_input_raw was rewound 1 times
    diehard_rank_6x8|   0|    100000|     100|0.48779850|  PASSED
# The file file_input_raw was rewound 1 times
   diehard_bitstream|   0|   2097152|     100|0.86096311|  PASSED
# The file file_input_raw was rewound 2 times
        diehard_opso|   0|   2097152|     100|0.63444572|  PASSED
# The file file_input_raw was rewound 3 times
        diehard_oqso|   0|   2097152|     100|0.88107917|  PASSED
# The file file_input_raw was rewound 3 times
         diehard_dna|   0|   2097152|     100|0.27976628|  PASSED
# The file file_input_raw was rewound 3 times
diehard_count_1s_str|   0|    256000|     100|0.86569068|  PASSED
# The file file_input_raw was rewound 3 times
diehard_count_1s_byt|   0|    256000|     100|0.54850592|  PASSED
# The file file_input_raw was rewound 3 times
 diehard_parking_lot|   0|     12000|     100|0.25249632|  PASSED
# The file file_input_raw was rewound 3 times
    diehard_2dsphere|   2|      8000|     100|0.99053937|  PASSED
# The file file_input_raw was rewound 3 times
    diehard_3dsphere|   3|      4000|     100|0.89209704|  PASSED
# The file file_input_raw was rewound 5 times
     diehard_squeeze|   0|    100000|     100|0.57180801|  PASSED
# The file file_input_raw was rewound 5 times
        diehard_sums|   0|       100|     100|0.07499925|  PASSED
# The file file_input_raw was rewound 5 times
        diehard_runs|   0|    100000|     100|0.66839857|  PASSED
        diehard_runs|   0|    100000|     100|0.53363069|  PASSED
# The file file_input_raw was rewound 5 times
       diehard_craps|   0|    200000|     100|0.90406082|  PASSED
       diehard_craps|   0|    200000|     100|0.49188643|  PASSED
# The file file_input_raw was rewound 14 times
 marsaglia_tsang_gcd|   0|  10000000|     100|0.05577585|  PASSED
 marsaglia_tsang_gcd|   0|  10000000|     100|0.00704987|  PASSED
# The file file_input_raw was rewound 14 times
         sts_monobit|   1|    100000|     100|0.13669553|  PASSED
# The file file_input_raw was rewound 14 times
            sts_runs|   2|    100000|     100|0.16559827|  PASSED
# The file file_input_raw was rewound 14 times
          sts_serial|   1|    100000|     100|0.58788749|  PASSED
          sts_serial|   2|    100000|     100|0.74321831|  PASSED
          sts_serial|   3|    100000|     100|0.99831050|   WEAK
          sts_serial|   3|    100000|     100|0.84737426|  PASSED
          sts_serial|   4|    100000|     100|0.93110407|  PASSED
          sts_serial|   4|    100000|     100|0.83324035|  PASSED
          sts_serial|   5|    100000|     100|0.94421934|  PASSED
          sts_serial|   5|    100000|     100|0.81289554|  PASSED
          sts_serial|   6|    100000|     100|0.53951612|  PASSED
          sts_serial|   6|    100000|     100|0.82451508|  PASSED
          sts_serial|   7|    100000|     100|0.12968066|  PASSED
          sts_serial|   7|    100000|     100|0.96902381|  PASSED
          sts_serial|   8|    100000|     100|0.62914226|  PASSED
          sts_serial|   8|    100000|     100|0.40809649|  PASSED
          sts_serial|   9|    100000|     100|0.81970315|  PASSED
          sts_serial|   9|    100000|     100|0.23650429|  PASSED
          sts_serial|  10|    100000|     100|0.15824512|  PASSED
          sts_serial|  10|    100000|     100|0.05486414|  PASSED
          sts_serial|  11|    100000|     100|0.68102644|  PASSED
          sts_serial|  11|    100000|     100|0.75858013|  PASSED
          sts_serial|  12|    100000|     100|0.62086200|  PASSED
          sts_serial|  12|    100000|     100|0.84430970|  PASSED
          sts_serial|  13|    100000|     100|0.50871448|  PASSED
          sts_serial|  13|    100000|     100|0.73534490|  PASSED
          sts_serial|  14|    100000|     100|0.45199677|  PASSED
          sts_serial|  14|    100000|     100|0.99864346|   WEAK
          sts_serial|  15|    100000|     100|0.41340272|  PASSED
          sts_serial|  15|    100000|     100|0.70736625|  PASSED
          sts_serial|  16|    100000|     100|0.63218512|  PASSED
          sts_serial|  16|    100000|     100|0.50342633|  PASSED
# The file file_input_raw was rewound 14 times
         rgb_bitdist|   1|    100000|     100|0.07190867|  PASSED
# The file file_input_raw was rewound 15 times
         rgb_bitdist|   2|    100000|     100|0.09507940|  PASSED
# The file file_input_raw was rewound 15 times
         rgb_bitdist|   3|    100000|     100|0.13197759|  PASSED
# The file file_input_raw was rewound 15 times
         rgb_bitdist|   4|    100000|     100|0.33878767|  PASSED
# The file file_input_raw was rewound 16 times
         rgb_bitdist|   5|    100000|     100|0.97356278|  PASSED
# The file file_input_raw was rewound 16 times
         rgb_bitdist|   6|    100000|     100|0.49599651|  PASSED
# The file file_input_raw was rewound 17 times
         rgb_bitdist|   7|    100000|     100|0.52390961|  PASSED
# The file file_input_raw was rewound 18 times
         rgb_bitdist|   8|    100000|     100|0.56247751|  PASSED
# The file file_input_raw was rewound 18 times
         rgb_bitdist|   9|    100000|     100|0.89189295|  PASSED
# The file file_input_raw was rewound 19 times
         rgb_bitdist|  10|    100000|     100|0.65423810|  PASSED
# The file file_input_raw was rewound 20 times
         rgb_bitdist|  11|    100000|     100|0.13240810|  PASSED
# The file file_input_raw was rewound 21 times
         rgb_bitdist|  12|    100000|     100|0.63913354|  PASSED
# The file file_input_raw was rewound 21 times
rgb_minimum_distance|   2|     10000|    1000|0.00573313|  PASSED
# The file file_input_raw was rewound 22 times
rgb_minimum_distance|   3|     10000|    1000|0.29971515|  PASSED
# The file file_input_raw was rewound 22 times
rgb_minimum_distance|   4|     10000|    1000|0.84618427|  PASSED
# The file file_input_raw was rewound 22 times
rgb_minimum_distance|   5|     10000|    1000|0.44583486|  PASSED
# The file file_input_raw was rewound 22 times
    rgb_permutations|   2|    100000|     100|0.96942781|  PASSED
# The file file_input_raw was rewound 22 times
    rgb_permutations|   3|    100000|     100|0.89138511|  PASSED
# The file file_input_raw was rewound 22 times
    rgb_permutations|   4|    100000|     100|0.65305616|  PASSED
# The file file_input_raw was rewound 23 times
    rgb_permutations|   5|    100000|     100|0.66828334|  PASSED
# The file file_input_raw was rewound 23 times
      rgb_lagged_sum|   0|   1000000|     100|0.30365013|  PASSED
# The file file_input_raw was rewound 24 times
      rgb_lagged_sum|   1|   1000000|     100|0.99471846|  PASSED
# The file file_input_raw was rewound 25 times
      rgb_lagged_sum|   2|   1000000|     100|0.98328939|  PASSED
# The file file_input_raw was rewound 27 times
      rgb_lagged_sum|   3|   1000000|     100|0.65811353|  PASSED
# The file file_input_raw was rewound 29 times
      rgb_lagged_sum|   4|   1000000|     100|0.90999393|  PASSED
# The file file_input_raw was rewound 32 times
      rgb_lagged_sum|   5|   1000000|     100|0.90755735|  PASSED
# The file file_input_raw was rewound 35 times
      rgb_lagged_sum|   6|   1000000|     100|0.37747152|  PASSED
# The file file_input_raw was rewound 39 times
      rgb_lagged_sum|   7|   1000000|     100|0.96116962|  PASSED
# The file file_input_raw was rewound 43 times
      rgb_lagged_sum|   8|   1000000|     100|0.63557385|  PASSED
# The file file_input_raw was rewound 47 times
      rgb_lagged_sum|   9|   1000000|     100|0.84620009|  PASSED
# The file file_input_raw was rewound 52 times
      rgb_lagged_sum|  10|   1000000|     100|0.22309746|  PASSED
# The file file_input_raw was rewound 58 times
      rgb_lagged_sum|  11|   1000000|     100|0.97905456|  PASSED
# The file file_input_raw was rewound 63 times
      rgb_lagged_sum|  12|   1000000|     100|0.40789997|  PASSED
# The file file_input_raw was rewound 70 times
      rgb_lagged_sum|  13|   1000000|     100|0.99502738|   WEAK
# The file file_input_raw was rewound 77 times
      rgb_lagged_sum|  14|   1000000|     100|0.66531832|  PASSED
# The file file_input_raw was rewound 84 times
      rgb_lagged_sum|  15|   1000000|     100|0.99726778|   WEAK
# The file file_input_raw was rewound 91 times
      rgb_lagged_sum|  16|   1000000|     100|0.62953343|  PASSED
# The file file_input_raw was rewound 99 times
      rgb_lagged_sum|  17|   1000000|     100|0.79626906|  PASSED
# The file file_input_raw was rewound 108 times
      rgb_lagged_sum|  18|   1000000|     100|0.76906633|  PASSED
# The file file_input_raw was rewound 117 times
      rgb_lagged_sum|  19|   1000000|     100|0.64242791|  PASSED
# The file file_input_raw was rewound 126 times
      rgb_lagged_sum|  20|   1000000|     100|0.35872780|  PASSED
# The file file_input_raw was rewound 136 times
      rgb_lagged_sum|  21|   1000000|     100|0.75769227|  PASSED
# The file file_input_raw was rewound 147 times
      rgb_lagged_sum|  22|   1000000|     100|0.25849858|  PASSED
# The file file_input_raw was rewound 157 times
      rgb_lagged_sum|  23|   1000000|     100|0.86224195|  PASSED
# The file file_input_raw was rewound 169 times
      rgb_lagged_sum|  24|   1000000|     100|0.99944663|   WEAK
# The file file_input_raw was rewound 180 times
      rgb_lagged_sum|  25|   1000000|     100|0.73249761|  PASSED
# The file file_input_raw was rewound 193 times
      rgb_lagged_sum|  26|   1000000|     100|0.93039082|  PASSED
# The file file_input_raw was rewound 205 times
      rgb_lagged_sum|  27|   1000000|     100|0.95635141|  PASSED
# The file file_input_raw was rewound 218 times
      rgb_lagged_sum|  28|   1000000|     100|0.45029993|  PASSED
# The file file_input_raw was rewound 232 times
      rgb_lagged_sum|  29|   1000000|     100|0.79591709|  PASSED
# The file file_input_raw was rewound 246 times
      rgb_lagged_sum|  30|   1000000|     100|0.23515616|  PASSED
# The file file_input_raw was rewound 260 times
      rgb_lagged_sum|  31|   1000000|     100|0.96924535|  PASSED
# The file file_input_raw was rewound 275 times
      rgb_lagged_sum|  32|   1000000|     100|0.70167206|  PASSED
# The file file_input_raw was rewound 275 times
     rgb_kstest_test|   0|     10000|    1000|0.17174273|  PASSED
# The file file_input_raw was rewound 276 times
     dab_bytedistrib|   0|  51200000|       1|0.76625095|  PASSED
# The file file_input_raw was rewound 276 times
             dab_dct| 256|     50000|       1|0.34018369|  PASSED
Preparing to run test 207.  ntuple = 0
# The file file_input_raw was rewound 276 times
        dab_filltree|  32|  15000000|       1|0.55623971|  PASSED
        dab_filltree|  32|  15000000|       1|0.17330907|  PASSED
Preparing to run test 208.  ntuple = 0
# The file file_input_raw was rewound 276 times
       dab_filltree2|   0|   5000000|       1|0.61793921|  PASSED
       dab_filltree2|   1|   5000000|       1|0.35896612|  PASSED
Preparing to run test 209.  ntuple = 0
# The file file_input_raw was rewound 277 times
        dab_monobit2|  12|  65000000|       1|0.24267987|  PASSED
  1. Just search for any other RNG in the logs. []
  2. Definition of 'work' seems to be missing. []
  3. And yes, I configured the device properly:

    % stty -F /dev/ttyUSB0 115200 raw -echo -echoe -echok
    % dd if=/dev/ttyUSB0 of=fg.bin iflag=fullblock bs=16k

    []

One Response to “Instead of Hello World: FG Tests”

Leave a Reply