Always require OS randomness when generating secret keys

This commit is contained in:
Pieter Wuille
2016-04-16 12:25:12 +02:00
parent a80de15113
commit fa2637a3be
7 changed files with 59 additions and 17 deletions

View File

@@ -10,11 +10,8 @@
#include <stdint.h>
/**
* Seed OpenSSL PRNG with additional entropy data
*/
/* Seed OpenSSL PRNG with additional entropy data */
void RandAddSeed();
void RandAddSeedPerfmon();
/**
* Functions to gather random data via the OpenSSL PRNG
@@ -24,6 +21,12 @@ uint64_t GetRand(uint64_t nMax);
int GetRandInt(int nMax);
uint256 GetRandHash();
/**
* Function to gather random data from multiple sources, failing whenever any
* of those source fail to provide a result.
*/
void GetStrongRandBytes(unsigned char* buf, int num);
/**
* Seed insecure_rand using the random pool.
* @param Deterministic Use a deterministic seed