generator: rm using directives,use CryptoPP prefix
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
e7cce999a0
commit
8827582f90
|
@ -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<Serpent>::Encryption e;
|
||||
CryptoPP::CTR_Mode<CryptoPP::Serpent>::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
|
||||
|
||||
|
|
Reference in New Issue