From 8827582f9075bb897a34902a2a2e1648ed5dd424 Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 8 Jan 2022 07:30:31 +0100 Subject: [PATCH] generator: rm using directives,use CryptoPP prefix --- generator.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/generator.cpp b/generator.cpp index 43d9ff4..eb8b8b7 100644 --- a/generator.cpp +++ b/generator.cpp @@ -75,12 +75,6 @@ auto Generator::do_crypto() -> std::string { // for the moment loosely based on // https://www.cryptopp.com/wiki/CTR_Mode - using CryptoPP::StringSource; - using CryptoPP::StringSink; - using CryptoPP::HexEncoder; - using CryptoPP::StreamTransformationFilter; - using CryptoPP::Serpent; - using CryptoPP::CTR_Mode; // William Shakespeare, Romeo and Juliet std::string plain{"Oh, I am fortune's fool!"}; @@ -93,7 +87,7 @@ auto Generator::do_crypto() -> std::string { std::memmove(ctr, str_ctr.c_str(), ctr_length); try { - CTR_Mode::Encryption e; + CryptoPP::CTR_Mode::Encryption e; e.SetKeyWithIV(G.k,G.k.size(),ctr); // The StreamTransformationFilter adds padding as required. ECB and @@ -101,9 +95,9 @@ auto Generator::do_crypto() -> std::string { // mode not. // the "true" param - pump all of the data immediately to its // attached transformation - StringSource str_src1(plain,true, - new StreamTransformationFilter(e, - new StringSink(cipher) + CryptoPP::StringSource str_src1(plain,true, + new CryptoPP::StreamTransformationFilter(e, + new CryptoPP::StringSink(cipher) ) // StreamTransformationFilter ); // StringSource } @@ -113,9 +107,9 @@ auto Generator::do_crypto() -> std::string { } // Pretty print cipher text - StringSource str_src2(cipher,true, - new HexEncoder( - new StringSink(encoded_c) + CryptoPP::StringSource str_src2(cipher,true, + new CryptoPP::HexEncoder( + new CryptoPP::StringSink(encoded_c) ) // HexEncoder ); // StringSource