Skip to content

Commit 44c1176

Browse files
committed
random: simplify FastRandomContext::randbytes using fillrand
1 parent 3da636e commit 44c1176

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/random.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,8 @@ uint256 FastRandomContext::rand256() noexcept
593593
template <typename B>
594594
std::vector<B> FastRandomContext::randbytes(size_t len)
595595
{
596-
if (requires_seed) RandomSeed();
597596
std::vector<B> ret(len);
598-
if (len > 0) {
599-
rng.Keystream(MakeWritableByteSpan(ret));
600-
}
597+
fillrand(MakeWritableByteSpan(ret));
601598
return ret;
602599
}
603600
template std::vector<unsigned char> FastRandomContext::randbytes(size_t);

0 commit comments

Comments
 (0)