1

Are there randomized almost universal hashes that are fast for extremely short messages (usually <10 bytes)?

Edit: This is for hash tables, so it only needs to be hard enough to break to make the HashDOS attack not worthwhile. I am specifically looking for a solution for LuaJIT. Since Lua interns all strings, this needs to be really fast. SipHash-1-3 is too slow.

Demi
  • 4,793
  • 1
  • 19
  • 39
  • Keccak[400] with a bit rate of 240, a capacity of 160 and 12 round ? See here for the collision contest. – Biv May 04 '16 at 07:44
  • @Biv how fast is that? Keccak is not exactly known for being fast in software and I need <1cycle/byte on tiny messages. It is okay to use a stronger algorithm for longer messages. – Demi May 05 '16 at 01:33
  • CLHash: https://github.com/lemire/clhash – Frank Denis May 05 '16 at 05:45
  • Are you looking for a PRF, or for a UHF? Very different beasts. I suspect you're looking for a PRF, not a UHF, because I suspect that for LuaJIT's string table you can't generally assume that the adversary is nonadaptive. – Squeamish Ossifrage Mar 08 '19 at 00:12
  • @SqueamishOssifrage I am looking for a PRF. – Demi Mar 08 '19 at 01:56
  • @Demi Then I'm afraid you might need to hire a professional cryptographer to invent a novel primitive, if SipHash is too costly! Another alternative is to use a hash table of, say, compressed radix trees, with a very fast but not pseudorandom hash function: under nonadversarial input, the hash table gives high expected performance; under adversarial input, the compressed radix trees give reasonable worst-case performance. – Squeamish Ossifrage Mar 08 '19 at 02:02

0 Answers0