Closed artvabasDev closed 8 months ago
I can't duplicate with the following program built with -DDEBUG -g3 -O0
. The library was also built with the same flags.
$ cat test.cxx
#include "cryptlib.h"
#include "osrng.h"
#include "rsa.h"
int main(int argc, char* argv[])
{
using namespace CryptoPP;
AutoSeededRandomPool prng;
RSA::PrivateKey privateKey;
privateKey.GenerateRandomWithKeySize(prng, 2048);
RSA::PublicKey publicKey(privateKey);
return 0;
}
There's probably something wrong with your program.
Still strange that the same code in release is working just fine and in debug not. Have a workaround now, in debug using plain text in release encrypted.
Thanks for you effort.
I experienced this issue about 8 or 10 years ago on OS X. If I recall correctly, there was a global static, and for some reason, it was triggering the unused parameter exception. I never figured out what was sideways.
Like to report a debug build error, hopefully you can solve this, its a bit unhandy to develop an application when you're not able to build it for debugging,
Using cryptopp version 8.9 with Visual Studio 2022 in a MFC application.
When I build this piece of code in debug mode:
When executing line: privateKey.GenerateRandomWithKeySize(rng, 2048); I got the following debug message:
Unhandled exception at 0x00007FF73F1F31FC An invalid parameter was passed to a function that considers invalid parameters fatal.
And Visual Studio 2022 is showing:
And stop at: __fastfail(FAST_FAIL_INVALID_ARG);.
While the same piece of code when building in release mode is working just fine.
I use the debug version of cryptlib.lib for building in debug mode and the release version for building in release mode.