From 723fa3a260b9be10a96223c71c2b8f44631a1c5e Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 7 Nov 2023 14:01:58 -0500 Subject: [PATCH] Don't inline Null_RNG::fill_bytes_with_input --- src/lib/rng/rng.cpp | 8 ++++++++ src/lib/rng/rng.h | 7 +------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/rng/rng.cpp b/src/lib/rng/rng.cpp index f7f5ca7662d..4147f46e2b1 100644 --- a/src/lib/rng/rng.cpp +++ b/src/lib/rng/rng.cpp @@ -60,4 +60,12 @@ void RandomNumberGenerator::reseed_from_rng(RandomNumberGenerator& rng, size_t p } } +void Null_RNG::fill_bytes_with_input(std::span output, std::span /* ignored */) { + // throw if caller tries to obtain random bytes + if(!output.empty()) { + abort(); + throw PRNG_Unseeded("Null_RNG called"); + } +} + } // namespace Botan diff --git a/src/lib/rng/rng.h b/src/lib/rng/rng.h index c605a791ca5..0817c6eccda 100644 --- a/src/lib/rng/rng.h +++ b/src/lib/rng/rng.h @@ -282,12 +282,7 @@ class BOTAN_PUBLIC_API(2, 0) Null_RNG final : public RandomNumberGenerator { std::string name() const override { return "Null_RNG"; } private: - void fill_bytes_with_input(std::span output, std::span /* ignored */) override { - // throw if caller tries to obtain random bytes - if(!output.empty()) { - throw PRNG_Unseeded("Null_RNG called"); - } - } + void fill_bytes_with_input(std::span output, std::span /* ignored */) override; }; } // namespace Botan