1#include <xrpl/crypto/csprng.h>
3#include <xrpl/basics/contract.h>
5#include <openssl/opensslv.h>
6#include <openssl/rand.h>
26#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
42 for (
auto& e : entropy)
50 RAND_add(entropy.
data(), entropy.
size() *
sizeof(std::random_device::result_type), 0);
52 if (buffer !=
nullptr && count != 0)
53 RAND_add(buffer, count, 0);
62#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || !defined(OPENSSL_THREADS)
66 auto const result = RAND_bytes(
reinterpret_cast<unsigned char*
>(ptr), count);
A cryptographically secure random number engine.
result_type operator()()
Generate a random integer.
std::uint64_t result_type
void mixEntropy(void *buffer=nullptr, std::size_t count=0)
Mix entropy into the pool.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
CsprngEngine & cryptoPrng()
The default cryptographically secure PRNG.
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)