random: simplify FastRandomContext::randbytes using fillrand
This commit is contained in:
1 parent
3da636e08b
commit
44c11769a8
1 file changed
+1
-4
+1
-4
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user