Handle CPU_RNG failures in OCaml: (#255)
* Handle CPU_RNG failures in OCaml:
- Previously, a return value of "0" was treated specially, but rdrand/rdseed
may return 0!
- If there's a failure in rdrand/rdseed during cpu_rng_bootstrap, raise an
exception
- If there's a failure during the periodic reseeding (timer initiated feeding
of all pools), ignore it (for now!?)
* use memcpy instead of manual copying
* entropy: provide rdrand and rdseed calls and failures
* cpu_rng_bootstrap: use rdrand if rdseed fails.
if rdseed fails, take 512 times rdrand.
if rdrand fails 512 times (* 10 from the RETRIES in C), fail
* rdseed: 100 retries, rdrand: 10 retries
* avoid unused parameter warnings
* use Val_false directly
authored by