generator: make some internal vars const
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-26 22:43:22 +01:00
parent c40806e68d
commit 8f0f29d190
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -92,11 +92,11 @@ auto Generator::do_crypto() -> std::string {
// https://www.cryptopp.com/wiki/CTR_Mode
// William Shakespeare, Romeo and Juliet
std::string plain{"Oh, I am fortune's fool!"};
const std::string plain{"Oh, I am fortune's fool!"};
std::string cipher, encoded_c;
std::unique_lock<std::mutex> ul(crypt_mtx);
// in case we need to convert counter to string
std::string str_ctr{reinterpret_cast<const char*>(&G.ctr)};
const std::string str_ctr{reinterpret_cast<const char*>(&G.ctr)};
// 16 bytes --> 128bit
static constexpr const std::size_t ctr_length{16};
CryptoPP::FixedSizeSecBlock<CryptoPP::byte, ctr_length> ctr;