* use csrng for std::shuffle
pull/1582/head
Jeff Becker 3 years ago
parent 8a89608516
commit 1acea95ced
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

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

@ -410,9 +410,7 @@ namespace llarp
std::vector<Introduction> intros = currentIntroSet.I;
if (intros.size() > 1)
{
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(intros.begin(), intros.end(), g);
std::shuffle(intros.begin(), intros.end(), CSRNG{});
}
// to find a intro on the same router as before that is newer

Loading…
Cancel
Save