I'm having some trouble with Crypto++ 5.1 (vs2003 patch applied) crashing on
me. test1.cpp (attached) crashes with:
Assertion failed: p == m_array, file \crypto51\secblock.h, line 155
This occurs when using either icl 7.1 or vc 7.1.
Wei Dai suggested that this may be due to a bug related to using only a
single hash as detailed here:
http://www.escribe.com/software/crypto/m3080.html
But this seems unlikely since test2.cpp (also attached) uses two hashes and
fails in the exact same way. If panama is removed, the single hash MD5 runs
fine. Again, both compilers produce the same results.
Also included is test3.cpp which is unrelated and attempts to gzip a file.
It fails in the same manner as the above two examples, again regardless of
compiler used.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Intel(R) C++ Compiler for 32-bit applications, Version 7.1 Build 20030609Z
Win2000 SP4
#include <iostream>
#include "..\crypto51\files.h"
#include "..\crypto51\gzip.h"
using namespace CryptoPP;
using namespace std;
void GzipFile(const char *filein, const char *fileout)
{
FileSource f(filein, true, new Gzip(new FileSink(fileout)));
}
int main(int argc, char *argv[])
{
GzipFile(argv[1], argv[2]);
}
#include <iostream>
#include "..\crypto51\md5.h"
#include "..\crypto51\panama.h"
#include "..\crypto51\files.h"
#include "..\crypto51\hex.h"
#include "..\crypto51\ida.h"
#include "..\crypto51\hrtimer.h"
using namespace CryptoPP;
using namespace std;
void DigestFile(const char *filename)
{
MD5 md5;
PanamaHash<LittleEndian> panamaLE;
HashFilter md5Filter(md5), panamaFilter(panamaLE);
auto_ptr<ChannelSwitch> channelSwitch(new ChannelSwitch);
channelSwitch->AddDefaultRoute(md5Filter);
channelSwitch->AddDefaultRoute(panamaFilter);
FileSource(filename, true, channelSwitch.release());
HexEncoder encoder(new FileSink(cout), false);
cout << "\nMD5: "; md5Filter.TransferTo(encoder);
cout << "\nPanama: "; panamaFilter.TransferTo(encoder);
}
int main(int argc, char *argv[])
{
DigestFile(argv[argc-1]);
return 0;
}#include <iostream>
#include "..\crypto51\files.h"
#include "..\crypto51\hex.h"
#include "..\crypto51\ida.h"
#include "..\crypto51\panama.h"
using namespace CryptoPP;
using namespace std;
void DigestFile(const char *filename)
{
PanamaHash<LittleEndian> panamaLE;
HashFilter panamaFilter(panamaLE);
auto_ptr<ChannelSwitch> channelSwitch(new ChannelSwitch);
channelSwitch->AddDefaultRoute(panamaFilter);
FileSource(filename, true, channelSwitch.release());
HexEncoder encoder(new FileSink(cout), false);
cout << "\nPanama: ";
panamaFilter.TransferTo(encoder);
}
int main(int argc, char *argv[])
{
DigestFile(argv[argc-1]);
return 0;
}