I am trying to implement a custom AES CTR-mode encryption/decryption based on CryptoPP.
However, even the examples provided on their website throw an exception when the decryptor class is destroyed although encryption/decryption is successful. I have tried all the samples provided here that provides a destructor in the code.
This is what the debugger reports regarding the location of the exception:
I am using MinGW 12.
Some other algorithms such as MD5 work without and problems. Is there a specific bug for my compiler?
I've cleaned up caches and removed all compiler flags. Simply copy-pasting the code from the website into the main function throws the same exception.
Even a code as simple as the following throws:
#include <cryptopp/aes.h>
#include <cryptopp/modes.h>
using namespace CryptoPP;
int main (int argc, char* argv[]) {
using namespace CryptoPP;
SecByteBlock key(16), iv(16);
std::memset(key, 0xff, key.size());
std::memset( iv, 0x88, iv.size());
AES::Encryption aesDecryption(key, key.size());
CTR_Mode_ExternalCipher::Decryption ctrDecryption(aesDecryption, iv);
return 0;
}
