openssl/crypto/bn/stuff/mont.doc

18 lines
245 B
Plaintext
Raw Normal View History

All numbers (a) are stored aR mod N (except abRR)
RR = REDC(R*R) /* RR mod N */
convert a -> aR
convert b -> bR
{
abRR = aR * bR
abR = REDC(abRR); /* mod N */
}
ab = REDC(abR); /* mod N */
REDC strips off a multiplicaion by R mod N