Replace more rand() % NUM by randranges

This commit is contained in:
Pieter Wuille
2017-06-07 11:34:55 -07:00
parent efee1db21a
commit 3ecabae363
7 changed files with 19 additions and 19 deletions

View File

@@ -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()) {