Remove EncryptBlockCipher

The test mode EncryptBlockCipher is not needed. datatest.cpp is versatile enough to handle variable block sizes under test mode Encrypt
This commit is contained in:
Jeffrey Walton 2017-05-10 13:50:36 -04:00
parent 3bee1f57cf
commit 0de44edde1
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 4 additions and 5 deletions

View File

@ -82,6 +82,5 @@ NotVerify - signature/digest/MAC verification should not pass
DeterministicSign - sign message using given seed, and the resulting
signature should equal the given signature
Encrypt - plaintext encrypts to ciphertext
EncryptBlockSize - plaintext encrypts to ciphertext under a key and blocksize
DecryptMatch - ciphertext decrypts to plaintext
(more to come here)

View File

@ -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)

View File

@ -135,6 +135,7 @@ void RegisterFactories2()
RegisterSymmetricCipherDefaultFactories<ECB_Mode<SEED> >();
RegisterSymmetricCipherDefaultFactories<CTR_Mode<SEED> >();
RegisterSymmetricCipherDefaultFactories<ECB_Mode<Kalyna> >(); // Test Vectors
RegisterSymmetricCipherDefaultFactories<CBC_Mode<Kalyna> >(); // Test Vectors
RegisterSymmetricCipherDefaultFactories<CTR_Mode<Kalyna> >(); // Benchmarks
RegisterDefaultFactoryFor<KeyDerivationFunction, HKDF<SHA1> >();