summaryrefslogtreecommitdiff
path: root/crypto/bn/stuff/mont.doc
blob: 55d1d7931220d48dfadcf8be4174e36d1a807123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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