refactor: non-semantic cleanup
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2086861776
commit
b5601acfbd
|
@ -5,12 +5,8 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <cryptopp/cryptlib.h>
|
#include <cryptopp/cryptlib.h>
|
||||||
#include <fmt/core.h>
|
|
||||||
#include <fmt/chrono.h>
|
#include <fmt/chrono.h>
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
|
|
||||||
|
|
||||||
namespace fortuna {
|
namespace fortuna {
|
||||||
static constexpr const unsigned int min_pool_size{64};
|
static constexpr const unsigned int min_pool_size{64};
|
||||||
|
|
||||||
|
@ -29,7 +25,7 @@ namespace fortuna {
|
||||||
const auto start{std::chrono::system_clock::now()};
|
const auto start{std::chrono::system_clock::now()};
|
||||||
fmt::print("random_data starting - {}\n", start);
|
fmt::print("random_data starting - {}\n", start);
|
||||||
auto now{std::chrono::steady_clock::now()};
|
auto now{std::chrono::steady_clock::now()};
|
||||||
auto elapsed{
|
auto elapsed {
|
||||||
std::chrono::duration_cast<std::chrono::milliseconds>(
|
std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||||
std::chrono::steady_clock::now().time_since_epoch() -
|
std::chrono::steady_clock::now().time_since_epoch() -
|
||||||
now.time_since_epoch()
|
now.time_since_epoch()
|
||||||
|
@ -40,7 +36,6 @@ namespace fortuna {
|
||||||
std::string s;
|
std::string s;
|
||||||
|
|
||||||
if (R.pools[0].get_s_length() >= min_pool_size && elapsed > R.Gen.reseed_interval) {
|
if (R.pools[0].get_s_length() >= min_pool_size && elapsed > R.Gen.reseed_interval) {
|
||||||
#pragma omp parallel for
|
|
||||||
for (int i = 0; i < static_cast<int>(pools_to_use); ++i) {
|
for (int i = 0; i < static_cast<int>(pools_to_use); ++i) {
|
||||||
if (R.reseed_ctr % static_cast<int>(pow(2,i)) == 0) {
|
if (R.reseed_ctr % static_cast<int>(pow(2,i)) == 0) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -45,13 +45,13 @@ public:
|
||||||
fmt::print("{}\n", e.what());
|
fmt::print("{}\n", e.what());
|
||||||
}
|
}
|
||||||
fmt::print("PRNG initialized\n");
|
fmt::print("PRNG initialized\n");
|
||||||
};
|
}
|
||||||
|
|
||||||
// PRNG state
|
// PRNG state
|
||||||
class R_state {
|
class R_state {
|
||||||
friend fortuna::Fortuna;
|
friend fortuna::Fortuna;
|
||||||
public:
|
public:
|
||||||
R_state(){};
|
R_state(){}
|
||||||
~R_state() = default;
|
~R_state() = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Reference in New Issue