diff options
author | Jack Lloyd <[email protected]> | 2017-12-23 05:56:58 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-12-23 05:56:58 -0500 |
commit | 5d59f00cec3f2d5d549b004a154ba82d098bc4b0 (patch) | |
tree | 6d6733c01e7c3dce8ddb198cb2e12a0162866fa7 /src/lib | |
parent | 7a937f14f8df85238bd850f3636cac733703b287 (diff) |
Avoid relying on AutoSeeded_RNG in XMSS
Just needed for the self-benchmark easier to just use fixed input.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/pubkey/xmss/xmss_tools.cpp | 5 | ||||
-rw-r--r-- | src/lib/pubkey/xmss/xmss_tools.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/pubkey/xmss/xmss_tools.cpp b/src/lib/pubkey/xmss/xmss_tools.cpp index 9b71ab36c..f4f762aeb 100644 --- a/src/lib/pubkey/xmss/xmss_tools.cpp +++ b/src/lib/pubkey/xmss/xmss_tools.cpp @@ -33,12 +33,13 @@ size_t XMSS_Tools::bench_threads() for(const auto& cc : concurrency) { - AutoSeeded_RNG rng; std::vector<XMSS_Hash> hash(std::thread::hardware_concurrency(), XMSS_Hash("SHA-256")); + + const std::vector<uint8_t> buffer(hash[0].output_length()); std::vector<secure_vector<uint8_t>> data( std::thread::hardware_concurrency(), - rng.random_vec(hash[0].output_length())); + secure_vector<uint8_t>(hash[0].output_length())); auto start = std::chrono::high_resolution_clock::now(); for(size_t i = 0; i < cc; ++i) { diff --git a/src/lib/pubkey/xmss/xmss_tools.h b/src/lib/pubkey/xmss/xmss_tools.h index e9f877eae..65c4a83a7 100644 --- a/src/lib/pubkey/xmss/xmss_tools.h +++ b/src/lib/pubkey/xmss/xmss_tools.h @@ -12,11 +12,11 @@ #include <botan/secmem.h> #include <iterator> #include <type_traits> + #if defined(BOTAN_TARGET_OS_HAS_THREADS) #include <thread> #include <chrono> #include <botan/xmss_hash.h> - #include <botan/auto_rng.h> #endif namespace Botan { |