diff options
Diffstat (limited to 'src/lib/rng/rdrand_rng/rdrand_rng.h')
-rw-r--r-- | src/lib/rng/rdrand_rng/rdrand_rng.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/rng/rdrand_rng/rdrand_rng.h b/src/lib/rng/rdrand_rng/rdrand_rng.h index 181edcd47..f441731cf 100644 --- a/src/lib/rng/rdrand_rng/rdrand_rng.h +++ b/src/lib/rng/rdrand_rng/rdrand_rng.h @@ -1,6 +1,6 @@ /* * RDRAND RNG -* (C) 2016 Jack Lloyd +* (C) 2016,2019 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ @@ -16,18 +16,9 @@ class BOTAN_PUBLIC_API(2,0) RDRAND_RNG final : public Hardware_RNG { public: /** - * On correctly working hardware, RDRAND is always supposed to - * succeed within a set number of retries. If after that many - * retries RDRAND has still not suceeded, sets ok = false and - * returns 0. - */ - static uint32_t rdrand_status(bool& ok); - - /* - * Calls RDRAND until it succeeds, this could hypothetically - * loop forever on broken hardware. + * Constructor will throw if CPU does not have RDRAND bit set */ - static uint32_t rdrand(); + RDRAND_RNG(); /** * Return true if RDRAND is available on the current processor @@ -37,11 +28,6 @@ class BOTAN_PUBLIC_API(2,0) RDRAND_RNG final : public Hardware_RNG bool accepts_input() const override { return false; } /** - * Constructor will throw if CPU does not have RDRAND bit set - */ - RDRAND_RNG(); - - /** * Uses RDRAND to produce output */ void randomize(uint8_t out[], size_t out_len) override; @@ -61,6 +47,20 @@ class BOTAN_PUBLIC_API(2,0) RDRAND_RNG final : public Hardware_RNG std::string name() const override { return "RDRAND"; } bool is_seeded() const override { return true; } + + /** + * On correctly working hardware, RDRAND is always supposed to + * succeed within a set number of retries. If after that many + * retries RDRAND has still not suceeded, sets ok = false and + * returns 0. + */ + static uint32_t BOTAN_DEPRECATED("Use RDRAND_RNG::randomize") rdrand_status(bool& ok); + + /* + * Calls RDRAND until it succeeds, this could hypothetically + * loop forever on broken hardware. + */ + static uint32_t BOTAN_DEPRECATED("Use RDRAND_RNG::randomize") rdrand(); }; } |