fortuna: add incr_reseed_ctr
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
b96ce5d644
commit
9f799c83a9
|
@ -23,6 +23,8 @@ namespace fortuna {
|
||||||
Fortuna::~Fortuna() = default;
|
Fortuna::~Fortuna() = default;
|
||||||
|
|
||||||
auto Fortuna::random_data(unsigned int n_bytes) -> void {
|
auto Fortuna::random_data(unsigned int n_bytes) -> void {
|
||||||
|
incr_reseed_ctr();
|
||||||
|
|
||||||
std::string n{R.Gen.generate_random_data(n_bytes)};
|
std::string n{R.Gen.generate_random_data(n_bytes)};
|
||||||
fmt::print("got you {} proper bytes from generate_random_data -> {}\n",
|
fmt::print("got you {} proper bytes from generate_random_data -> {}\n",
|
||||||
n_bytes, n);
|
n_bytes, n);
|
||||||
|
|
|
@ -23,6 +23,10 @@ public:
|
||||||
Fortuna::R.null_da_ctr();
|
Fortuna::R.null_da_ctr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto incr_reseed_ctr() -> void {
|
||||||
|
++Fortuna::R.reseed_ctr;
|
||||||
|
}
|
||||||
|
|
||||||
auto initialize_prng() -> void {
|
auto initialize_prng() -> void {
|
||||||
// TODO(me): handle the reseeds here as per Cryptography Engineering,
|
// TODO(me): handle the reseeds here as per Cryptography Engineering,
|
||||||
// p. 153
|
// p. 153
|
||||||
|
|
Reference in New Issue