Interesting because after I asked this question I wrote the attached program using the AESPHM class from the Crypto++ User Guide.
I am using Crypto++ 4.2 with MSVC 6 Enterprise + SP5 + Processor Pack. I
have tried the below on 3 computers all with the same result.
My program when called with 'e' will encrypt a static string("Hio") using a
static key("111111111111111") and output the key and ciphertext into key.txt
and enc.txt respectively.
When called with 'd' the program will read in the key from key.txt and the
ciphertext from enc.txt and decrypt the ciphertext and output it to out.txt.
Next, I compiled the debug version and linked with the Debug build of
cryptopp. I ran the program through both encrypting and decrypting and in
out.txt I get "48696F" which is "Hio" which is the original plaintext.
Next, I compiled the release version and linked with the release build of
cryptopp. I ran the program through both encrypting and decrypting and in
out.txt I get "48696F" which is "Hio" which is the original plaintext.
Lastly, I took the release version and ran the encryption routine to
generate enc.txt and key.txt. Then I ran the debug version with 'd' to
decrypt the data. It produced NO exceptions yet produced a complete
different plaintext of 51DD0618A065A7AA6446F397 which is not only a
different plaintext but a completely different plaintext size.
I tried stepping through the debug app to see anywhere things get messed up
but I cannot find anything.
I do have NDEBUG defined in my Release builds.
This may be a problem with the AES PHM class so I have contacted Denis Bider
about this as well.
Any clues?
Michael Davis
Chief Technical Officer
DataNerds
http://www.datanerds.com
----- Original Message -----
From: "Wei Dai" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 11:16 AM
Subject: Re: Crash in Release Build
> On Tue, Dec 10, 2002 at 11:13:00PM -0600, Michael Davis wrote:
> > By having to define NDEBUG in our individual applications does that mean
> > that encrypting with the debug version of cryptopp may not be compatible
> > with decrypting using the release version of cryptopp?
>
> The debug and release versions of Crypto++ are compatible (assuming no
compiler
> optimization bugs).
>
>
cryptppTest.zip
Description: Zip compressed data
