mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Replace more rand() % NUM by randranges
This commit is contained in:
@@ -38,7 +38,7 @@ void TestVector(const Hasher &h, const In &in, const Out &out) {
|
||||
Hasher hasher(h);
|
||||
size_t pos = 0;
|
||||
while (pos < in.size()) {
|
||||
size_t len = insecure_rand() % ((in.size() - pos + 1) / 2 + 1);
|
||||
size_t len = insecure_randrange((in.size() - pos + 1) / 2 + 1);
|
||||
hasher.Write((unsigned char*)&in[pos], len);
|
||||
pos += len;
|
||||
if (pos > 0 && pos + 2 * out.size() > in.size() && pos < in.size()) {
|
||||
|
||||
Reference in New Issue
Block a user