Home GnuPG

tests: Add benchmarking option to tests/random.

Description

tests: Add benchmarking option to tests/random.

* tests/random.c: Always include unistd.h.
(prepend_srcdir): New.
(run_benchmark): New.
(main): Add options --benchmark and --with-seed-file.  Print whetehr
JENT has been used.
* tests/t-common.h (split_fields_colon): New. Taken from GnuPG.
License of that code changed to LGPLv2.1.

Running these tests on a KVM hosted Windows Vista using a statically
compiled tests/random and modifying the extra random added in
read_seed_file gave these results:

| Seed | Jent | Bytes | Bits | Time (ms)  |
|------+------+-------+------+------------|
| yes  | yes  |    32 |  256 |  46 ..  62 |
| yes  | yes  |    64 |  512 |  62 ..  78 |
| yes  | yes  |   128 | 1024 |  78 ..  93 |
| yes  | yes  |   256 | 2048 | 124 .. 156 |
| yes  | yes  |   384 | 3072 | 171 .. 202 |
| yes  | yes  |   512 | 4096 | 234 .. 249 |
| yes  | no   |    32 |  256 |  15 ..  31 |
| yes  | no   |    64 |  512 |  15 ..  31 |
| yes  | no   |   128 | 1024 |  15        |
| no   | yes  |     - |    - |  78 .. 93  |
| no   | no   |     - |    - |  15        |

Seed: Whether a seed file is used.
Jent: Whether JENT was working.
Bytes: The number bytes mixed into the pool after reading

the seed file.

Bits: 8 * Bytes
Time: Measured time including the time to read the seed file.

Mimimun and maximum values are given.  Granularity of
the used timer is quite large.
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Aug 2 2017, 6:44 PM
Parents
rCeea36574f378: random: Add more bytes to the pool in addition to the seed file.
Branches
Unknown
Tags
Unknown