mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
random: move rand256() and randbytes() to .h file
This commit is contained in:
@@ -659,23 +659,6 @@ void FastRandomContext::RandomSeed()
|
||||
requires_seed = false;
|
||||
}
|
||||
|
||||
uint256 FastRandomContext::rand256() noexcept
|
||||
{
|
||||
uint256 ret;
|
||||
fillrand(MakeWritableByteSpan(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <typename B>
|
||||
std::vector<B> FastRandomContext::randbytes(size_t len)
|
||||
{
|
||||
std::vector<B> ret(len);
|
||||
fillrand(MakeWritableByteSpan(ret));
|
||||
return ret;
|
||||
}
|
||||
template std::vector<unsigned char> FastRandomContext::randbytes(size_t);
|
||||
template std::vector<std::byte> FastRandomContext::randbytes(size_t);
|
||||
|
||||
void FastRandomContext::fillrand(Span<std::byte> output)
|
||||
{
|
||||
if (requires_seed) RandomSeed();
|
||||
|
||||
Reference in New Issue
Block a user