diff options
| author | Jeffrey Walton <noloader@gmail.com> | 2017-08-02 19:43:56 -0400 |
|---|---|---|
| committer | Jeffrey Walton <noloader@gmail.com> | 2017-08-02 19:43:56 -0400 |
| commit | 76ff3fc03b64fc2f491fae2e918733c1a153d444 (patch) | |
| tree | 2aec1d661d783154be4c2ca63ae3b3fa809de652 /validat1.cpp | |
| parent | 4da4ece5a573196edcc76785e3a2fa0ed8d4b47e (diff) | |
| download | cryptopp-git-76ff3fc03b64fc2f491fae2e918733c1a153d444.tar.gz | |
Remove pre-Crypto++ 5.5 interface
Users of OldRandomPool must use the new interface. All that means is they must call IncorporateEntropy instead of Put, and GenerateBlock instead of Get
Diffstat (limited to 'validat1.cpp')
| -rw-r--r-- | validat1.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/validat1.cpp b/validat1.cpp index cc72530a..3943aace 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -722,7 +722,7 @@ bool TestRandomPool() // with it in 2017. The missing functionality was a barrier to upgrades.
std::cout << "\nTesting OldRandomPool generator...\n\n";
{
- OldRandomPool old1;
+ OldRandomPool old;
static const unsigned int ENTROPY_SIZE = 32;
// https://github.com/weidai11/cryptopp/issues/452
@@ -734,9 +734,9 @@ bool TestRandomPool() };
SecByteBlock seed(0x00, 384);
- old1.Put(seed, seed.size());
+ old.IncorporateEntropy(seed, seed.size());
- old1.GenerateBlock(result, sizeof(result));
+ old.GenerateBlock(result, sizeof(result));
fail = (0 != ::memcmp(result, expected, sizeof(expected)));
pass &= !fail;
@@ -746,20 +746,6 @@ bool TestRandomPool() std::cout << "passed:";
std::cout << " Expected sequence from PGP-style RandomPool (circa 2007)\n";
- OldRandomPool old2;
- old2.IncorporateEntropy(seed, seed.size());
-
- ArraySink sink(result, sizeof(result));
- old2.GenerateIntoBufferedTransformation(sink, DEFAULT_CHANNEL, sizeof(result));
- fail = (0 != ::memcmp(result, expected, sizeof(expected)));
-
- pass &= !fail;
- if (fail)
- std::cout << "FAILED:";
- else
- std::cout << "passed:";
- std::cout << " Expected sequence from PGP-style RandomPool new interface (circa 2007)\n";
-
OldRandomPool prng;
MeterFilter meter(new Redirector(TheBitBucket()));
RandomNumberSource test(prng, 100000, true, new Deflator(new Redirector(meter)));
|
