[squeak-dev] 32 vs 64 bits and large integer hash

Luciano Notarfrancesco luchiano at gmail.com
Mon Nov 26 04:05:55 UTC 2018


On Sun, Nov 25, 2018 at 9:21 PM Eliot Miranda <eliot.miranda at gmail.com>
wrote:

> Hi Luciano,
>
> On Nov 24, 2018, at 9:06 PM, Luciano Notarfrancesco <luchiano at gmail.com>
> wrote:
>
>
> Also, any cryptographic hash will do great in pretty much ALL use cases.
> Finding a sequence of integers that produces non-uniform hashes is very
> hard,
>
>
> Since one takes the result of the hash modulo N I think this statement is
> false.  It depends on the hash table size and the specific set of integers
> one is hashing.
>
>
Well, in fact there might be small biases in the residues modulo N. For
example, if the hash function produces uniformly distributed outputs of 8
bits (0 to 255 with probability 1/256), and you take the residues modulo
255, you'll find a small bias for 0:  1 to 254 have probability 1/254 while
0 has probability 2/254 (because both '0 \\ 255' and '255 \\ 255' are 0).
Small biases like this can make all the difference for the security of a
cryptographic system, but for a hashed collection it's fine.

Cheers,
Luciano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20181126/9397491c/attachment.html>


More information about the Squeak-dev mailing list