<s>
In	O
modular	O
arithmetic	O
computation	O
,	O
Montgomery	B-Algorithm
modular	I-Algorithm
multiplication	I-Algorithm
,	O
more	O
commonly	O
referred	O
to	O
as	O
Montgomery	B-Algorithm
multiplication	I-Algorithm
,	O
is	O
a	O
method	O
for	O
performing	O
fast	O
modular	O
multiplication	O
.	O
</s>
<s>
Montgomery	B-Algorithm
modular	I-Algorithm
multiplication	I-Algorithm
relies	O
on	O
a	O
special	O
representation	O
of	O
numbers	O
called	O
Montgomery	O
form	O
.	O
</s>
<s>
The	O
Montgomery	O
form	O
,	O
in	O
contrast	O
,	O
depends	O
on	O
a	O
constant	O
which	O
is	O
coprime	O
to	O
,	O
and	O
the	O
only	O
division	O
necessary	O
in	O
Montgomery	B-Algorithm
multiplication	I-Algorithm
is	O
division	O
by	O
.	O
</s>
<s>
The	O
need	O
to	O
convert	O
and	O
into	O
Montgomery	O
form	O
and	O
their	O
product	O
out	O
of	O
Montgomery	O
form	O
means	O
that	O
computing	O
a	O
single	O
product	O
by	O
Montgomery	B-Algorithm
multiplication	I-Algorithm
is	O
slower	O
than	O
the	O
conventional	O
or	O
Barrett	B-Algorithm
reduction	I-Algorithm
algorithms	O
.	O
</s>
<s>
Many	O
important	O
cryptosystems	O
such	O
as	O
RSA	B-Architecture
and	O
Diffie	B-Protocol
–	I-Protocol
Hellman	I-Protocol
key	I-Protocol
exchange	I-Protocol
are	O
based	O
on	O
arithmetic	O
operations	O
modulo	O
a	O
large	O
odd	O
number	O
,	O
and	O
for	O
these	O
cryptosystems	O
,	O
computations	O
using	O
Montgomery	B-Algorithm
multiplication	I-Algorithm
with	O
a	O
power	O
of	O
two	O
are	O
faster	O
than	O
the	O
available	O
alternatives	O
.	O
</s>
<s>
Montgomery	B-Algorithm
reduction	I-Algorithm
,	O
also	O
known	O
as	O
REDC	O
,	O
is	O
an	O
algorithm	O
which	O
simultaneously	O
computes	O
the	O
product	O
by	O
and	O
reduces	O
modulo	O
more	O
quickly	O
than	O
the	O
naïve	O
method	O
.	O
</s>
<s>
Unlike	O
conventional	O
modular	O
reduction	O
,	O
which	O
focuses	O
on	O
making	O
the	O
number	O
smaller	O
than	O
,	O
Montgomery	B-Algorithm
reduction	I-Algorithm
focuses	O
on	O
making	O
the	O
number	O
more	O
divisible	O
by	O
.	O
</s>
<s>
The	O
combined	O
operation	O
of	O
multiplication	O
and	O
REDC	O
is	O
often	O
called	O
Montgomery	B-Algorithm
multiplication	I-Algorithm
.	O
</s>
<s>
Modular	O
exponentiation	O
can	O
be	O
done	O
using	O
exponentiation	B-Algorithm
by	I-Algorithm
squaring	I-Algorithm
by	O
initializing	O
the	O
initial	O
product	O
to	O
the	O
Montgomery	O
representation	O
of	O
1	O
,	O
that	O
is	O
,	O
to	O
,	O
and	O
by	O
replacing	O
the	O
multiply	O
and	O
square	O
steps	O
by	O
Montgomery	O
multiplies	O
.	O
</s>
<s>
This	O
combined	O
algorithm	O
is	O
usually	O
called	O
Montgomery	B-Algorithm
multiplication	I-Algorithm
.	O
</s>
<s>
Furthermore	O
,	O
because	O
each	O
step	O
of	O
MultiPrecisionREDC	O
requires	O
knowing	O
only	O
the	O
lowest	O
bit	O
,	O
Montgomery	B-Algorithm
multiplication	I-Algorithm
can	O
be	O
easily	O
combined	O
with	O
a	O
carry-save	O
adder	O
.	O
</s>
<s>
Because	O
Montgomery	B-Algorithm
reduction	I-Algorithm
avoids	O
the	O
correction	O
steps	O
required	O
in	O
conventional	O
division	O
when	O
quotient	O
digit	O
estimates	O
are	O
inaccurate	O
,	O
it	O
is	O
mostly	O
free	O
of	O
the	O
conditional	O
branches	O
which	O
are	O
the	O
primary	O
targets	O
of	O
timing	O
and	O
power	O
side-channel	O
attacks	O
;	O
the	O
sequence	O
of	O
instructions	O
executed	O
is	O
independent	O
of	O
the	O
input	O
operand	O
values	O
.	O
</s>
