Hi, I saw your talk and have a few suggestions concerning the encryption. I think it is enough to use a good bijective mixer like murmurhash's fmix:
uint64_t encrypt(uint64_t h) {
h ^= h >> 33;
h *= 0xff51afd7ed558ccd;
h ^= h >> 33;
h *= 0xc4ceb9fe1a85ec53;
h ^= h >> 33;
return h;
}
Node that the x ^= x>>n operation basically is used to mix the lower bits, and the multiplications are used to mix the upper bits. Enough of these operations and h is well mixed. Both operations are reversible, so they are bijective.
To support arbitrary number of bits, this should work:
uint64_t encrypt(int bits, uint64_t h) {
uint64_t shift = bits/2;
uint64_t mask = (1<<bits) - 1;
h ^= h >> shift;
h = (h * 0xff51afd7ed558ccd) & mask;
h ^= h >> shift;
h = (h * 0xc4ceb9fe1a85ec53) & mask;
h ^= h >> shift;
return h;
}
Although I don't know about the randomness quality.
It is also possible to support a seed for arbitrary random iteration sequences:
uint64_t encrypt(int bits, uint64_t seed, uint64_t h) {
uint64_t shift = bits/2;
uint64_t mask = (1<<bits) - 1;
h ^= (seed & mask);
h ^= h >> shift;
h = (h * 0xff51afd7ed558ccd) & mask;
h ^= h >> shift;
h = (h * 0xc4ceb9fe1a85ec53) & mask;
h ^= h >> shift;
return h;
}
Not that only the last few bits of the seed are actually used, so this could certainly be improved.
Hi, I saw your talk and have a few suggestions concerning the encryption. I think it is enough to use a good bijective mixer like murmurhash's fmix:
Node that the
x ^= x>>noperation basically is used to mix the lower bits, and the multiplications are used to mix the upper bits. Enough of these operations andhis well mixed. Both operations are reversible, so they are bijective.To support arbitrary number of bits, this should work:
Although I don't know about the randomness quality.
It is also possible to support a seed for arbitrary random iteration sequences:
Not that only the last few bits of the seed are actually used, so this could certainly be improved.