[cfe-dev] [libc++] Initial attempt to make a salted hash

Joerg Sonnenberger joerg at britannica.bec.de
Sun Sep 1 04:47:01 PDT 2013


On Sun, Sep 01, 2013 at 11:38:34AM +0200, Matthieu Monrocq wrote:
> For example, one could initialize `std::unordered_set` (and co) with a
> random seed and simply XOR this seed with the result of `h(k)`. Said seed
> can even change each time the container is rehashed to prevent an observer
> from analyzing the collisions and cause undue chaining.

This doesn't help much as it is often trivial to construct input that
creates a hash collision on h(k) (and not just the reduced range of
h(k)%n).

Joerg



More information about the cfe-dev mailing list