generator: get rid of an intermediary var
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
f250543231
commit
9e6efc9d38
|
@ -55,13 +55,12 @@ auto Generator::reseed(const std::string& s) -> void {
|
|||
// ref: https://www.cryptopp.com/wiki/SecBlock
|
||||
std::string da_key(reinterpret_cast<const char*>(&G.k[0]),
|
||||
G.k.SizeInBytes() * 8); // we need the size in bits
|
||||
std::string to_be_hashed{da_key+s};
|
||||
// fmt::print("s -> {}\n", s); // debugging
|
||||
// fmt::print("da_key -> {}\n", da_key); // debugging
|
||||
// fmt::print("concat \"da_key + s\" -> {}\n", to_be_hashed); // debugging
|
||||
|
||||
try {
|
||||
std::string a{fortuna::Util::do_sha(to_be_hashed)};
|
||||
std::string a{fortuna::Util::do_sha(da_key + s)};
|
||||
std::memmove(&G.k[0], &a[0], G.k.SizeInBytes());
|
||||
++G.ctr;
|
||||
} catch(std::exception& e) {
|
||||
|
|
Reference in New Issue