mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-29 17:19:30 +02:00
random: simplify FastRandomContext::randbytes using fillrand
This commit is contained in:
parent
3da636e08b
commit
44c11769a8
@ -593,11 +593,8 @@ uint256 FastRandomContext::rand256() noexcept
|
||||
template <typename B>
|
||||
std::vector<B> FastRandomContext::randbytes(size_t len)
|
||||
{
|
||||
if (requires_seed) RandomSeed();
|
||||
std::vector<B> ret(len);
|
||||
if (len > 0) {
|
||||
rng.Keystream(MakeWritableByteSpan(ret));
|
||||
}
|
||||
fillrand(MakeWritableByteSpan(ret));
|
||||
return ret;
|
||||
}
|
||||
template std::vector<unsigned char> FastRandomContext::randbytes(size_t);
|
||||
|
Loading…
x
Reference in New Issue
Block a user