diff --git a/src/core/random_func.cpp b/src/core/random_func.cpp index 4f898333bd..1a92f4288b 100644 --- a/src/core/random_func.cpp +++ b/src/core/random_func.cpp @@ -10,6 +10,7 @@ #include "../stdafx.h" #include "random_func.hpp" #include "bitmath_func.hpp" +#include "hash_func.hpp" #include "../debug.h" #include #include @@ -143,7 +144,8 @@ void RandomBytesWithFallback(std::span buf) bool have_warned = warned_once.exchange(true); DEBUG(misc, have_warned ? 1 : 0, "Cryptographically-strong random generator unavailable; using fallback"); - for (uint i = 0; i < buf.size(); i++) { - buf[i] = static_cast(InteractiveRandom()); + for (uint i = 0; i < buf.size(); i ++) { + uint64_t current_time = static_cast(std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count()); + buf[i] = static_cast(SimpleHash64(current_time ^ InteractiveRandom())); } }