summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-05-10 13:50:36 -0400
committerJeffrey Walton <noloader@gmail.com>2017-05-10 13:50:36 -0400
commit0de44edde1d623388fff567bc69cefae884ceba0 (patch)
tree35a45e923f64ab8a4c2f2c5d9f2b280be0dc9c7d /datatest.cpp
parent3bee1f57cf9b5f7fe309692d1e13239d1b23b4e2 (diff)
downloadcryptopp-git-0de44edde1d623388fff567bc69cefae884ceba0.tar.gz
Remove EncryptBlockCipher
The test mode EncryptBlockCipher is not needed. datatest.cpp is versatile enough to handle variable block sizes under test mode Encrypt
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/datatest.cpp b/datatest.cpp
index 95f7da3b..5289642c 100644
--- a/datatest.cpp
+++ b/datatest.cpp
@@ -363,7 +363,7 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters)
TestDataNameValuePairs testDataPairs(v);
CombinedNameValuePairs pairs(overrideParameters, testDataPairs);
- if (test == "Encrypt" || test == "EncryptBlockSize" || test == "EncryptXorDigest" || test == "Resync" || test == "EncryptionMCT" || test == "DecryptionMCT")
+ if (test == "Encrypt" || test == "EncryptXorDigest" || test == "Resync" || test == "EncryptionMCT" || test == "DecryptionMCT")
{
static member_ptr<SymmetricCipher> encryptor, decryptor;
static std::string lastName;
@@ -375,9 +375,8 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters)
lastName = name;
}
- int blockSize = 0;
- if (test == "EncryptBlockSize" && !pairs.GetValue(Name::BlockSize(), blockSize))
- SignalTestFailure();
+ // Most block ciphers don't specify this. Kalyna and Threefish use it.
+ int blockSize = pairs.GetIntValueWithDefault(Name::BlockSize(), 0);
ConstByteArrayParameter iv;
if (pairs.GetValue(Name::IV(), iv) && iv.size() != encryptor->IVSize() && (int)iv.size() != blockSize)