fortuna: add incr_reseed_ctr

This commit is contained in:
surtur 2021-12-07 15:46:01 +01:00
parent b96ce5d644
commit 9f799c83a9
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 6 additions and 0 deletions

View File

@ -23,6 +23,8 @@ namespace fortuna {
Fortuna::~Fortuna() = default;
auto Fortuna::random_data(unsigned int n_bytes) -> void {
incr_reseed_ctr();
std::string n{R.Gen.generate_random_data(n_bytes)};
fmt::print("got you {} proper bytes from generate_random_data -> {}\n",
n_bytes, n);

View File

@ -23,6 +23,10 @@ public:
Fortuna::R.null_da_ctr();
}
auto incr_reseed_ctr() -> void {
++Fortuna::R.reseed_ctr;
}
auto initialize_prng() -> void {
// TODO(me): handle the reseeds here as per Cryptography Engineering,
// p. 153