<s>
In	O
mathematics	O
and	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
primality	B-Algorithm
certificate	I-Algorithm
or	O
primality	B-Algorithm
proof	I-Algorithm
is	O
a	O
succinct	O
,	O
formal	O
proof	O
that	O
a	O
number	O
is	O
prime	O
.	O
</s>
<s>
Primality	B-Algorithm
certificates	I-Algorithm
allow	O
the	O
primality	O
of	O
a	O
number	O
to	O
be	O
rapidly	O
checked	O
without	O
having	O
to	O
run	O
an	O
expensive	O
or	O
unreliable	O
primality	B-Algorithm
test	I-Algorithm
.	O
</s>
<s>
Primality	B-Algorithm
certificates	I-Algorithm
lead	O
directly	O
to	O
proofs	O
that	O
problems	O
such	O
as	O
primality	B-Algorithm
testing	I-Algorithm
and	O
the	O
complement	O
of	O
integer	O
factorization	O
lie	O
in	O
NP	O
,	O
the	O
class	O
of	O
problems	O
verifiable	O
in	O
polynomial	O
time	O
given	O
a	O
solution	O
.	O
</s>
<s>
Standard	O
probabilistic	O
primality	B-Algorithm
tests	I-Algorithm
such	O
as	O
the	O
Baillie	B-Algorithm
–	I-Algorithm
PSW	I-Algorithm
primality	I-Algorithm
test	I-Algorithm
,	O
the	O
Fermat	B-Algorithm
primality	I-Algorithm
test	I-Algorithm
,	O
and	O
the	O
Miller	B-Algorithm
–	I-Algorithm
Rabin	I-Algorithm
primality	I-Algorithm
test	I-Algorithm
also	O
produce	O
compositeness	O
certificates	O
in	O
the	O
event	O
where	O
the	O
input	O
is	O
composite	O
,	O
but	O
do	O
not	O
produce	O
certificates	O
for	O
prime	O
inputs	O
.	O
</s>
<s>
The	O
concept	O
of	O
primality	B-Algorithm
certificates	I-Algorithm
was	O
historically	O
introduced	O
by	O
the	O
Pratt	B-Algorithm
certificate	I-Algorithm
,	O
conceived	O
in	O
1975	O
by	O
Vaughan	O
Pratt	O
,	O
who	O
described	O
its	O
structure	O
and	O
proved	O
it	O
to	O
have	O
polynomial	O
size	O
and	O
to	O
be	O
verifiable	O
in	O
polynomial	O
time	O
.	O
</s>
<s>
It	O
is	O
based	O
on	O
the	O
Lucas	B-Algorithm
primality	I-Algorithm
test	I-Algorithm
,	O
which	O
is	O
essentially	O
the	O
converse	O
of	O
Fermat	O
's	O
little	O
theorem	O
with	O
an	O
added	O
condition	O
to	O
make	O
it	O
true	O
:	O
</s>
<s>
Given	O
such	O
an	O
a	O
(	O
called	O
a	O
witness	O
)	O
and	O
the	O
prime	O
factorization	O
of	O
n	O
−	O
1	O
,	O
it	O
's	O
simple	O
to	O
verify	O
the	O
above	O
conditions	O
quickly	O
:	O
we	O
only	O
need	O
to	O
do	O
a	O
linear	O
number	O
of	O
modular	O
exponentiations	O
,	O
since	O
every	O
integer	O
has	O
fewer	O
prime	O
factors	O
than	O
bits	O
,	O
and	O
each	O
of	O
these	O
can	O
be	O
done	O
by	O
exponentiation	B-Algorithm
by	I-Algorithm
squaring	I-Algorithm
in	O
O(log n )	O
multiplications	O
(	O
see	O
big-O	O
notation	O
)	O
.	O
</s>
<s>
Even	O
with	O
grade-school	O
integer	O
multiplication	O
,	O
this	O
is	O
only	O
O((log n )	O
4	O
)	O
time	O
;	O
using	O
the	O
multiplication	B-Algorithm
algorithm	I-Algorithm
with	O
best-known	O
asymptotic	O
running	O
time	O
,	O
the	O
Schönhage	B-Algorithm
–	I-Algorithm
Strassen	I-Algorithm
algorithm	I-Algorithm
,	O
we	O
can	O
lower	O
this	O
to	O
O((log n )	O
3(log log n )	O
(	O
log	O
log	O
log	O
n	O
)	O
)	O
time	O
,	O
or	O
using	O
soft-O	O
notation	O
Õ((log n )	O
3	O
)	O
.	O
</s>
<s>
We	O
do	O
n't	O
want	O
to	O
just	O
force	O
the	O
verifier	O
to	O
factor	O
the	O
number	O
,	O
so	O
a	O
better	O
way	O
to	O
avoid	O
this	O
issue	O
is	O
to	O
give	O
primality	B-Algorithm
certificates	I-Algorithm
for	O
each	O
of	O
the	O
prime	O
factors	O
of	O
n	O
−	O
1	O
as	O
well	O
,	O
which	O
are	O
just	O
smaller	O
instances	O
of	O
the	O
original	O
problem	O
.	O
</s>
<s>
For	O
example	O
,	O
here	O
is	O
a	O
complete	O
Pratt	B-Algorithm
certificate	I-Algorithm
for	O
the	O
number	O
229	O
:	O
</s>
<s>
However	O
,	O
while	O
useful	O
in	O
theory	O
and	O
easy	O
to	O
verify	O
,	O
actually	O
generating	O
a	O
Pratt	B-Algorithm
certificate	I-Algorithm
for	O
n	O
requires	O
factoring	O
n	O
−	O
1	O
and	O
other	O
potentially	O
large	O
numbers	O
.	O
</s>
<s>
This	O
is	O
simple	O
for	O
some	O
special	O
numbers	O
such	O
as	O
Fermat	O
primes	O
,	O
but	O
currently	O
much	O
more	O
difficult	O
than	O
simple	O
primality	B-Algorithm
testing	I-Algorithm
for	O
large	O
primes	O
of	O
general	O
form	O
.	O
</s>
<s>
This	O
was	O
in	O
turn	O
used	O
by	O
A	O
.	O
O	O
.	O
L	O
.	O
Atkin	O
and	O
François	O
Morain	O
as	O
the	O
basis	O
for	O
Atkin-Goldwasser-Kilian-Morain	B-Algorithm
certificates	I-Algorithm
,	O
which	O
are	O
the	O
type	O
of	O
certificates	O
generated	O
and	O
verified	O
by	O
elliptic	B-Algorithm
curve	I-Algorithm
primality	I-Algorithm
proving	I-Algorithm
systems	O
.	O
</s>
<s>
Just	O
as	O
Pratt	B-Algorithm
certificates	I-Algorithm
are	O
based	O
on	O
Lucas	O
's	O
theorem	O
,	O
Atkin	O
–	O
Goldwasser	O
–	O
Kilian	O
–	O
Morain	O
certificates	O
are	O
based	O
on	O
the	O
following	O
theorem	O
of	O
Goldwasser	O
and	O
Kilian	O
(	O
lemma	O
2	O
of	O
"	O
Almost	O
All	O
Primes	O
Can	O
Be	O
Quickly	O
Certified	O
"	O
)	O
:	O
</s>
<s>
To	O
derive	O
a	O
certificate	O
from	O
this	O
theorem	O
,	O
we	O
first	O
encode	O
Mx	O
,	O
My	O
,	O
A	O
,	O
B	O
,	O
and	O
q	O
,	O
then	O
recursively	O
encode	O
the	O
proof	B-Algorithm
of	I-Algorithm
primality	I-Algorithm
for	O
q	O
<	O
n	O
,	O
continuing	O
until	O
we	O
reach	O
a	O
known	O
prime	O
.	O
</s>
<s>
Consequently	O
,	O
it	O
's	O
well-suited	O
to	O
generating	O
certified	O
large	O
random	O
primes	O
,	O
an	O
application	O
that	O
is	O
important	O
in	O
cryptography	O
applications	O
such	O
as	O
generating	O
provably	O
valid	O
RSA	B-Architecture
keys	O
.	O
</s>
<s>
Provable	O
prime	O
generation	O
based	O
on	O
variants	O
of	O
Pocklington	O
's	O
theorem	O
(	O
see	O
Pocklington	B-Algorithm
primality	I-Algorithm
test	I-Algorithm
)	O
can	O
be	O
efficient	O
techniques	O
for	O
generating	O
primes	O
(	O
cost	O
is	O
generally	O
less	O
than	O
probabilistic	O
generation	O
)	O
with	O
the	O
added	O
benefit	O
of	O
built	O
in	O
primality	B-Algorithm
certificates	I-Algorithm
.	O
</s>
<s>
A	O
Pocklington	O
primality	B-Algorithm
certificate	I-Algorithm
consists	O
of	O
the	O
prime	O
P	O
,	O
a	O
set	O
primes	O
dividing	O
,	O
each	O
with	O
their	O
own	O
Pocklington	O
prime	O
certificate	O
or	O
small	O
enough	O
to	O
be	O
a	O
known	O
prime	O
,	O
and	O
a	O
witness	O
.	O
</s>
<s>
"	O
PRIMES	B-Algorithm
is	I-Algorithm
in	I-Algorithm
P	I-Algorithm
"	O
was	O
a	O
breakthrough	O
in	O
theoretical	O
computer	B-General_Concept
science	I-General_Concept
.	O
</s>
<s>
Because	O
primality	B-Algorithm
testing	I-Algorithm
can	O
now	O
be	O
done	O
deterministically	O
in	O
polynomial	O
time	O
using	O
the	O
AKS	B-Algorithm
primality	I-Algorithm
test	I-Algorithm
,	O
a	O
prime	O
number	O
could	O
itself	O
be	O
considered	O
a	O
certificate	O
of	O
its	O
own	O
primality	O
.	O
</s>
<s>
In	O
practice	O
this	O
method	O
of	O
verification	O
is	O
more	O
expensive	O
than	O
the	O
verification	O
of	O
Pratt	B-Algorithm
certificates	I-Algorithm
,	O
but	O
does	O
not	O
require	O
any	O
computation	O
to	O
determine	O
the	O
certificate	O
itself	O
.	O
</s>
