So as of GCC 9.2, std::random_device on Windows is RtlGenRandom()

....which is precisely the thing i patch out in libsodium to use CryptoAPI
documented interfaces instead (which fall through to RtlGenRandom() on
such devices _anyway_)
we can just use libsodium directly, i happened to patch it out in libstdc++
as a side effect (since my local toolchain can target any version of windows)
pull/1074/head
Rick V 4 years ago
parent c9f2f90e13
commit b449e03f43
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465

@ -276,7 +276,7 @@ namespace llarp
if(lookupRouters.size() > LookupPerTick)
{
static std::mt19937_64 rng{std::random_device{}()};
static std::mt19937_64 rng{llarp::randint()};
std::shuffle(lookupRouters.begin(), lookupRouters.end(), rng);
lookupRouters.resize(LookupPerTick);
}

@ -10,6 +10,7 @@
#include <sys/endian.h>
#elif defined(__sun)
#include <sys/byteorder.h>
#include <endian.h>
#define htobe16(x) htons(x)
#define htole16(x) (x)
#define be16toh(x) ntohs(x)

Loading…
Cancel
Save