parent
7226abd433
commit
a749296504
4
test.cpp
4
test.cpp
|
|
@ -922,6 +922,10 @@ bool Validate(int alg, bool thorough, const char *seedInput)
|
||||||
case 9994: result = TestHuffmanCodes(); break;
|
case 9994: result = TestHuffmanCodes(); break;
|
||||||
// http://github.com/weidai11/cryptopp/issues/346
|
// http://github.com/weidai11/cryptopp/issues/346
|
||||||
case 9993: result = TestASN1Parse(); break;
|
case 9993: result = TestASN1Parse(); break;
|
||||||
|
// http://github.com/weidai11/cryptopp/issues/242
|
||||||
|
case 9992: result = TestX25519(); break;
|
||||||
|
// http://github.com/weidai11/cryptopp/issues/346
|
||||||
|
case 9991: result = TestEd25519(); break;
|
||||||
# if defined(CRYPTOPP_ALTIVEC_AVAILABLE)
|
# if defined(CRYPTOPP_ALTIVEC_AVAILABLE)
|
||||||
case 9992: result = TestAltivecOps(); break;
|
case 9992: result = TestAltivecOps(); break;
|
||||||
# endif
|
# endif
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ bool ValidateAll(bool thorough)
|
||||||
pass=TestSharing() && pass;
|
pass=TestSharing() && pass;
|
||||||
pass=TestEncryptors() && pass;
|
pass=TestEncryptors() && pass;
|
||||||
pass=TestX25519() && pass;
|
pass=TestX25519() && pass;
|
||||||
|
pass=TestEd25519() && pass;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pass=ValidateCRC32() && pass;
|
pass=ValidateCRC32() && pass;
|
||||||
|
|
|
||||||
41
validat7.cpp
41
validat7.cpp
|
|
@ -366,11 +366,24 @@ bool TestX25519()
|
||||||
bool pass = true;
|
bool pass = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
x25519 x1(FileSource(DataDir("TestData/x25519.dat").c_str(), true).Ref());
|
|
||||||
x25519 x2(FileSource(DataDir("TestData/x25519v0.dat").c_str(), true).Ref());
|
FileSource f1(DataDir("TestData/x25519.dat").c_str(), true, new HexDecoder);
|
||||||
x25519 x3(FileSource(DataDir("TestData/x25519v1.dat").c_str(), true).Ref());
|
FileSource f2(DataDir("TestData/x25519v0.dat").c_str(), true, new HexDecoder);
|
||||||
|
FileSource f3(DataDir("TestData/x25519v1.dat").c_str(), true, new HexDecoder);
|
||||||
|
|
||||||
|
x25519 x1(f1);
|
||||||
|
x25519 x2(f2);
|
||||||
|
x25519 x3(f3);
|
||||||
|
|
||||||
|
FileSource f4(DataDir("TestData/x25519.dat").c_str(), true, new HexDecoder);
|
||||||
|
FileSource f5(DataDir("TestData/x25519v0.dat").c_str(), true, new HexDecoder);
|
||||||
|
FileSource f6(DataDir("TestData/x25519v1.dat").c_str(), true, new HexDecoder);
|
||||||
|
|
||||||
|
x1.Load(f4);
|
||||||
|
x2.Load(f5);
|
||||||
|
x3.Load(f6);
|
||||||
}
|
}
|
||||||
catch (BERDecodeErr&) {
|
catch (const BERDecodeErr&) {
|
||||||
pass = false;
|
pass = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -424,11 +437,23 @@ bool TestEd25519()
|
||||||
bool pass = true;
|
bool pass = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ed25519::Signer s1(FileSource(DataDir("TestData/ed25519.dat").c_str(), true).Ref());
|
FileSource f1(DataDir("TestData/ed25519.dat").c_str(), true, new HexDecoder);
|
||||||
ed25519::Signer s2(FileSource(DataDir("TestData/ed25519v0.dat").c_str(), true).Ref());
|
FileSource f2(DataDir("TestData/ed25519v0.dat").c_str(), true, new HexDecoder);
|
||||||
ed25519::Signer s3(FileSource(DataDir("TestData/ed25519v1.dat").c_str(), true).Ref());
|
FileSource f3(DataDir("TestData/ed25519v1.dat").c_str(), true, new HexDecoder);
|
||||||
|
|
||||||
|
ed25519::Signer s1(f1);
|
||||||
|
ed25519::Signer s2(f2);
|
||||||
|
ed25519::Signer s3(f3);
|
||||||
|
|
||||||
|
FileSource f4(DataDir("TestData/ed25519.dat").c_str(), true, new HexDecoder);
|
||||||
|
FileSource f5(DataDir("TestData/ed25519v0.dat").c_str(), true, new HexDecoder);
|
||||||
|
FileSource f6(DataDir("TestData/ed25519v1.dat").c_str(), true, new HexDecoder);
|
||||||
|
|
||||||
|
s1.AccessKey().Load(f4);
|
||||||
|
s2.AccessKey().Load(f5);
|
||||||
|
s3.AccessKey().Load(f6);
|
||||||
}
|
}
|
||||||
catch (BERDecodeErr&) {
|
catch (const BERDecodeErr&) {
|
||||||
pass = false;
|
pass = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue