diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2006-12-14 11:41:39 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2006-12-14 11:41:39 +0000 |
commit | 085c5b2d0b70a2ff3d9ccf8616a7bdf4abbc957f (patch) | |
tree | be3960f1424e79719ea9c5f6152df003bc1c44f3 /datatest.cpp | |
parent | 60b7db799a5d9d607dba4b9a66c4421bb60f2577 (diff) | |
download | cryptopp-085c5b2d0b70a2ff3d9ccf8616a7bdf4abbc957f.tar.gz |
port to Borland C++Builder 2006
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@260 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'datatest.cpp')
-rw-r--r-- | datatest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/datatest.cpp b/datatest.cpp index 4a2d950..1942326 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -264,6 +264,9 @@ void TestSymmetricCipher(TestData &v) if (test == "Encrypt") { std::auto_ptr<SymmetricCipher> encryptor(ObjectFactoryRegistry<SymmetricCipher, ENCRYPTION>::Registry().CreateObject(name.c_str())); + ConstByteArrayParameter iv; + if (pairs.GetValue(Name::IV(), iv) && iv.size() != encryptor->IVSize()) + SignalTestFailure(); encryptor->SetKey((const byte *)key.data(), key.size(), pairs); int seek = pairs.GetIntValueWithDefault("Seek", 0); if (seek) @@ -276,6 +279,9 @@ void TestSymmetricCipher(TestData &v) else if (test == "Decrypt") { std::auto_ptr<SymmetricCipher> decryptor(ObjectFactoryRegistry<SymmetricCipher, DECRYPTION>::Registry().CreateObject(name.c_str())); + ConstByteArrayParameter iv; + if (pairs.GetValue(Name::IV(), iv) && iv.size() != decryptor->IVSize()) + SignalTestFailure(); decryptor->SetKey((const byte *)key.data(), key.size(), pairs); int seek = pairs.GetIntValueWithDefault("Seek", 0); if (seek) |