I don't see anything obviously wrong. Unless someone else has run into this before and can help you out, you may have to step into the Crypto++ code in a debugger and see what's going on inside. I'm guessing there might be something wrong with the std::string implementation. I unfortunately don't have access to Macs anymore. In the future please post OS version, and what compiler you're using when asking for help.
On Fri, Feb 28, 2003 at 02:07:05PM -0800, Lawrence Horwitz wrote: > I'm using Crypto 4.2 on both the Mac and the PC, doing > some cross-platform stuff, and I have a bit of code > that works fine on the PC but goes kablooie on the > Mac. Here's the code: > > std::string dehexCipherText; > > CryptoPP::HexDecoder output(new > CryptoPP::StringSink(dehexCipherText)); > > // Here is where the problem occurs. This next line > should fill dehexCipherText with the dehexed > // text, and it does so on the PC side. However, on > the Mac side, dehexCipherText remains > // empty > // hexEncryptedText is a std::string containing some > hex text > > output.Put((byte*)hexEncryptedText.c_str(),hexEncryptedText.length()); > > The program then marches on, tries to decrypt the > empty dehexCipherText string, and goes kablooie. Am I > doing something wrong in those two lines of code? > Could I have perhaps compiled the program incorrectly > on the Mac side? Any ideas? Help! > > Lawrence Horwitz > > __________________________________________________ > Do you Yahoo!? > Yahoo! Tax Center - forms, calculators, tips, more > http://taxes.yahoo.com/
