generator: add const qualifier to vars where sound
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-02-03 02:41:47 +01:00
parent c4dcab3046
commit 348b921795
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -167,7 +167,7 @@ auto Generator::generate_random_data(const uint64_t& n) -> std::string {
/* do magic to compute r
* r first-n-bytes(GenerateBlocks(G, ceil(n/16) )) */
unsigned int how_many(
const unsigned int how_many(
static_cast<unsigned int>(std::ceil(static_cast<double>(n) / 16)));
std::string rr{generate_blocks(how_many)};
@ -181,12 +181,11 @@ auto Generator::generate_random_data(const uint64_t& n) -> std::string {
/* re-key */
try {
std::string nu_G_k{generate_blocks(2)};
const std::string nu_G_k{generate_blocks(2)};
/* clear out the old key and set a new one */
std::memset(G.k, 0x00, G.k_length);
std::memmove(G.k, nu_G_k.c_str(), G.k_length);
nu_G_k.clear();
}
catch (std::exception& e) {
fmt::print(stderr, "{}", e.what());