STM32 Random Number Generator

From Stm32World Wiki
Jump to navigation Jump to search

Testing

To establish a baseline the random generators of the Linux kernel was tested with dieharder

Linux /dev/urandom

dd if=/dev/urandom of=tmp/urandom.dat bs=10K count=1000K status=progress
lth@ncpws04:~$ dieharder -f tmp/urandom.dat -g 201 -a
#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
#=============================================================================#
   rng_name    |           filename             |rands/second|
 file_input_raw|                 tmp/urandom.dat|  4.46e+07  |
#=============================================================================#
        test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
   diehard_birthdays|   0|       100|     100|0.85148765|  PASSED  
      diehard_operm5|   0|   1000000|     100|0.36158689|  PASSED  
  diehard_rank_32x32|   0|     40000|     100|0.19235819|  PASSED  
    diehard_rank_6x8|   0|    100000|     100|0.73153207|  PASSED  
   diehard_bitstream|   0|   2097152|     100|0.33413757|  PASSED  
        diehard_opso|   0|   2097152|     100|0.80138421|  PASSED  
        diehard_oqso|   0|   2097152|     100|0.41464611|  PASSED  
         diehard_dna|   0|   2097152|     100|0.77342197|  PASSED  
diehard_count_1s_str|   0|    256000|     100|0.26194352|  PASSED  
diehard_count_1s_byt|   0|    256000|     100|0.26024222|  PASSED  
 diehard_parking_lot|   0|     12000|     100|0.36948334|  PASSED  
    diehard_2dsphere|   2|      8000|     100|0.91598724|  PASSED  
    diehard_3dsphere|   3|      4000|     100|0.40635801|  PASSED  
     diehard_squeeze|   0|    100000|     100|0.05386421|  PASSED  
        diehard_sums|   0|       100|     100|0.00155920|   WEAK   
        diehard_runs|   0|    100000|     100|0.65301623|  PASSED  
        diehard_runs|   0|    100000|     100|0.06399268|  PASSED  
       diehard_craps|   0|    200000|     100|0.16924752|  PASSED  
       diehard_craps|   0|    200000|     100|0.24596907|  PASSED  
# The file file_input_raw was rewound 1 times
 marsaglia_tsang_gcd|   0|  10000000|     100|0.88583219|  PASSED  
 marsaglia_tsang_gcd|   0|  10000000|     100|0.16819094|  PASSED  
# The file file_input_raw was rewound 1 times
         sts_monobit|   1|    100000|     100|0.09420096|  PASSED  
# The file file_input_raw was rewound 1 times
            sts_runs|   2|    100000|     100|0.48630702|  PASSED  
# The file file_input_raw was rewound 1 times
          sts_serial|   1|    100000|     100|0.11959076|  PASSED  
          sts_serial|   2|    100000|     100|0.04603001|  PASSED  
          sts_serial|   3|    100000|     100|0.12200595|  PASSED  
          sts_serial|   3|    100000|     100|0.80969741|  PASSED  
          sts_serial|   4|    100000|     100|0.07838883|  PASSED  
          sts_serial|   4|    100000|     100|0.14268430|  PASSED  
          sts_serial|   5|    100000|     100|0.00943842|  PASSED  
          sts_serial|   5|    100000|     100|0.34939985|  PASSED  
          sts_serial|   6|    100000|     100|0.18024085|  PASSED  
          sts_serial|   6|    100000|     100|0.50932766|  PASSED  
          sts_serial|   7|    100000|     100|0.41902895|  PASSED  
          sts_serial|   7|    100000|     100|0.07440290|  PASSED  
          sts_serial|   8|    100000|     100|0.61167995|  PASSED  
          sts_serial|   8|    100000|     100|0.69452949|  PASSED  
          sts_serial|   9|    100000|     100|0.65695056|  PASSED  
          sts_serial|   9|    100000|     100|0.31934371|  PASSED  
          sts_serial|  10|    100000|     100|0.40962901|  PASSED  
          sts_serial|  10|    100000|     100|0.25781306|  PASSED  
          sts_serial|  11|    100000|     100|0.47110407|  PASSED  
          sts_serial|  11|    100000|     100|0.37171407|  PASSED  
          sts_serial|  12|    100000|     100|0.62296326|  PASSED  
          sts_serial|  12|    100000|     100|0.92450747|  PASSED  
          sts_serial|  13|    100000|     100|0.78732283|  PASSED  
          sts_serial|  13|    100000|     100|0.90548337|  PASSED  
          sts_serial|  14|    100000|     100|0.24572937|  PASSED  
          sts_serial|  14|    100000|     100|0.14229025|  PASSED  
          sts_serial|  15|    100000|     100|0.77306080|  PASSED  
          sts_serial|  15|    100000|     100|0.18669347|  PASSED  
          sts_serial|  16|    100000|     100|0.26152361|  PASSED  
          sts_serial|  16|    100000|     100|0.10723628|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   1|    100000|     100|0.20567033|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   2|    100000|     100|0.97756506|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   3|    100000|     100|0.87310602|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   4|    100000|     100|0.61554409|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   5|    100000|     100|0.34699765|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   6|    100000|     100|0.70054743|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   7|    100000|     100|0.95797379|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   8|    100000|     100|0.85447991|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|   9|    100000|     100|0.97315970|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|  10|    100000|     100|0.07551501|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|  11|    100000|     100|0.02806740|  PASSED  
# The file file_input_raw was rewound 1 times
         rgb_bitdist|  12|    100000|     100|0.90312101|  PASSED  
# The file file_input_raw was rewound 1 times
rgb_minimum_distance|   2|     10000|    1000|0.72195925|  PASSED  
# The file file_input_raw was rewound 1 times
rgb_minimum_distance|   3|     10000|    1000|0.98801454|  PASSED  
# The file file_input_raw was rewound 1 times
rgb_minimum_distance|   4|     10000|    1000|0.49907419|  PASSED  
# The file file_input_raw was rewound 1 times
rgb_minimum_distance|   5|     10000|    1000|0.18432754|  PASSED  
# The file file_input_raw was rewound 1 times
    rgb_permutations|   2|    100000|     100|0.32461006|  PASSED  
# The file file_input_raw was rewound 1 times
    rgb_permutations|   3|    100000|     100|0.82934484|  PASSED  
# The file file_input_raw was rewound 1 times
    rgb_permutations|   4|    100000|     100|0.83975351|  PASSED  
# The file file_input_raw was rewound 1 times
    rgb_permutations|   5|    100000|     100|0.27076663|  PASSED  
# The file file_input_raw was rewound 1 times
      rgb_lagged_sum|   0|   1000000|     100|0.41373955|  PASSED  
# The file file_input_raw was rewound 2 times
      rgb_lagged_sum|   1|   1000000|     100|0.76783623|  PASSED  
# The file file_input_raw was rewound 2 times
      rgb_lagged_sum|   2|   1000000|     100|0.01154601|  PASSED  
# The file file_input_raw was rewound 2 times
      rgb_lagged_sum|   3|   1000000|     100|0.96949933|  PASSED  
# The file file_input_raw was rewound 2 times
      rgb_lagged_sum|   4|   1000000|     100|0.99060610|  PASSED  
# The file file_input_raw was rewound 2 times
      rgb_lagged_sum|   5|   1000000|     100|0.58013154|  PASSED  
# The file file_input_raw was rewound 3 times
      rgb_lagged_sum|   6|   1000000|     100|0.55260299|  PASSED  
# The file file_input_raw was rewound 3 times
      rgb_lagged_sum|   7|   1000000|     100|0.35878201|  PASSED  
# The file file_input_raw was rewound 3 times
      rgb_lagged_sum|   8|   1000000|     100|0.95568689|  PASSED  
# The file file_input_raw was rewound 4 times
      rgb_lagged_sum|   9|   1000000|     100|0.42992479|  PASSED  
# The file file_input_raw was rewound 4 times
      rgb_lagged_sum|  10|   1000000|     100|0.01048571|  PASSED  
# The file file_input_raw was rewound 4 times
      rgb_lagged_sum|  11|   1000000|     100|0.84407767|  PASSED  
# The file file_input_raw was rewound 5 times
      rgb_lagged_sum|  12|   1000000|     100|0.87042410|  PASSED  
# The file file_input_raw was rewound 5 times
      rgb_lagged_sum|  13|   1000000|     100|0.69430023|  PASSED  
# The file file_input_raw was rewound 6 times
      rgb_lagged_sum|  14|   1000000|     100|0.52936159|  PASSED  
# The file file_input_raw was rewound 7 times
      rgb_lagged_sum|  15|   1000000|     100|0.49236453|  PASSED  
# The file file_input_raw was rewound 7 times
      rgb_lagged_sum|  16|   1000000|     100|0.00956599|  PASSED  
# The file file_input_raw was rewound 8 times
      rgb_lagged_sum|  17|   1000000|     100|0.52760754|  PASSED  
# The file file_input_raw was rewound 9 times
      rgb_lagged_sum|  18|   1000000|     100|0.52313251|  PASSED  
# The file file_input_raw was rewound 9 times
      rgb_lagged_sum|  19|   1000000|     100|0.89894945|  PASSED  
# The file file_input_raw was rewound 10 times
      rgb_lagged_sum|  20|   1000000|     100|0.07486173|  PASSED  
# The file file_input_raw was rewound 11 times
      rgb_lagged_sum|  21|   1000000|     100|0.31468816|  PASSED  
# The file file_input_raw was rewound 12 times
      rgb_lagged_sum|  22|   1000000|     100|0.65555903|  PASSED  
# The file file_input_raw was rewound 13 times
      rgb_lagged_sum|  23|   1000000|     100|0.61063599|  PASSED  
# The file file_input_raw was rewound 14 times
      rgb_lagged_sum|  24|   1000000|     100|0.99012152|  PASSED  
# The file file_input_raw was rewound 15 times
      rgb_lagged_sum|  25|   1000000|     100|0.35491357|  PASSED  
# The file file_input_raw was rewound 16 times
      rgb_lagged_sum|  26|   1000000|     100|0.76869968|  PASSED  
# The file file_input_raw was rewound 17 times
      rgb_lagged_sum|  27|   1000000|     100|0.53874540|  PASSED  
# The file file_input_raw was rewound 18 times
      rgb_lagged_sum|  28|   1000000|     100|0.93392617|  PASSED  
# The file file_input_raw was rewound 19 times
      rgb_lagged_sum|  29|   1000000|     100|0.44204121|  PASSED  
# The file file_input_raw was rewound 20 times
      rgb_lagged_sum|  30|   1000000|     100|0.70565245|  PASSED  
# The file file_input_raw was rewound 22 times
      rgb_lagged_sum|  31|   1000000|     100|0.46219747|  PASSED  
# The file file_input_raw was rewound 23 times
      rgb_lagged_sum|  32|   1000000|     100|0.91054220|  PASSED  
# The file file_input_raw was rewound 23 times
     rgb_kstest_test|   0|     10000|    1000|0.20926709|  PASSED  
# The file file_input_raw was rewound 23 times
     dab_bytedistrib|   0|  51200000|       1|0.59814792|  PASSED  
# The file file_input_raw was rewound 23 times
             dab_dct| 256|     50000|       1|0.74212677|  PASSED  
Preparing to run test 207.  ntuple = 0
# The file file_input_raw was rewound 23 times
        dab_filltree|  32|  15000000|       1|0.28984573|  PASSED  
        dab_filltree|  32|  15000000|       1|0.63562855|  PASSED  
Preparing to run test 208.  ntuple = 0
# The file file_input_raw was rewound 23 times
       dab_filltree2|   0|   5000000|       1|0.16660978|  PASSED  
       dab_filltree2|   1|   5000000|       1|0.17854561|  PASSED  
Preparing to run test 209.  ntuple = 0
# The file file_input_raw was rewound 23 times
        dab_monobit2|  12|  65000000|       1|0.25711145|  PASSED

Linux /dev/random

dd if=/dev/random of=tmp/random.dat bs=10K count=1000K status=progress

Miscellaneous Links