<s>
In	O
cryptography	O
,	O
a	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
based	O
on	O
universal	B-Algorithm
hashing	I-Algorithm
,	O
or	O
UMAC	B-Algorithm
,	O
is	O
a	O
type	O
of	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
(	O
MAC	O
)	O
calculated	O
choosing	O
a	O
hash	O
function	O
from	O
a	O
class	O
of	O
hash	O
functions	O
according	O
to	O
some	O
secret	O
(	O
random	O
)	O
process	O
and	O
applying	O
it	O
to	O
the	O
message	O
.	O
</s>
<s>
A	O
specific	O
type	O
of	O
UMAC	B-Algorithm
,	O
also	O
commonly	O
referred	O
to	O
just	O
UMAC	B-Algorithm
,	O
is	O
specified	O
in	O
RFC	O
4418	O
,	O
it	O
has	O
provable	O
cryptographic	O
strength	O
and	O
is	O
usually	O
a	O
lot	O
less	O
computationally	O
intensive	O
than	O
other	O
MACs	O
.	O
</s>
<s>
UMAC	B-Algorithm
's	O
design	O
is	O
optimized	O
for	O
32-bit	O
architectures	O
with	O
SIMD	B-Device
support	O
,	O
with	O
a	O
performance	O
of	O
1	O
CPU	O
cycle	O
per	O
byte	O
(	O
cpb	O
)	O
with	O
SIMD	B-Device
and	O
2	O
cpb	O
without	O
SIMD	B-Device
.	O
</s>
<s>
A	O
closely	O
related	O
variant	O
of	O
UMAC	B-Algorithm
that	O
is	O
optimized	O
for	O
64-bit	O
architectures	O
is	O
given	O
by	O
VMAC	B-Application
,	O
which	O
has	O
been	O
submitted	O
to	O
the	O
IETF	O
as	O
a	O
draft	O
(	O
)	O
but	O
never	O
gathered	O
enough	O
attention	O
for	O
becoming	O
a	O
standardized	O
RFC	O
.	O
</s>
<s>
This	O
class	O
is	O
called	O
universal	B-Algorithm
if	O
,	O
for	O
any	O
distinct	O
pair	O
of	O
messages	O
,	O
there	O
are	O
at	O
most	O
|H|	O
/	O
|D|	O
functions	O
that	O
map	O
them	O
to	O
the	O
same	O
member	O
of	O
D	O
.	O
</s>
<s>
This	O
means	O
that	O
if	O
an	O
attacker	O
wants	O
to	O
replace	O
one	O
message	O
with	O
another	O
and	O
,	O
from	O
his	O
point	O
of	O
view	O
,	O
the	O
hash	O
function	O
was	O
chosen	O
completely	O
randomly	O
,	O
the	O
probability	O
that	O
the	O
UMAC	B-Algorithm
will	O
not	O
detect	O
his	O
modification	O
is	O
at	O
most	O
1/	O
|D|	O
.	O
</s>
<s>
But	O
this	O
definition	O
is	O
not	O
strong	O
enough	O
if	O
the	O
possible	O
messages	O
are	O
0	O
and	O
1	O
,	O
D={0,1}	O
and	O
H	O
consists	O
of	O
the	O
identity	O
operation	O
and	O
not	O
,	O
H	O
is	O
universal	B-Algorithm
.	O
</s>
<s>
A	O
class	O
of	O
hash	O
functions	O
H	O
that	O
is	O
good	O
to	O
use	O
will	O
make	O
it	O
difficult	O
for	O
an	O
attacker	O
to	O
guess	O
the	O
correct	O
digest	O
d	O
of	O
a	O
fake	O
message	O
f	O
after	O
intercepting	O
one	O
message	O
a	O
with	O
digest	O
c	B-Language
.	O
In	O
other	O
words	O
,	O
</s>
<s>
with	O
a	O
one-time	B-Algorithm
pad	I-Algorithm
)	O
,	O
an	O
attacker	O
cannot	O
learn	O
anything	O
from	O
them	O
and	O
the	O
same	O
hash	O
function	O
can	O
be	O
used	O
for	O
all	O
communication	O
between	O
the	O
two	O
parties	O
.	O
</s>
<s>
This	O
may	O
not	O
be	O
true	O
for	O
ECB	B-Algorithm
encryption	O
because	O
it	O
may	O
be	O
quite	O
likely	O
that	O
two	O
messages	O
produce	O
the	O
same	O
hash	O
value	O
.	O
</s>
<s>
Then	O
some	O
kind	O
of	O
initialization	B-Algorithm
vector	I-Algorithm
should	O
be	O
used	O
,	O
which	O
is	O
often	O
called	O
the	O
nonce	O
.	O
</s>
<s>
The	O
following	O
C	B-Language
function	O
generates	O
a	O
24	O
bit	O
UMAC	B-Algorithm
.	O
</s>
<s>
For	O
speed	O
,	O
UMAC	B-Algorithm
uses	O
the	O
NH	O
hash-function	O
family	O
.	O
</s>
<s>
NH	O
is	O
specifically	O
designed	O
to	O
use	O
SIMD	B-Device
instructions	O
,	O
and	O
hence	O
UMAC	B-Algorithm
is	O
the	O
first	O
MAC	O
function	O
optimized	O
for	O
SIMD	B-Device
.	O
</s>
<s>
The	O
following	O
hash	O
family	O
is	O
-universal	O
:	O
</s>
<s>
RFC	O
4418	O
does	O
a	O
lot	O
to	O
wrap	O
NH	O
to	O
make	O
it	O
a	O
good	O
UMAC	B-Algorithm
.	O
</s>
<s>
The	O
overall	O
UHASH	O
(	O
"	O
Universal	B-Algorithm
Hash	I-Algorithm
Function	I-Algorithm
"	O
)	O
routine	O
produces	O
a	O
variable	O
length	O
of	O
tags	O
,	O
which	O
corresponds	O
to	O
the	O
number	O
of	O
iterations	O
(	O
and	O
the	O
total	O
lengths	O
of	O
keys	O
)	O
needed	O
in	O
all	O
three	O
layers	O
of	O
its	O
hashing	O
.	O
</s>
<s>
Several	O
calls	O
to	O
an	O
AES-based	O
key	B-Algorithm
derivation	I-Algorithm
function	I-Algorithm
is	O
used	O
to	O
provide	O
keys	O
for	O
all	O
three	O
keyed	O
hashes	O
.	O
</s>
<s>
This	O
definition	O
is	O
designed	O
to	O
encourage	O
programmers	O
to	O
use	O
SIMD	B-Device
instructions	O
on	O
the	O
accumulation	O
,	O
since	O
only	O
data	O
with	O
four	O
indices	O
away	O
are	O
likely	O
to	O
not	O
be	O
put	O
in	O
the	O
same	O
SIMD	B-Device
register	O
,	O
and	O
hence	O
faster	O
to	O
multiply	O
in	O
bulk	O
.	O
</s>
