mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove the state file for the random number generator
This commit is contained in:
committed by
Nik Bougalis
parent
cb71d493a0
commit
5e96da51f9
@@ -61,14 +61,6 @@ public:
|
||||
void
|
||||
mix_entropy (void* buffer = nullptr, std::size_t count = 0);
|
||||
|
||||
/** Load entropy from the specified file */
|
||||
void
|
||||
load_state (std::string const& file);
|
||||
|
||||
/** Save entropy to the specified file */
|
||||
void
|
||||
save_state (std::string const& file);
|
||||
|
||||
/** Generate a random integer */
|
||||
result_type
|
||||
operator()();
|
||||
|
||||
@@ -50,27 +50,6 @@ csprng_engine::~csprng_engine ()
|
||||
RAND_cleanup ();
|
||||
}
|
||||
|
||||
void
|
||||
csprng_engine::load_state (std::string const& file)
|
||||
{
|
||||
if (!file.empty())
|
||||
{
|
||||
std::lock_guard<std::mutex> lock (mutex_);
|
||||
RAND_load_file (file.c_str (), kilobytes(1));
|
||||
RAND_write_file (file.c_str ());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
csprng_engine::save_state (std::string const& file)
|
||||
{
|
||||
if (!file.empty())
|
||||
{
|
||||
std::lock_guard<std::mutex> lock (mutex_);
|
||||
RAND_write_file (file.c_str ());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
csprng_engine::mix_entropy (void* buffer, std::size_t count)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user