BitShares/bitshares — pull request #964 by drltc (2014-11-12 19:15:23+00:00)
Title: Move deterministic RNG to its own library

I want to adapt one of the programs in `programs/utilities` (specifically `bts_create_key`) to use the deterministic RNG (which will only be activated if the user specifically requests it by using a new command line option I will implement). It is inconvenient to have the deterministic RNG functionality in `tests`.

To reduce the risk of accidental use of the deterministic RNG in contexts where a full RNG is necessary for security, on the first API call the RNG will:

- Print out a large warning banner on `stderr` informing the user that keys are deterministically generated and insecure
- Panic (`exit(1)`) if called in a release build (i.e. `BTS_TEST_NETWORK` was undefined at compile time)

To use the deterministic RNG, you must:

- Link against the `deterministic_openssl_rng` library in `CMakeLists.txt`
- `#include `
- Call `set_random_seed_for_testing()`

Originally I moved it to `libraries/utilities` but I changed my mind and in the last commit, moved it again into its own library.