Montgomery reduction: Difference between revisions
Content deleted Content added
m small fixes |
m small fixes |
||
Line 2:
This is sample code in C++ for implementing Montgomery Reduction algorithm as explained in "Handbook of Applied Cryptography, Section 14.3.2, page 600
* let M be a positive integer, R and T integers such that R>m, gcd(m, R) = 10<= T < mR
* Montgomery reduction calculates T*(R
* R is usually chosen as b
* the numbers m(n digits long), T (2n digits long), R, b, n are known entities, a number m' (represented m_dash in code) = -m<sup>-1</sup> mod b is precomputed
|