我在加密+是新的,我需要做一些操作与我的字符串和整数(称之为散列函数和MAC的功能)我看到这个 Using Crypto++ to generate random hashes with SHA1并试图跟随它调试断言失败
。
我做了新的项目,编译cryptolibs,链接它们(我想,没错,因为没有链接器错误)。它建立好,但从主要回报我有这个:
DEBUG ASSERTION FAILED! ... blablabla/dbgdel.cpp线52
表达:_Block_Type_Is_Valid(pHead-> nBlockUse)...
我弄得像在评论这些岗位,所以我不明白,为什么它发生。
代码(包括像地址,因为我真的很懒惰,使在连接好链接):
#include <C:\Users\esselesse\Documents\Visual Studio 2010\Projects\InfoProtect_Biometrics_Auth_Algorithm\InfoProtect_Biometrics_Auth_Algorithm\LIB\sha.h>
#include <C:\Users\esselesse\Documents\Visual Studio 2010\Projects\InfoProtect_Biometrics_Auth_Algorithm\InfoProtect_Biometrics_Auth_Algorithm\LIB\filters.h>
#include <C:\Users\esselesse\Documents\Visual Studio 2010\Projects\InfoProtect_Biometrics_Auth_Algorithm\InfoProtect_Biometrics_Auth_Algorithm\LIB\hex.h>
#include <iostream>
#include <string>
using namespace CryptoPP;
using namespace std;
int main()
{
SHA1 sha1;
string source = "Hello"; //This will be randomly generated somehow
string hash = "";
StringSource(source, true, new HashFilter(sha1, new HexEncoder(new StringSink(hash))));
}
哇,谢谢你!有用) –