Adversarial examples for fast hash functions

8 points by pkhuong


chandlerc

I have come around to a strong belief that the correct design direction for hash tables is perhaps a bit surprising: require an ordering in addition to a hash, and fall back to a b-tree when excessive collisions occur. Then use the weakest, cheapest, fastest hash you can get away with.

And we should have an UnsafeHashMap or some such which omits the ordering requirement.

All of the efforts to resist adversarial attacks against the scaling of hash tables seem to either fail to provide a durable defense or are too costly in practice. And we pay the price of these when we don't have adversarial keys. =/

The only way that seems to durably preserve fast hash table performance is to fall back on an ordered container.