To provide a modular multiplication method and a calculating device that
do not rely on the Montgomery technique, wherein the number of times of
multiply-add calculations is reduced to shorten a calculation time for
calculation speed-up, there is no limitation in input value, and it is
possible to execute a remainder calculation exceeding the calculable
maximum bit length of a multiply-add unit that is used. Assuming that
N=2.sup.n-M and X=.alpha..times.2.sup.n+.beta., a relation of
XmodN=(.alpha..times.M+.beta.)modN is derived, which is utilized. n
represents a maximum bit number where "1" is assigned in N, a solution of
2.sup.n+1modN is set as b, A.times.B is set as X, XmodN is transferred to
(X/2.sup.n+1.times.b+Xmod2.sup.n+1)modN and further transferred to
(Xn/2.sup.n+1.times.b+Xnmod2.sup.n+1)modN, calculations of
Xn/2.sup.n+1.times.b+Xnmod2.sup.n+1 are repeated until a bit length of Xn
becomes n+1, Xn-N is derived and a derived result is set as a solution of
"A.times.BmodN".