Hi Jeff,

The time is taken up all on the one line:


StringSource ss(message, true, new StreamTransformationFilter(e, new 
StringSink(cipher)));


*Do you know what might be the difference versus the .exe test ?    
<TR><TD>AES/CFB (128-bit key)<TD>ARMv8<TD>344<TD>4.99<TD>1.135<TD>2044*



Encrypted 1at: 05/12/2023 15:40:55.588
 Encrypted 2at: 05/12/2023 15:40:55.588
 Encrypted 3at: 05/12/2023 15:40:55.588
returning cipher 
 Encrypted 4at: 05/12/2023 15:40:56.599
 Encrypted at: 05/12/2023 15:40:56.600


std::string encrypt_aes(std::string message, SecByteBlock key, SecByteBlock 
iv) {
try {
cout <<" in encrypt aes " <<endl;
cout << " Encrypted 1at: " << get_curr_datetime_str() << endl;
AlgorithmParameters params = MakeParameters(Name::FeedbackSize(), 1
/*8-bits*/)
(Name::IV(), ConstByteArrayParameter(iv));
cout << " Encrypted 2at: " << get_curr_datetime_str() << endl;
CFB_Mode<AES>::Encryption e;
std::string cipher;
cipher.reserve(message.size()+16); 
e.SetKey(key, key.size(), params);
cout << " Encrypted 3at: " << get_curr_datetime_str() << endl;
StringSource ss(message, true, new StreamTransformationFilter(e, new 
StringSink(cipher)));
cout << " returning cipher " << endl;
cout << " Encrypted 4at: " << get_curr_datetime_str() << endl;
return cipher;
}
catch (CryptoPP::Exception e) {
std::cerr << e.what() << std::endl;
return "";
}
}
On Friday, May 12, 2023 at 11:17:32 AM UTC-4 Jeffrey Walton wrote:

> On Fri, May 12, 2023 at 10:48 AM Dwight Kulkarni <dwi...@realtime-7.com> 
> wrote:
> >
> > The new library is much faster, but I am still not getting that speed in 
> the code. 1 second to encrypt 5 mb versus 3 seconds before.
> >
> > I added the .reserve(...) code also.
>
> Well, you should profile your code to find the bottlenecks.
>
> Jeff
>

-- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/e51a4bd3-8196-4ac4-8a95-1e8dd58fa5fcn%40googlegroups.com.

Reply via email to