mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
New 'getRand' function.
This commit is contained in:
@@ -5,6 +5,17 @@
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#include <openssl/rand.h>
|
||||
|
||||
void getRand(unsigned char *buf, int num)
|
||||
{
|
||||
if (RAND_bytes(buf, num) != 1)
|
||||
{
|
||||
assert(false);
|
||||
throw std::runtime_error("Entropy pool not seeded");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Time support
|
||||
// We have our own epoch.
|
||||
|
||||
Reference in New Issue
Block a user