summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-20 19:17:45 -0400
committerJeffrey Walton <noloader@gmail.com>2021-03-20 19:17:45 -0400
commita73d83c8815279d70722daf852439f929543174c (patch)
treec02d8f6b9655b0cc26f034ccef81ed295ee40404 /datatest.cpp
parentf845316e9586423bc1b399267be2c882d0f3844e (diff)
downloadcryptopp-git-a73d83c8815279d70722daf852439f929543174c.tar.gz
Update comments
Diffstat (limited to 'datatest.cpp')
-rw-r--r--datatest.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/datatest.cpp b/datatest.cpp
index 252f99a7..5560711f 100644
--- a/datatest.cpp
+++ b/datatest.cpp
@@ -1304,17 +1304,21 @@ void TestDataFile(std::string filename, const NameValuePairs &overrideParameters
}
}
+ // Most tests fully specify parameters, like key and iv. Each test gets
+ // its own unique value. Since each test gets a new value for each test
+ // case, latching a value in 'TestData v' does not matter. The old key
+ // or iv will get overwritten on the next test.
+ //
// If a per-test vector parameter was set for a test, like BlockPadding,
- // BlockSize or Tweak, then it becomes latched in testDataPairs. The old
+ // BlockSize or Tweak, then it becomes latched in 'TestData v'. The old
// value is used in subsequent tests, and it could cause a self test
// failure in the next test. The behavior surfaced under Kalyna and
// Threefish. The Kalyna test vectors use NO_PADDING for all tests except
- // one. For Threefish, using (and not using) a Tweak caused problems as
- // we marched through test vectors. For BlockPadding, BlockSize or Tweak,
- // unlatch them now, after the key has been set and NameValuePairs have
- // been processed. Also note we only unlatch from testDataPairs. If
- // overrideParameters are specified, the caller is responsible for
- // managing the parameter.
+ // one. Threefish occasionally use a Tweak.
+ //
+ // Unlatch BlockPadding, BlockSize and Tweak now, after the test has been
+ // run. Also note we only unlatch from 'TestData v'. If overrideParameters
+ // are specified, the caller is responsible for managing the parameter.
v.erase("Tweak"); v.erase("InitialBlock");
v.erase("BlockSize"); v.erase("BlockPaddingScheme");
}