Files
linux-st/include/linux
Alexander Duyck 2e7056c433 jhash: Update jhash_[321]words functions to use correct initval
Looking over the implementation for jhash2 and comparing it to jhash_3words
I realized that the two hashes were in fact very different.  Doing a bit of
digging led me to "The new jhash implementation" in which lookup2 was
supposed to have been replaced with lookup3.

In reviewing the patch I noticed that jhash2 had originally initialized a
and b to JHASH_GOLDENRATIO and c to initval, but after the patch a, b, and
c were initialized to initval + (length << 2) + JHASH_INITVAL.  However the
changes in jhash_3words simply replaced the initialization of a and b with
JHASH_INITVAL.

This change corrects what I believe was an oversight so that a, b, and c in
jhash_3words all have the same value added consisting of initval + (length
<< 2) + JHASH_INITVAL so that jhash2 and jhash_3words will now produce the
same hash result given the same inputs.

Fixes: 60d509c823 ("The new jhash implementation")
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-03 12:52:29 -04:00
..
2015-02-19 13:31:40 +03:00
2015-04-02 16:25:04 -04:00
2015-03-29 13:26:54 -07:00
2015-03-11 15:56:59 -07:00
2015-02-12 18:54:15 -08:00
2015-03-02 16:43:41 -05:00
2015-02-13 21:21:36 -08:00
2015-02-17 14:34:51 -08:00
2015-02-11 17:06:02 -08:00
2015-03-11 17:56:28 -04:00
2015-02-17 14:34:52 -08:00
2015-02-16 17:56:03 -08:00
2015-02-13 21:21:41 -08:00
2015-03-11 21:55:28 -04:00
2015-02-13 21:21:35 -08:00
2015-02-17 22:21:11 -05:00