6. Performing operation
The Montgomery reduction algorithm is a fast way to perform multiplications in the
form of x y (modN) or xy (modN). In this case we take a number of bits of N and will
generate a valid value for N (which must be odd):
x= 10
y= 50
Bits in modulus= 80
N= 1538185523122479500916069
== x*y (mod N) ==
Result (Montgomery)=500
Result (x*y % mod)= 500
== x^y (mod N) ==
Result (Montgomery)=591781070402453458039171
Result (x^y % mod)= 591781070402453458039171 [Link]