Re: jff: checksum algorithm is not as intended

2021-08-29 Thread Tom Lane
Yura Sokolov writes: > Single round function is written as: > #define CHECKSUM_COMP(checksum, value) do {\ > uint32 __tmp = (checksum) ^ (value);\ > (checksum) = __tmp * FNV_PRIME ^ (__tmp >> 17);\ > } while (0) > And looks like it was intended to be > (checksum) = (__tmp *

jff: checksum algorithm is not as intended

2021-08-29 Thread Yura Sokolov
Good day. Current checksum is not calculated in intended way and has the flaw. Single round function is written as: #define CHECKSUM_COMP(checksum, value) do {\ uint32 __tmp = (checksum) ^ (value);\ (checksum) = __tmp * FNV_PRIME ^ (__tmp >> 17);\ } while (0) And looks like it was