uCBQN/src/utils/hash.c
dzaima 36afe7f533 integrate mode for consistent timing
use with
make t=perftest f='-O3 -DPERF_TEST' c
2021-07-30 02:19:15 +03:00

17 lines
381 B
C

#include "../core.h"
#include "hash.h"
u64 wy_secret[4];
void hash_init() {
u64 bad1=0xa0761d6478bd642full; // values wyhash64 is afraid of
u64 bad2=0xe7037ed1a0b428dbull;
again:
#ifdef PERF_TEST
make_secret(0, wy_secret);
#else
make_secret(nsTime(), wy_secret);
#endif
for (u64 i = 0; i < 4; i++) if(wy_secret[i]==bad1 || wy_secret[i]==bad2) goto again;
}