This replaces the OpenSSL-based random number generation code with a built-in implementation of Fortuna.
It is seeded from operating system entropy (/dev/urandom etc), a variety of environment entropy (which is strengthened), and very precise CPU timings. Expensive (more than a few millisecond) seedings are only done at startup, others occur every few minutes. Data from RPC, processing and network events is additionally fed into the entropy pool. This should give us fairly safe operation even in case operating system entropy code is broken.
Furtermore, it unifies the insecure and secure random number generator, and makes the private key generation code always request OS entropy (which is likely better than we can do, but we still want to protect against it being broken).
TODO:
- Better environment information on OSX and Windows
- Seeding from GUI events into the pool.
- Unit tests for the Fortuna implementation.