<s>
Poly1305	B-Algorithm
is	O
a	O
universal	B-Algorithm
hash	I-Algorithm
family	I-Algorithm
designed	O
by	O
Daniel	O
J	O
.	O
Bernstein	O
for	O
use	O
in	O
cryptography	O
.	O
</s>
<s>
As	O
with	O
any	O
universal	B-Algorithm
hash	I-Algorithm
family	I-Algorithm
,	O
Poly1305	B-Algorithm
can	O
be	O
used	O
as	O
a	O
one-time	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
to	O
authenticate	O
a	O
single	O
message	O
using	O
a	O
key	O
shared	O
between	O
sender	O
and	O
recipient	O
,	O
</s>
<s>
like	O
a	O
one-time	B-Algorithm
pad	I-Algorithm
can	O
be	O
used	O
to	O
conceal	O
the	O
content	O
of	O
a	O
single	O
message	O
using	O
a	O
key	O
shared	O
between	O
sender	O
and	O
recipient	O
.	O
</s>
<s>
Originally	O
Poly1305	B-Algorithm
was	O
proposed	O
as	O
part	O
of	O
Poly1305-AES	B-Algorithm
,	O
</s>
<s>
that	O
combines	O
the	O
Poly1305	B-Algorithm
hash	O
with	O
AES-128	B-Algorithm
to	O
authenticate	O
many	O
messages	O
using	O
a	O
single	O
short	O
key	O
and	O
distinct	O
message	O
numbers	O
.	O
</s>
<s>
Poly1305	B-Algorithm
was	O
later	O
applied	O
with	O
a	O
single-use	O
key	O
generated	O
for	O
each	O
message	O
using	O
XSalsa20	O
in	O
the	O
NaCl	B-Application
crypto_secretbox_xsalsa20poly1305	O
authenticated	O
cipher	O
,	O
</s>
<s>
deployed	O
in	O
TLS	B-Protocol
on	O
the	O
internet	O
.	O
</s>
<s>
Poly1305	B-Algorithm
takes	O
a	O
16-byte	O
secret	O
key	O
and	O
an	O
-byte	O
message	O
and	O
returns	O
a	O
16-byte	O
hash	O
.	O
</s>
<s>
To	O
do	O
this	O
,	O
Poly1305	B-Algorithm
:	O
</s>
<s>
The	O
original	O
Poly1305-AES	B-Algorithm
proposal	O
uses	O
the	O
Carter	O
–	O
Wegman	O
structure	O
to	O
authenticate	O
many	O
messages	O
by	O
taking	O
to	O
be	O
the	O
authenticator	O
on	O
the	O
th	O
message	O
,	O
where	O
is	O
a	O
universal	B-Algorithm
hash	I-Algorithm
family	I-Algorithm
and	O
is	O
an	O
independent	O
uniform	O
random	O
hash	O
value	O
that	O
serves	O
as	O
a	O
one-time	B-Algorithm
pad	I-Algorithm
to	O
conceal	O
it	O
.	O
</s>
<s>
Poly1305-AES	B-Algorithm
uses	O
AES-128	B-Algorithm
to	O
generate	O
,	O
where	O
is	O
encoded	O
as	O
a	O
16-byte	O
little-endian	O
integer	O
.	O
</s>
<s>
Specifically	O
,	O
a	O
Poly1305-AES	B-Algorithm
key	O
is	O
a	O
32-byte	O
pair	O
of	O
a	O
16-byte	O
evaluation	O
point	O
,	O
as	O
above	O
,	O
and	O
a	O
16-byte	O
AES	B-Algorithm
key	I-Algorithm
.	O
</s>
<s>
(	O
Unless	O
AES	B-Algorithm
is	O
broken	O
,	O
is	O
very	O
small	O
.	O
)	O
</s>
<s>
The	O
NaCl	B-Application
crypto_secretbox_xsalsa20poly1305	O
authenticated	O
cipher	O
uses	O
a	O
message	O
number	O
with	O
the	O
XSalsa20	O
stream	O
cipher	O
to	O
generate	O
a	O
per-message	O
key	B-Algorithm
stream	I-Algorithm
,	O
the	O
first	O
32	O
bytes	O
of	O
which	O
are	O
taken	O
as	O
a	O
one-time	O
Poly1305	B-Algorithm
key	O
and	O
the	O
rest	O
of	O
which	O
is	O
used	O
for	O
encrypting	O
the	O
message	O
.	O
</s>
<s>
It	O
then	O
uses	O
Poly1305	B-Algorithm
as	O
a	O
one-time	O
authenticator	O
for	O
the	O
ciphertext	O
of	O
the	O
message	O
.	O
</s>
<s>
ChaCha20-Poly1305	B-Algorithm
does	O
the	O
same	O
but	O
with	O
ChaCha	O
instead	O
of	O
XSalsa20	O
.	O
</s>
<s>
The	O
security	O
of	O
Poly1305	B-Algorithm
and	O
its	O
derivatives	O
against	O
forgery	O
follows	O
from	O
its	O
bounded	O
difference	O
probability	O
as	O
a	O
universal	B-Algorithm
hash	I-Algorithm
family	I-Algorithm
:	O
</s>
<s>
where	O
is	O
a	O
uniform	O
random	O
Poly1305	B-Algorithm
key	O
.	O
</s>
<s>
For	O
NaCl	B-Application
crypto_secretbox_xsalsa20poly1305	O
and	O
ChaCha20-Poly1305	B-Algorithm
,	O
the	O
adversary	O
's	O
success	O
probability	O
at	O
forgery	O
is	O
the	O
same	O
for	O
each	O
message	O
independently	O
as	O
for	O
a	O
one-time	O
authenticator	O
,	O
plus	O
the	O
adversary	O
's	O
distinguishing	O
advantage	O
against	O
XSalsa20	O
or	O
ChaCha	O
as	O
pseudorandom	O
functions	O
used	O
to	O
generate	O
the	O
per-message	O
key	O
.	O
</s>
<s>
The	O
security	O
of	O
Poly1305-AES	B-Algorithm
against	O
forgery	O
follows	O
from	O
the	O
CarterWegmanShoup	O
structure	O
,	O
which	O
instantiates	O
a	O
CarterWegman	O
authenticator	O
with	O
a	O
permutation	O
to	O
generate	O
the	O
per-message	O
pad	O
.	O
</s>
<s>
If	O
an	O
adversary	O
sees	O
authenticated	O
messages	O
and	O
attempts	O
forgeries	O
of	O
messages	O
of	O
up	O
to	O
bytes	O
,	O
and	O
if	O
the	O
adversary	O
has	O
distinguishing	O
advantage	O
at	O
most	O
against	O
AES-128	B-Algorithm
as	O
a	O
pseudorandom	O
permutation	O
,	O
then	O
the	O
probability	O
the	O
adversary	O
succeeds	O
at	O
any	O
one	O
of	O
the	O
forgeries	O
is	O
at	O
most	O
:	O
</s>
<s>
Poly1305-AES	B-Algorithm
can	O
be	O
computed	O
at	O
high	O
speed	O
in	O
various	O
CPUs	O
:	O
for	O
an	O
n-byte	O
message	O
,	O
no	O
more	O
than	O
3.1n	O
+	O
780	O
Athlon	B-Architecture
cycles	O
are	O
needed	O
,	O
for	O
example	O
.	O
</s>
<s>
The	O
author	O
has	O
released	O
optimized	O
source	O
code	O
for	O
Athlon	B-Architecture
,	O
Pentium	B-General_Concept
Pro/II/III/M	O
,	O
PowerPC	B-Architecture
,	O
and	O
UltraSPARC	B-General_Concept
,	O
in	O
addition	O
to	O
non-optimized	O
reference	O
implementations	O
in	O
C	B-Language
and	O
C++	B-Language
as	O
public	B-Application
domain	I-Application
software	I-Application
.	O
</s>
<s>
Below	O
is	O
a	O
list	O
of	O
cryptography	O
libraries	O
that	O
support	O
Poly1305	B-Algorithm
:	O
</s>
