<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 16/10/2024 18:07, Stephen Hemminger
wrote:<br>
</div>
<blockquote type="cite" cite="mid:20241016100710.131fcbf2@hermes.local">
<pre class="moz-quote-pre" wrap="">On Wed, 16 Oct 2024 16:48:12 +0100
"Medvedkin, Vladimir" <a class="moz-txt-link-rfc2396E" href="mailto:vladimir.medvedkin@intel.com"><vladimir.medvedkin@intel.com></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Hi Stephen,
Thanks for introducing this hash function.
I have just a few nits:
On 01/08/2024 16:31, Stephen Hemminger wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">The existing hash functions in DPDK are not cryptographically
secure and can be subject to carefully crafted packets causing
DoS attack.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">Currently in DPDK we have 3 hash functions, 2 of them can be used with
our cuckoo hash table implementation:
1. CRC - Very weak, do not use with hash table if you don't fully
control all keys to install into a hash table.
2. Toeplitz - keyed hash function, not used with hash tables, fastest if
you have GFNI, level of diffusion fully depends on the hash key, weak
against differential crypto analysis. Technically may be used with hash
tables in number of usecases.
3. Jenkins hash (lookup3) - and here I can not say that it is not secure
and it is subject to collisions. I'm not aware on any successful attacks
on it, it has a great diffusion (see <a class="moz-txt-link-freetext" href="https://doi.org/10.1002/spe.2179">https://doi.org/10.1002/spe.2179</a>).
It is also keyed with the same size of the key as rte_hsiphash().
So I won't agree with this sentence.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
I am not a crypto or hash expert. This text is based on the statements
by the original author of siphash who does have such expertise.
See the wikipedia page: <a class="moz-txt-link-freetext" href="https://en.wikipedia.org/wiki/SipHash">https://en.wikipedia.org/wiki/SipHash</a>
and the original paper:
<a class="moz-txt-link-freetext" href="https://web.archive.org/web/20170327151630/https://131002.net/siphash/siphash.pdf">https://web.archive.org/web/20170327151630/https://131002.net/siphash/siphash.pdf</a>
The problem is that Jenkins and Toeplitz
"were designed to have a close-to-uniform distribution, not to
meet any particular cryptographic goals"
</pre>
</blockquote>
<p>The original paper link isn't working, for review I used this:</p>
<p><a class="moz-txt-link-freetext" href="https://www.aumasson.jp/siphash/siphash.pdf">https://www.aumasson.jp/siphash/siphash.pdf</a></p>
<p>Let me quote a bit more form this WP:</p>
<p>"Recent hash-table proposals such as Google’s CityHash [18]
and Jenkins’ SpookyHash [21] provide very fast hashing of short
strings, but
these functions were designed to have a close-to-uniform
distribution, not to
meet any particular cryptographic goals. For example, collisions
were found in
an initial version of CityHash128 [22], and the current version is
vulnerable to
a practical key-recovery attack when 64-bit keys are used."</p>
<p>I haven't found anything about the lookup3 hash function, which
is different from the SpookyHash hash function implemented by Bob
Jenkins.<br>
</p>
<span class="EzKURWReUAB5oZgtQNkl" data-src-align="0:1" style="white-space: pre-wrap;">I</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="2:7" style="white-space: pre-wrap;">understand</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="11:3" style="white-space: pre-wrap;">that</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="15:7" style="white-space: pre-wrap;">SipHash</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="23:8" style="white-space: pre-wrap;">has</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="32:7" style="white-space: pre-wrap;">good</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="40:17" style="white-space: pre-wrap;">cryptographic</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="58:9" style="white-space: pre-wrap;">quality</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="68:1" style="white-space: pre-wrap;">and</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="70:5" style="white-space: pre-wrap;">can</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="76:4" style="white-space: pre-wrap;">be</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="81:11" style="white-space: pre-wrap;">used</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="93:3" style="white-space: pre-wrap;">for</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="97:3" style="white-space: pre-wrap;">MAC</span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="100:1" style="white-space: pre-wrap;">,</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="102:2" style="white-space: pre-wrap;">but</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="105:5" style="white-space: pre-wrap;">here</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="111:2" style="white-space: pre-wrap;">we</span><span style="white-space: pre-wrap;"> are </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="114:7" style="white-space: pre-wrap;">talking</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="122:1" style="white-space: pre-wrap;">about</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="124:4" style="white-space: pre-wrap;">NCHF</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="130:7" style="white-space: pre-wrap;">that</span><span style="white-space: pre-wrap;"> are </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="138:12" style="white-space: pre-wrap;">used</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="151:3" style="white-space: pre-wrap;">for</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="155:3" style="white-space: pre-wrap;">hash</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="159:6" style="white-space: pre-wrap;">tables</span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="165:1" style="white-space: pre-wrap;">,</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="167:1" style="white-space: pre-wrap;">and</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="169:1" style="white-space: pre-wrap;">in</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="171:4" style="white-space: pre-wrap;">this</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="176:6" style="white-space: pre-wrap;">case</span><span style="white-space: pre-wrap;"> a </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="195:7" style="white-space: pre-wrap;">good</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="203:11" style="white-space: pre-wrap;">uniform</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="215:13" style="white-space: pre-wrap;">distribution</span><span style="white-space: pre-wrap;"> of </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="229:3" style="white-space: pre-wrap;">hash</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="233:8" style="white-space: pre-wrap;">values</span><span style="white-space: pre-wrap;"> is </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="183:5" style="white-space: pre-wrap;">very</span><span style="white-space: pre-wrap;"> </span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="189:5" style="white-space: pre-wrap;">important</span><span class="EzKURWReUAB5oZgtQNkl" data-src-align="241:1" style="white-space: pre-wrap;">. Siphash has this property, as does lookup3.</span>
<p>P.S. Regarding above mentioned collisions in CityHash128 - it
seem the problem was solved in 2015<br>
</p>
<blockquote type="cite" cite="mid:20241016100710.131fcbf2@hermes.local">
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Regards,
Vladimir</pre>
</body>
</html>