<s>
SipHash	B-Error_Name
is	O
an	O
add	O
–	O
rotate	O
–	O
xor	O
(	O
ARX	O
)	O
based	O
family	O
of	O
pseudorandom	O
functions	O
created	O
by	O
Jean-Philippe	O
Aumasson	O
and	O
Daniel	O
J	O
.	O
Bernstein	O
in	O
2012	O
,	O
in	O
response	O
to	O
a	O
spate	O
of	O
"	O
hash	B-Error_Name
flooding	O
"	O
denial-of-service	O
attacks	O
(	O
HashDoS	O
)	O
in	O
late	O
2011	O
.	O
</s>
<s>
Although	O
designed	O
for	O
use	O
as	O
a	O
hash	B-Error_Name
function	I-Error_Name
to	O
ensure	O
security	O
,	O
SipHash	B-Error_Name
is	O
fundamentally	O
different	O
from	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
like	O
SHA	O
in	O
that	O
it	O
is	O
only	O
suitable	O
as	O
a	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
:	O
a	O
keyed	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
like	O
HMAC	B-Algorithm
.	O
</s>
<s>
SipHash	B-Error_Name
instead	O
guarantees	O
that	O
,	O
having	O
seen	O
Xi	O
and	O
SipHash(Xi, k )	O
,	O
an	O
attacker	O
who	O
does	O
not	O
know	O
the	O
key	O
k	O
cannot	O
find	O
(	O
any	O
information	O
about	O
)	O
k	O
or	O
SipHash(Y, k )	O
for	O
any	O
message	O
Y	O
∉	O
 { Xi } 	O
which	O
they	O
have	O
not	O
seen	O
before	O
.	O
</s>
<s>
SipHash	B-Error_Name
computes	O
a	O
64-bit	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
from	O
a	O
variable-length	O
message	O
and	O
128-bit	O
secret	O
key	O
.	O
</s>
<s>
this	O
can	O
be	O
used	O
to	O
prevent	O
denial-of-service	O
attacks	O
against	O
hash	B-Algorithm
tables	I-Algorithm
(	O
"	O
hash	B-Error_Name
flooding	O
"	O
)	O
,	O
or	O
to	O
authenticate	O
network	B-Protocol
packets	I-Protocol
.	O
</s>
<s>
An	O
unkeyed	O
hash	B-Error_Name
function	I-Error_Name
such	O
as	O
SHA	O
is	O
only	O
collision-resistant	O
if	O
the	O
entire	O
output	O
is	O
used	O
.	O
</s>
<s>
If	O
used	O
to	O
generate	O
a	O
small	O
output	O
,	O
such	O
as	O
an	O
index	O
into	O
a	O
hash	B-Algorithm
table	I-Algorithm
of	O
practical	O
size	O
,	O
then	O
no	O
algorithm	O
can	O
prevent	O
collisions	O
;	O
an	O
attacker	O
need	O
only	O
make	O
as	O
many	O
attempts	O
as	O
there	O
are	O
possible	O
outputs	O
.	O
</s>
<s>
It	O
keeps	O
track	O
of	O
incoming	O
requests	O
in	O
a	O
hash	B-Algorithm
table	I-Algorithm
with	O
two	O
million	O
entries	O
,	O
using	O
a	O
hash	B-Error_Name
function	I-Error_Name
to	O
map	O
identifying	O
information	O
from	O
each	O
request	O
to	O
one	O
of	O
the	O
two	O
million	O
possible	O
table	O
entries	O
.	O
</s>
<s>
An	O
attacker	O
who	O
knows	O
the	O
hash	B-Error_Name
function	I-Error_Name
need	O
only	O
feed	O
it	O
arbitrary	O
inputs	O
;	O
one	O
out	O
of	O
two	O
million	O
will	O
have	O
a	O
specific	O
hash	B-Error_Name
value	I-Error_Name
.	O
</s>
<s>
If	O
the	O
attacker	O
now	O
sends	O
a	O
few	O
hundred	O
requests	O
all	O
chosen	O
to	O
have	O
the	O
same	O
hash	B-Error_Name
value	I-Error_Name
to	O
the	O
server	O
,	O
that	O
will	O
produce	O
a	O
large	O
number	O
of	O
hash	B-Error_Name
collisions	O
,	O
slowing	O
(	O
or	O
possibly	O
stopping	O
)	O
the	O
server	O
with	O
an	O
effect	O
similar	O
to	O
a	O
packet	B-Protocol
flood	O
of	O
many	O
million	O
requests	O
.	O
</s>
<s>
By	O
using	O
a	O
key	O
unknown	O
to	O
the	O
attacker	O
,	O
a	O
keyed	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
like	O
SipHash	B-Error_Name
prevents	O
this	O
sort	O
of	O
attack	O
.	O
</s>
<s>
While	O
it	O
is	O
possible	O
to	O
add	O
a	O
key	O
to	O
an	O
unkeyed	O
hash	B-Error_Name
function	I-Error_Name
(	O
HMAC	B-Algorithm
is	O
a	O
popular	O
technique	O
)	O
,	O
SipHash	B-Error_Name
is	O
much	O
more	O
efficient	O
.	O
</s>
<s>
Functions	O
in	O
SipHash	B-Error_Name
family	O
are	O
specified	O
as	O
SipHash-c-d	O
,	O
where	O
c	O
is	O
the	O
number	O
of	O
rounds	O
per	O
message	O
block	O
and	O
d	O
is	O
the	O
number	O
of	O
finalization	O
rounds	O
.	O
</s>
<s>
The	O
recommended	O
parameters	O
are	O
SipHash-2-4	O
for	O
best	O
performance	O
,	O
and	O
SipHash-4-8	O
for	O
conservative	O
security	O
.	O
</s>
<s>
A	O
few	O
languages	O
use	O
Siphash-1-3	O
for	O
performance	O
at	O
the	O
risk	O
of	O
yet-unknown	O
DoS	O
attacks	O
.	O
</s>
<s>
The	O
reference	O
implementation	O
was	O
released	O
as	O
public	B-Application
domain	I-Application
software	I-Application
under	O
the	O
CC0	O
.	O
</s>
<s>
SipHash	B-Error_Name
is	O
used	O
in	O
hash	B-Algorithm
table	I-Algorithm
implementations	O
of	O
various	O
software	O
:	O
</s>
<s>
The	O
following	O
programs	O
use	O
SipHash	B-Error_Name
in	O
other	O
ways	O
:	O
</s>
