Montgomery multiplication without final subtraction
Brett just asked &amp; answered this question : Confused about final subtraction of modulus in Montgomery Multiplication, during modular exponentiation

You should increase $R$ exponent by $2$.
If you use $n=1024$ , increase it to be $$n=1024 + 2 = 1026.$$
Recalculate the pre-compute $R'$, based on the new exponent.
$$R' = 2^{(2\cdot 1026)} \bmod(M).$$