diff options
author | Jack Lloyd <[email protected]> | 2016-11-04 11:03:15 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-11-04 11:03:15 -0400 |
commit | b72abfbc09c8dc844f8fcac11be6dec75edd2530 (patch) | |
tree | b1dadec465ff3616941f3237e6e2dddb96d57dcc | |
parent | 5ce3241ef02af8555c6b731ff89dbd352fa96e9b (diff) |
Fix entropy tests
This interface changed, and it seems the test was only partially updated.
-rw-r--r-- | src/tests/test_entropy.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tests/test_entropy.cpp b/src/tests/test_entropy.cpp index 136ce6721..675d8192e 100644 --- a/src/tests/test_entropy.cpp +++ b/src/tests/test_entropy.cpp @@ -35,9 +35,6 @@ class Entropy_Source_Tests : public Test try { - std::vector<uint8_t> entropy; - double entropy_estimate = 0.0; - SeedCapturing_RNG rng; size_t bits = srcs.poll_just(rng, src_name); @@ -53,7 +50,7 @@ class Entropy_Source_Tests : public Test result.test_note("poll result", rng.seed_material()); #if defined(BOTAN_HAS_COMPRESSION) - if(!entropy.empty()) + if(!rng.seed_material().empty()) { for(const std::string comp_algo : { "zlib", "bzip2", "lzma" }) { @@ -73,14 +70,14 @@ class Entropy_Source_Tests : public Test try { Botan::secure_vector<byte> compressed; - compressed.assign(entropy.begin(), entropy.end()); + compressed.assign(rng.seed_material().begin(), rng.seed_material().end()); comp->start(9); comp->finish(compressed); comp1_size = compressed.size(); result.test_gte(comp_algo + " compressed entropy better than advertised", - compressed.size() * 8, static_cast<size_t>(entropy_estimate)); + compressed.size() * 8, bits); } catch(std::exception& e) { |