Expand description
Modular reduction implementation.
Functions§
- montgomery_
reduction 🔒 - Algorithm 14.32 in Handbook of Applied Cryptography https://cacr.uwaterloo.ca/hac/about/chap14.pdf
- montgomery_
reduction_ 🔒inner - Algorithm 14.32 in Handbook of Applied Cryptography https://cacr.uwaterloo.ca/hac/about/chap14.pdf
- montgomery_
retrieve - For input
x < modulusin Montgomery form, computex•R^-1 mod modulus. - montgomery_
retrieve_ inner - This algorithm corresponds to a Montgomery reduction of the wide input
(x, 0), Algorithm 14.32 in Handbook of Applied Cryptography https://cacr.uwaterloo.ca/hac/about/chap14.pdf Or to a Montgomery multiplication ofxby1(Algorithm 14.36). This version does not produce a carry and does not need further correction by subtracting the modulus as long asx < modulus. This is guaranteed becausex < modulus => u < modulus => ((x + u•modulus) << N) < modulus.