From 408d783c37965c9826d6839e4052a6d54705873b Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 8 Jan 2022 06:34:30 +0100 Subject: [PATCH] chore(generator): comments clean-up --- generator.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/generator.cpp b/generator.cpp index 0a14999..0eefeb2 100644 --- a/generator.cpp +++ b/generator.cpp @@ -37,7 +37,7 @@ void Generator::initialize_generator(){ fmt::print(stderr, "{}\n", e.what()); exit(1); } -}; +} auto Generator::get_state() const -> G_state { return G; @@ -47,9 +47,6 @@ auto Generator::reseed(const std::string& s) -> void { // ref: https://www.cryptopp.com/wiki/SecBlock std::string da_key(reinterpret_cast(&G.k[0]), G.k.SizeInBytes() * 8); // we need the size in bits - // 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::lock_guard lg(mtx); @@ -89,8 +86,6 @@ auto Generator::do_crypto() -> std::string { std::memmove(&ctr, &G.ctr, ctr_length); try { - // fmt::print("plain text: {}\n", plain); - CTR_Mode::Encryption e; e.SetKeyWithIV(G.k,G.k.size(),ctr); @@ -116,20 +111,17 @@ auto Generator::do_crypto() -> std::string { new StringSink(encoded_c) ) // HexEncoder ); // StringSource - // fmt::print("cipher text: {}\n", encoded_c); return encoded_c; } auto Generator::generate_blocks(unsigned int k_blocks) -> std::string { assert ((G.ctr!=0) && "Counter is not 0, generator has been seeded"); - // fmt::print("k_blocks -> {}\n", k_blocks); // debugging std::string r{""}; for (int i = 0; i < k_blocks; ++i) { r += do_crypto(); ++G.ctr; } - // fmt::print("r from generate_blocks -> {}\n", r); // debugging return r; }