netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "George Spelvin" <linux@horizon.com>
To: herbert@gondor.apana.org.au, linux@horizon.com
Cc: dborkman@redhat.com, hannes@stressinduktion.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	tgraf@suug.ch
Subject: Re: Where exactly will arch_fast_hash be used
Date: 7 Dec 2014 05:02:52 -0500	[thread overview]
Message-ID: <20141207100252.6707.qmail@ns.horizon.com> (raw)
In-Reply-To: <20141207092828.GA8623@gondor.apana.org.au>

> For a start why don't you print out the hashes of 1-255 and then
> find out how easy it is to deduce the last bit of the hash result.

They're available in lib/crc32table.h, as crc32ctable_le[0].

As a CRC is a linear function, every bit is the XOR of some
selected bits of the input, i.e. the parity of the input and
some bit-specific mask sequence.

Furthermore, CRCs are cyclic, so the mask sequences for adjacent bits are
shifts of each other.

The lsbit of the CRC32c of x is the parity of x & 0x1f.

This is because the LFSR sequence generated by the polynomial
starts 0001111110010001110010101111011000111000011011110010110000100101...

The first bit corresponds to the msbit of the last byte.


How does this implicate the low bits specifically?

  reply	other threads:[~2014-12-07 10:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-07  5:20 Where exactly will arch_fast_hash be used George Spelvin
2014-12-07  9:28 ` Herbert Xu
2014-12-07 10:02   ` George Spelvin [this message]
2014-12-07 12:51     ` Herbert Xu
2014-12-07 13:23       ` George Spelvin
2014-12-07 14:06         ` Hannes Frederic Sowa
2014-12-07 21:33           ` George Spelvin
2014-12-08 11:25             ` Hannes Frederic Sowa
2014-12-08 16:19               ` George Spelvin
2014-12-08 16:32                 ` Hannes Frederic Sowa
2014-12-09 14:24         ` Herbert Xu
2014-12-07 13:14 ` Hannes Frederic Sowa
2014-12-07 13:30   ` George Spelvin
2014-12-07 13:41     ` Hannes Frederic Sowa
2014-12-07 13:52       ` Hannes Frederic Sowa
  -- strict thread matches above, loose matches on Subject: below --
2014-12-04  8:11 Herbert Xu
2014-12-04 12:34 ` Hannes Frederic Sowa
2014-12-04 13:14   ` Daniel Borkmann
2014-12-04 15:26 ` Thomas Graf
2014-12-04 15:29   ` Herbert Xu
2014-12-04 15:39     ` Thomas Graf
2014-12-04 15:43       ` Daniel Borkmann
2014-12-04 15:47         ` Herbert Xu
2014-12-04 15:51           ` Daniel Borkmann
2014-12-04 15:56           ` David Laight
2014-12-04 16:10             ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141207100252.6707.qmail@ns.horizon.com \
    --to=linux@horizon.com \
    --cc=dborkman@redhat.com \
    --cc=hannes@stressinduktion.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).