diff options
author | Jack Lloyd <[email protected]> | 2017-03-19 15:04:19 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-03-19 15:04:19 -0400 |
commit | 5c4274fcc0bee0367a51b669e1a2953a1fec6684 (patch) | |
tree | 243bf25739c243c442a575d2234d2422292f6d09 | |
parent | 93964e82788a75bf88613f2fa1f43bc924e0e2fc (diff) |
Add RDRAND_RNG speed test
-rw-r--r-- | src/cli/speed.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp index 772cd6a46..6ea70d3d1 100644 --- a/src/cli/speed.cpp +++ b/src/cli/speed.cpp @@ -45,6 +45,10 @@ #include <botan/hmac_rng.h> #endif +#if defined(BOTAN_HAS_RDRAND_RNG) + #include <botan/rdrand_rng.h> +#endif + #if defined(BOTAN_HAS_FPE_FE1) #include <botan/fpe_fe1.h> #endif @@ -535,6 +539,14 @@ class Speed final : public Command bench_rng(Botan::system_rng(), "System_RNG", msec, buf_size); #endif +#if defined(BOTAN_HAS_RDRAND_RNG) + if(Botan::CPUID::has_rdrand()) + { + Botan::RDRAND_RNG rdrand; + bench_rng(rdrand, "RDRAND", msec, buf_size); + } +#endif + #if defined(BOTAN_HAS_HMAC_DRBG) for(std::string hash : { "SHA-256", "SHA-384", "SHA-512" }) { |