Can't access key in 64-bit DLL builds

2 views
Skip to first unread message

Ivo Stoyanoff

unread,
Dec 15, 2007, 12:32:54 PM12/15/07
to Crypto++ Users
I am trying RSA examples - everything works in 32-bit mode / DLL.
When trying the same code in x64 mode I am getting "bad_alloc" errors

RSAES_OAEP_SHA_Decryptor key(rng, keybits);
string privKey;
// fails on x64?
key.AccessKey().Save(HexEncoder(new StringSink(privKey)));
...
//// Generated Parameters
Integer n = rsa.GetModulus();
// Dump
cout << "RSA Parameters:" << endl;
cout << " e: " << e << endl;
// fails on x64?
cout << " m: " << n << endl;
...

Jeffrey Walton

unread,
Dec 15, 2007, 1:43:42 PM12/15/07
to Ivo Stoyanoff, Crypto++ Users
Hi Ivo,

I can't say I have any x64 time, so this may not be very useful. If
you are simply creating and dumping keys at this point, use
InvertibleRSAFunction. It will take the encryptor and decryptor
objects out of the mix:

InvertibleRSAFunction keys;
keys.Initialize(...);

See http://www.cryptopp.com/docs/ref/class_invertible_r_s_a_function.html.

Jeff

Reply all
Reply to author
Forward
0 new messages