diff options
Diffstat (limited to 'src/random.cpp')
-rw-r--r-- | src/random.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/random.cpp b/src/random.cpp index 54500e6cc6..39ceae4206 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -599,6 +599,12 @@ std::vector<unsigned char> FastRandomContext::randbytes(size_t len) return ret; } +void FastRandomContext::fillrand(Span<std::byte> output) +{ + if (requires_seed) RandomSeed(); + rng.Keystream(UCharCast(output.data()), output.size()); +} + FastRandomContext::FastRandomContext(const uint256& seed) noexcept : requires_seed(false), bitbuf_size(0) { rng.SetKey32(seed.begin()); |