summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-19 17:59:30 -0400
committerJeffrey Walton <noloader@gmail.com>2021-03-19 17:59:30 -0400
commitf69ec3c75c9f5bfe77c6b38fc9aaaade6e15d848 (patch)
tree22c238dfb04f3452a7483c73b1534fadafa44a41 /datatest.cpp
parent5a587fedec11fdbef4b6d59d65e5ddd5f5db2493 (diff)
downloadcryptopp-git-f69ec3c75c9f5bfe77c6b38fc9aaaade6e15d848.tar.gz
Update datatest.cpp
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/datatest.cpp b/datatest.cpp
index 25ee86b8..70bdd546 100644
--- a/datatest.cpp
+++ b/datatest.cpp
@@ -579,12 +579,6 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters,
(void)decryptor->DefaultKeyLength();
}
- // Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it in test vectors.
- // 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding, 3 is OneAndZerosPadding, etc
- // Note: The machinery is wired such that paddingScheme is effectively latched. An
- // old paddingScheme may be unintentionally used in a subsequent test.
- int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
-
ConstByteArrayParameter iv;
if (pairs.GetValue(Name::IV(), iv) && iv.size() != encryptor->IVSize())
SignalTestFailure();
@@ -616,6 +610,13 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters,
}
}
+ // Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it
+ // in test vectors. 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding,
+ // 3 is OneAndZerosPadding, etc. Note: The machinery is wired such that
+ // paddingScheme is effectively latched. An old paddingScheme may be
+ // unintentionally used in a subsequent test.
+ int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
+
// If a per-test vector parameter was set for a test, like BlockPadding,
// BlockSize or Tweak, then it becomes latched in testDataPairs. The old
// value is used in subsequent tests, and it could cause a self test
@@ -761,12 +762,6 @@ void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overri
(void)decryptor->DefaultKeyLength();
}
- // Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it in test vectors.
- // 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding, 3 is OneAndZerosPadding, etc
- // Note: The machinery is wired such that paddingScheme is effectively latched. An
- // old paddingScheme may be unintentionally used in a subsequent test.
- int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
-
ConstByteArrayParameter iv;
if (pairs.GetValue(Name::IV(), iv) && iv.size() != encryptor->IVSize())
SignalTestFailure();
@@ -790,6 +785,13 @@ void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overri
}
}
+ // Most block ciphers don't specify BlockPaddingScheme. Kalyna uses it
+ // in test vectors. 0 is NoPadding, 1 is ZerosPadding, 2 is PkcsPadding,
+ // 3 is OneAndZerosPadding, etc. Note: The machinery is wired such that
+ // paddingScheme is effectively latched. An old paddingScheme may be
+ // unintentionally used in a subsequent test.
+ int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
+
// If a per-test vector parameter was set for a test, like BlockPadding,
// BlockSize or Tweak, then it becomes latched in testDataPairs. The old
// value is used in subsequent tests, and it could cause a self test