Improved lk scrambling function.

This actually gets very close to the behavior of a full per-bit
hash, except that you still need a fairly random seed.
This commit is contained in:
Nathan Vegdahl 2020-04-23 08:31:03 +09:00
parent 22b7151919
commit b776bf56b8

View File

@ -80,6 +80,7 @@ fn lk_scramble(mut n: u32, scramble: u32) -> u32 {
n = n.wrapping_add(scramble);
for &p in PERMS.iter() {
n ^= n.wrapping_mul(p);
n += n << 1;
}
n
}