On Tuesday, February 8, 2022 at 2:16:31 PM UTC-5 Jeffrey Walton wrote:

> Hi Everyone,
> strciphr.cpp has a couple of classes that gave us trouble in the past. The 
> class functions were CFB_CipherTemplate<BASE>::ProcessData and 
> AdditiveCipherTemplate<S>::ProcessData. The classes encrypt or decrypt a 
> byte string:
>     ProcessData(byte* outString, const byte* inString, size_t length);
> The problem arose because of in-place encryption or decryption (lots of 
> hand waiving):
>     std::string str = "Super secret information";
>     ...
>     ProcessData(&str[0], &str[0], str.size());
> Clang and GCC started removing writes to outString due to alias violation. 
> Or I think it was alias violations.
> Initially we cut-in a separate buffer for the classes and then performed a 
> memcpy. That crushed performance per GH #1010 on some platforms.
> We recently removed the separate buffer and memcpy to restore performance. 
> We are now testing a volatile pointer to tame the optimizer. Testing is Ok 
> on the platforms that caused us troubles in the past.
> If you have some time, please test the "strciphr" branch of Crypto++ and 
> report any troubles you encounter. Here are the steps:
>     $ git clone https://github.com/weidai11/cryptopp cryptopp-strciphr
>     $ cd cryptopp-strciphr
>     $ git checkout strciphr
>     $ make -j 4 && ./cryptest.exe v && ./cryptest.exe tv all
> Please report any failures.

I'm going to merge this into master for more testing.

We will probably be releasing Crypto++ 8.7 next weekend. Testing is 


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 

Reply via email to