use crypto::rand instead of libc rand in a few tests

We don't need secure randomness here, but it should shut coverity up
This commit is contained in:
moneromooo-monero 2019-05-10 14:09:11 +00:00
parent c0bc6d96cd
commit de27651f80
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 8 additions and 8 deletions

View file

@ -82,7 +82,7 @@ namespace
crypto::secret_key randkey;
for (size_t ii = 0; ii < sizeof(randkey); ++ii)
{
randkey.data[ii] = rand();
randkey.data[ii] = crypto::rand<uint8_t>();
}
crypto::ElectrumWords::bytes_to_words(randkey, w_seed, language.get_language_name());
seed = std::string(w_seed.data(), w_seed.size());
@ -256,4 +256,4 @@ TEST(mnemonics, partial_word_tolerance)
res = crypto::ElectrumWords::words_to_bytes(seed_1, key_1, language_name_1);
ASSERT_EQ(true, res);
ASSERT_STREQ(language_name_1.c_str(), "English");
}
}