summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-18 04:34:48 -0400
committerJeffrey Walton <noloader@gmail.com>2021-03-18 04:34:48 -0400
commit9f046c27689c943018f89aef74954a24fc36bd33 (patch)
treeaa5faeb2d156738a695eb51c77a68a3b43956ef2 /datatest.cpp
parent0c412ee90025ab191463aaa43a90975d2890dc7c (diff)
downloadcryptopp-git-9f046c27689c943018f89aef74954a24fc36bd33.tar.gz
Update datatest.cpp
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/datatest.cpp b/datatest.cpp
index 798a13c8..bc85d227 100644
--- a/datatest.cpp
+++ b/datatest.cpp
@@ -484,7 +484,7 @@ 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.
+ // old paddingScheme may be unintentionally used in a subsequent test.
int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
ConstByteArrayParameter iv;
@@ -623,6 +623,7 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters)
}
}
+// TODO: figure out what is going on with chacha_tls.
void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overrideParameters)
{
std::string name = GetRequiredDatum(v, "Name");
@@ -662,7 +663,7 @@ 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.
+ // old paddingScheme may be unintentionally used in a subsequent test.
int paddingScheme = pairs.GetIntValueWithDefault(Name::BlockPaddingScheme(), 0);
ConstByteArrayParameter iv;
@@ -708,11 +709,13 @@ void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overri
//StringStore pstore(plaintext);
//RandomizedTransfer(pstore, encFilter, true);
- // encFilter.MessageEnd();
+ //encFilter.MessageEnd();
std::string testFilename = "test.dat";
StringSource(plaintext, true, new FileSink(testFilename.c_str()));
- FileSource(testFilename.c_str(), true, new Redirector(encFilter));
+
+ FileSource pstore(testFilename.c_str(), true);
+ RandomizedTransfer(pstore, encFilter, true);
encFilter.MessageEnd();
ciphertext = GetDecodedDatum(v, "Ciphertext");