generator: add more try-catch blocks internally
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
one around initialization and another when calling reseed()
This commit is contained in:
parent
cf0e548315
commit
53645ea160
@ -34,10 +34,21 @@ Generator::~Generator() = default;
|
||||
|
||||
|
||||
void Generator::initialize_generator(){
|
||||
try {
|
||||
std::memset(G.k, 0x00, G.k.size());
|
||||
G.ctr = 0;
|
||||
fmt::print("Generator initialized\n");
|
||||
} catch(CryptoPP::Exception& e) {
|
||||
fmt::print(stderr, "{}\n", e.what());
|
||||
exit(1);
|
||||
}
|
||||
try {
|
||||
// FIXME: hardcoded seed for the time being
|
||||
reseed("fortuna");
|
||||
} catch(CryptoPP::Exception& e) {
|
||||
fmt::print(stderr, "{}\n", e.what());
|
||||
exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
auto Generator::get_state() -> G_state {
|
||||
|
Reference in New Issue
Block a user