From fdc670893169d5e13365c62f65618556a9048418 Mon Sep 17 00:00:00 2001 From: Leonid Evdokimov Date: Wed, 25 Sep 2024 15:34:51 +0300 Subject: [PATCH] clhash: avoid more bad seeds --- clhash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clhash.c b/clhash.c index 5eddfa5f..fc854b1d 100644 --- a/clhash.c +++ b/clhash.c @@ -447,5 +447,9 @@ void * get_random_key_for_clhash(uint64_t seed1, uint64_t seed2) { a64[128] = xorshift128plus(&k); a64[129] = xorshift128plus(&k); } + while (!a64[2] && !a64[3]) { + a64[2] = xorshift128plus(&k); + a64[3] = xorshift128plus(&k); + } return (void*)a64; }