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)
This commit is contained in:
Rick V 2020-02-13 20:18:12 -06:00
parent c9f2f90e13
commit b449e03f43
No known key found for this signature in database
GPG Key ID: C0EDC8723FDC3465
2 changed files with 2 additions and 1 deletions

View File

@ -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);
}

View File

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