FunctionsΒ§
- almost_
montgomery_ πmul - Computes an βalmostβ Montgomery multiplication of
xandyintoout, that isout = x * y * 2^(-n*W) mod m + amassumingk = -1/m mod 2^W, whereWis the bit size of the limb, andn * Wis the full bit size of the integer. - almost_
montgomery_ πreduce - Ensure the output of an βalmostβ Montgomery multiplication is properly reduced.
- montgomery_
multiply_ inner - Based on Algorithm 14.36 in Handbook of Applied Cryptography https://cacr.uwaterloo.ca/hac/about/chap14.pdf
- mul_
montgomery_ πform - Computes the Montgomery product of
aandbmodulomodulus, whereaandbare in Montgomery form. - square_
montgomery_ πform - Computes the Montgomery squaring of
amodulomoduluswhereais in Montgomery form. - square_
repeat_ πmontgomery_ form - Computes a repeated Montgomery squaring of
amodulomoduluswhereais in Montgomery form.