]> mj.ucw.cz Git - libucw.git/commitdiff
Random: Fixed bug in xoroshiro128 implementation. master
authorPavel Charvat <pchar@ucw.cz>
Tue, 1 Oct 2024 08:19:39 +0000 (08:19 +0000)
committerPavel Charvat <pchar@ucw.cz>
Tue, 1 Oct 2024 08:19:39 +0000 (08:19 +0000)
ucw/random-fast.c

index 7ba31814b58a72f8a04bc51e01de6828cfebc725..32b3a260f3381498bdae297fb52f5568c1022ab6 100644 (file)
@@ -213,6 +213,7 @@ static inline u64 fastrand_one(struct fastrand *c)
 #else
 #  error "Unsupported xoroshiro parameters"
 #endif
+  s1 ^= s0;
   s[0] = fastrand_rol64(s0, ra) ^ s1 ^ (s1 << rb);
   s[1] = fastrand_rol64(s1, rc);