I'm not sure whether CryptoPP::DoDllPowerUpSelfTest() is actually
called by default when you load the DLL.
Since you're in Visual Studio, why don't you set a breakpoint on that
function, and step through the self-test and see where it fails?
Or perhaps you need to call it yourself.
On Jul 26, 8:06 am, soeren <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I just started with Crypto++ and d'led the current 5.5.1 version.
> Basically I need it for somple simple RSA and message signing stuff. I
> had severe trouble to get the static lib linked against another
> project that produces an dll, lots of double symbols between the
> cryptlib.lib and my own dll so I decided to use the FIPS140-dll
> version.
> However, after starting with a very simple test programm I can see it
> failing for an unknown reason. I used "GetPowerUpSelfTestStatus" to
> get somewhat closer to this problem and - voila - it failed ?!
> Basically my test programm looks like this:
>
> ===============================================================
> #include "cryptopp/dll.h"
>
> #include <string>
>
> using namespace std;
> using namespace CryptoPP;
>
> int main(int argc, char *argv[]) {
>
> // COPIED FROM "dlltest.cpp"; test is valid
> if (!FIPS_140_2_ComplianceEnabled())
> {
> cerr << "FIPS 140-2 compliance was turned off at compile
> time.\n";
> abort();
> }
>
> // COPIED FROM "dlltest.cpp"; test fails - why?
> if (GetPowerUpSelfTestStatus() != POWER_UP_SELF_TEST_PASSED)
> {
> cerr << "Automatic power-up self test failed.\n";
> abort();
> }
> cout << "0. Automatic power-up self test passed.\n";
>
> // defining some dummy stuff
> const string seed = "1234567890";
> const string privFilename = "my_private_key.txt";
> const string pubFilename = "my_public_key.txt";
> const int keyLength = 1024;
>
> RandomPool randPool;
> randPool.IncorporateEntropy((byte *)seed.c_str(), seed.length());
>
> RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength);
> BaseN_Encoder privFile(new FileSink(privFilename.c_str()));
> priv.DEREncode(privFile);
> privFile.MessageEnd();
>
> RSAES_OAEP_SHA_Encryptor pub(priv);
> BaseN_Encoder pubFile(new FileSink(pubFilename.c_str()));
> pub.DEREncode(pubFile);
> pubFile.MessageEnd();
>
> };
>
> ===============================================================
>
> So really straight forward and it's main purpose is to test the dll
> linking. Compiling and linking runs without a single warning/error but
> it fails in GetPowerUpSelfTestStatus. If I ignore this some memory
> exception type (sthe stack ends in the file "xstring") while pop up
> when creating the "randPool" object.
>
> The above programm is compiled into a console WIN32 application and
> all the Crypto++ projects have been compiled out-of-the-box without
> any single change.
>
> Thanks in advance for any helpfull hand,
> Soeren Gerlach
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---