Exemplo n.º 1
0
bool ValidateNR()
{
	cout << "\nNR validation suite running...\n\n";
	bool pass = true;
	{
		FileSource f("TestData/nr2048.dat", true, new HexDecoder);
		NR<SHA>::Signer privS(f);
		privS.AccessKey().Precompute();
		NR<SHA>::Verifier pubS(privS);

		pass = SignatureValidate(privS, pubS) && pass;
	}
	{
		cout << "Generating new signature key..." << endl;
		NR<SHA>::Signer privS(GlobalRNG(), 256);
		NR<SHA>::Verifier pubS(privS);

		pass = SignatureValidate(privS, pubS) && pass;
	}
	return pass;
}
Exemplo n.º 2
0
bool ValidateLUC_DL(const byte *input, const size_t inputLength, const int secLevelIndex)
{
	string description = generateDetailedDescription("LUC-DL", securityLevels[secLevelIndex], 
		finiteFieldSizes[secLevelIndex], inputLength);

	LUC_HMP<SHA>::Signer privS(GlobalRNG(), finiteFieldSizes[secLevelIndex]);
	LUC_HMP<SHA>::Verifier pubS(privS);
	bool pass = ProfileSignatureValidate(privS, pubS, input, inputLength, description);
	assert(pass);

	return pass;
}
Exemplo n.º 3
0
bool ValidateNR(const byte *input, const size_t inputLength, const int secLevelIndex)
{
	string description = generateDetailedDescription("NR", securityLevels[secLevelIndex], 
		factorizationGroupSizes[secLevelIndex], inputLength);

	NR<SHA>::Signer privS(GlobalRNG(), finiteFieldSubgroupSizes[secLevelIndex]);
	privS.AccessKey().Precompute();
	NR<SHA>::Verifier pubS(privS);

	bool pass = ProfileSignatureValidate(privS, pubS, input, inputLength, description);
	assert(pass);
	return pass;
}
Exemplo n.º 4
0
bool NRValidate()
{
	cout << "\nNR validation suite running...\n\n";
	bool pass = true;
	{
		FileSource f("nr2048.dat", true, new HexDecoder);
		NRSigner<SHA> privS(f);
		privS.Precompute();
		NRVerifier<SHA> pubS(privS);

		pass = SignatureValidate(privS, pubS) && pass;
	}
	{
		LC_RNG rng(4781);
		cout << "Generating new signature key..." << endl;
		NRSigner<SHA> privS(rng, 256);
		NRVerifier<SHA> pubS(privS);

		pass = SignatureValidate(privS, pubS) && pass;
	}
	return pass;
}
Exemplo n.º 5
0
bool ValidateLUC_DL()
{
	cout << "\nLUC-HMP validation suite running...\n\n";

	FileSource f("TestData/lucs512.dat", true, new HexDecoder);
	LUC_HMP<SHA>::Signer privS(f);
	LUC_HMP<SHA>::Verifier pubS(privS);
	bool pass = SignatureValidate(privS, pubS);

	cout << "\nLUC-IES validation suite running...\n\n";

	FileSource fc("TestData/lucc512.dat", true, new HexDecoder);
	LUC_IES<>::Decryptor privC(fc);
	LUC_IES<>::Encryptor pubC(privC);
	pass = CryptoSystemValidate(privC, pubC) && pass;

	return pass;
}
Exemplo n.º 6
0
bool LUCELGValidate()
{
	cout << "\nLUCELG validation suite running...\n\n";

	FileSource f("lucs512.dat", true, new HexDecoder);
	LUCELG_Signer<SHA> privS(f);
	LUCELG_Verifier<SHA> pubS(privS);

	bool pass = SignatureValidate(privS, pubS);

	FileSource fc("lucc512.dat", true, new HexDecoder);
	LUCELG_Decryptor privC(fc);
	LUCELG_Encryptor pubC(privC);

	pass = CryptoSystemValidate(privC, pubC) && pass;

	return pass;
}