aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_rng.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-09-04 19:29:59 -0400
committerJack Lloyd <[email protected]>2018-09-06 11:24:16 -0400
commit8cbe5195b2ea82bf7a58f1a3b8afcc8c53a7537b (patch)
treee24dba4d3e8df8024b8ffffc797d2d15c0908f76 /src/tests/test_rng.h
parent992d2803181b34415c25e013a40ab935eb71a9e3 (diff)
Add RandomNumberGenerator::accepts_input
Diffstat (limited to 'src/tests/test_rng.h')
-rw-r--r--src/tests/test_rng.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tests/test_rng.h b/src/tests/test_rng.h
index 9ac93577b..942277050 100644
--- a/src/tests/test_rng.h
+++ b/src/tests/test_rng.h
@@ -29,6 +29,8 @@ class Fixed_Output_RNG : public Botan::RandomNumberGenerator
return !m_buf.empty();
}
+ bool accepts_input() const override { return true; }
+
size_t reseed(Botan::Entropy_Sources&,
size_t,
std::chrono::milliseconds) override
@@ -116,6 +118,8 @@ class Fixed_Output_Position_RNG final : public Fixed_Output_RNG
}
}
+ bool accepts_input() const override { return false; }
+
void add_entropy(const uint8_t*, size_t) override
{
throw Botan::Exception("add_entropy() not supported by this RNG, test bug?");
@@ -147,6 +151,8 @@ class SeedCapturing_RNG final : public Botan::RandomNumberGenerator
throw Botan::Exception("SeedCapturing_RNG has no output");
}
+ bool accepts_input() const override { return true; }
+
void add_entropy(const uint8_t input[], size_t len) override
{
m_samples++;
@@ -192,6 +198,8 @@ class Request_Counting_RNG final : public Botan::RandomNumberGenerator
return m_randomize_count;
}
+ bool accepts_input() const override { return false; }
+
bool is_seeded() const override
{
return true;