Remove the state file for the random number generator

This commit is contained in:
Markus Teufelberger
2018-11-03 16:18:03 +01:00
committed by Nik Bougalis
parent cb71d493a0
commit 5e96da51f9
5 changed files with 0 additions and 118 deletions

View File

@@ -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()();

View File

@@ -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)
{