summaryrefslogtreecommitdiff
path: root/validat2.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-03-12 01:55:02 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-03-12 01:55:02 +0000
commitbf4ba7cc01a1d75740d32b745c3f4e17db57b0a8 (patch)
treef685c1b086ee63d0c359ab2deccad758bd6aae10 /validat2.cpp
parentca4f997e7673b4860afbae8ecae9bf4e086ed857 (diff)
downloadcryptopp-bf4ba7cc01a1d75740d32b745c3f4e17db57b0a8.tar.gz
from Jeffery Walton: move *.dat files into TestData, make Integer operator<< respect ios::uppercase flag
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@442 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'validat2.cpp')
-rw-r--r--validat2.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/validat2.cpp b/validat2.cpp
index 6ec6250..e752678 100644
--- a/validat2.cpp
+++ b/validat2.cpp
@@ -268,7 +268,7 @@ bool ValidateRSA()
"\x69\x94\xac\x04\xf3\x41\xb5\x7d\x05\x20\x2d\x42\x8f\xb2\xa2\x7b"
"\x5c\x77\xdf\xd9\xb1\x5b\xfc\x3d\x55\x93\x53\x50\x34\x10\xc1\xe1";
- FileSource keys("rsa512a.dat", true, new HexDecoder);
+ FileSource keys("TestData/rsa512a.dat", true, new HexDecoder);
Weak::RSASSA_PKCS1v15_MD2_Signer rsaPriv(keys);
Weak::RSASSA_PKCS1v15_MD2_Verifier rsaPub(rsaPriv);
@@ -293,7 +293,7 @@ bool ValidateRSA()
cout << "invalid signature verification\n";
}
{
- FileSource keys("rsa1024.dat", true, new HexDecoder);
+ FileSource keys("TestData/rsa1024.dat", true, new HexDecoder);
RSAES_PKCS1v15_Decryptor rsaPriv(keys);
RSAES_PKCS1v15_Encryptor rsaPub(rsaPriv);
@@ -320,8 +320,8 @@ bool ValidateRSA()
bq.Put(oaepSeed, 20);
FixedRNG rng(bq);
- FileSource privFile("rsa400pv.dat", true, new HexDecoder);
- FileSource pubFile("rsa400pb.dat", true, new HexDecoder);
+ FileSource privFile("TestData/rsa400pv.dat", true, new HexDecoder);
+ FileSource pubFile("TestData/rsa400pb.dat", true, new HexDecoder);
RSAES_OAEP_SHA_Decryptor rsaPriv;
rsaPriv.AccessKey().BERDecodePrivateKey(privFile, false, 0);
RSAES_OAEP_SHA_Encryptor rsaPub(pubFile);
@@ -344,7 +344,7 @@ bool ValidateDH()
{
cout << "\nDH validation suite running...\n\n";
- FileSource f("dh1024.dat", true, new HexDecoder());
+ FileSource f("TestData/dh1024.dat", true, new HexDecoder());
DH dh(f);
return SimpleKeyAgreementValidate(dh);
}
@@ -353,7 +353,7 @@ bool ValidateMQV()
{
cout << "\nMQV validation suite running...\n\n";
- FileSource f("mqv1024.dat", true, new HexDecoder());
+ FileSource f("TestData/mqv1024.dat", true, new HexDecoder());
MQV mqv(f);
return AuthenticatedKeyAgreementValidate(mqv);
}
@@ -362,7 +362,7 @@ bool ValidateLUC_DH()
{
cout << "\nLUC-DH validation suite running...\n\n";
- FileSource f("lucd512.dat", true, new HexDecoder());
+ FileSource f("TestData/lucd512.dat", true, new HexDecoder());
LUC_DH dh(f);
return SimpleKeyAgreementValidate(dh);
}
@@ -371,7 +371,7 @@ bool ValidateXTR_DH()
{
cout << "\nXTR-DH validation suite running...\n\n";
- FileSource f("xtrdh171.dat", true, new HexDecoder());
+ FileSource f("TestData/xtrdh171.dat", true, new HexDecoder());
XTR_DH dh(f);
return SimpleKeyAgreementValidate(dh);
}
@@ -381,7 +381,7 @@ bool ValidateElGamal()
cout << "\nElGamal validation suite running...\n\n";
bool pass = true;
{
- FileSource fc("elgc1024.dat", true, new HexDecoder);
+ FileSource fc("TestData/elgc1024.dat", true, new HexDecoder);
ElGamalDecryptor privC(fc);
ElGamalEncryptor pubC(privC);
privC.AccessKey().Precompute();
@@ -399,7 +399,7 @@ bool ValidateDLIES()
cout << "\nDLIES validation suite running...\n\n";
bool pass = true;
{
- FileSource fc("dlie1024.dat", true, new HexDecoder);
+ FileSource fc("TestData/dlie1024.dat", true, new HexDecoder);
DLIES<>::Decryptor privC(fc);
DLIES<>::Encryptor pubC(privC);
pass = CryptoSystemValidate(privC, pubC) && pass;
@@ -422,7 +422,7 @@ bool ValidateNR()
cout << "\nNR validation suite running...\n\n";
bool pass = true;
{
- FileSource f("nr2048.dat", true, new HexDecoder);
+ FileSource f("TestData/nr2048.dat", true, new HexDecoder);
NR<SHA>::Signer privS(f);
privS.AccessKey().Precompute();
NR<SHA>::Verifier pubS(privS);
@@ -445,7 +445,7 @@ bool ValidateDSA(bool thorough)
bool pass = true, fail;
{
- FileSource fs("dsa512.dat", true, new HexDecoder());
+ FileSource fs("TestData/dsa512.dat", true, new HexDecoder());
GDSA<SHA>::Signer priv(fs);
priv.AccessKey().Precompute(16);
GDSA<SHA>::Verifier pub(priv);
@@ -487,10 +487,10 @@ bool ValidateDSA(bool thorough)
fail = pub.VerifyMessage((byte *)"xyz", 3, sig, sizeof(sig));
pass = pass && !fail;
}
- FileSource fs1("dsa1024.dat", true, new HexDecoder());
+ FileSource fs1("TestData/dsa1024.dat", true, new HexDecoder());
DSA::Signer priv(fs1);
DSA::Verifier pub(priv);
- FileSource fs2("dsa1024b.dat", true, new HexDecoder());
+ FileSource fs2("TestData/dsa1024b.dat", true, new HexDecoder());
DSA::Verifier pub1(fs2);
assert(pub.GetKey() == pub1.GetKey());
pass = SignatureValidate(priv, pub, thorough) && pass;
@@ -503,7 +503,7 @@ bool ValidateLUC()
bool pass=true;
{
- FileSource f("luc1024.dat", true, new HexDecoder);
+ FileSource f("TestData/luc1024.dat", true, new HexDecoder);
LUCSSA_PKCS1v15_SHA_Signer priv(f);
LUCSSA_PKCS1v15_SHA_Verifier pub(priv);
pass = SignatureValidate(priv, pub) && pass;
@@ -520,14 +520,14 @@ bool ValidateLUC_DL()
{
cout << "\nLUC-HMP validation suite running...\n\n";
- FileSource f("lucs512.dat", true, new HexDecoder);
+ 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("lucc512.dat", true, new HexDecoder);
+ FileSource fc("TestData/lucc512.dat", true, new HexDecoder);
LUC_IES<>::Decryptor privC(fc);
LUC_IES<>::Encryptor pubC(privC);
pass = CryptoSystemValidate(privC, pubC) && pass;
@@ -541,7 +541,7 @@ bool ValidateRabin()
bool pass=true;
{
- FileSource f("rabi1024.dat", true, new HexDecoder);
+ FileSource f("TestData/rabi1024.dat", true, new HexDecoder);
RabinSS<PSSR, SHA>::Signer priv(f);
RabinSS<PSSR, SHA>::Verifier pub(priv);
pass = SignatureValidate(priv, pub) && pass;
@@ -558,7 +558,7 @@ bool ValidateRW()
{
cout << "\nRW validation suite running...\n\n";
- FileSource f("rw1024.dat", true, new HexDecoder);
+ FileSource f("TestData/rw1024.dat", true, new HexDecoder);
RWSS<PSSR, SHA>::Signer priv(f);
RWSS<PSSR, SHA>::Verifier pub(priv);
@@ -570,7 +570,7 @@ bool ValidateBlumGoldwasser()
{
cout << "\nBlumGoldwasser validation suite running...\n\n";
- FileSource f("blum512.dat", true, new HexDecoder);
+ FileSource f("TestData/blum512.dat", true, new HexDecoder);
BlumGoldwasserPrivateKey priv(f);
BlumGoldwasserPublicKey pub(priv);
@@ -614,7 +614,7 @@ bool ValidateECP()
pass = SimpleKeyAgreementValidate(ecdhc) && pass;
pass = AuthenticatedKeyAgreementValidate(ecmqvc) && pass;
- cout << "Testing SEC 2 recommended curves..." << endl;
+ cout << "Testing SEC 2, NIST, and Brainpool recommended curves..." << endl;
OID oid;
while (!(oid = DL_GroupParameters_EC<ECP>::GetNextRecommendedParametersOID(oid)).m_values.empty())
{
@@ -740,7 +740,7 @@ bool ValidateESIGN()
"\x74\x02\x37\x0E\xED\x0A\x06\xAD\xF4\x15\x65\xB8\xE1\xD1\x45\xAE\x39\x19\xB4\xFF\x5D\xF1\x45\x7B\xE0\xFE\x72\xED\x11\x92\x8F\x61\x41\x4F\x02\x00\xF2\x76\x6F\x7C"
"\x79\xA2\xE5\x52\x20\x5D\x97\x5E\xFE\x39\xAE\x21\x10\xFB\x35\xF4\x80\x81\x41\x13\xDD\xE8\x5F\xCA\x1E\x4F\xF8\x9B\xB2\x68\xFB\x28";
- FileSource keys("esig1536.dat", true, new HexDecoder);
+ FileSource keys("TestData/esig1536.dat", true, new HexDecoder);
ESIGN<SHA>::Signer signer(keys);
ESIGN<SHA>::Verifier verifier(signer);