5ac99c3b2377c794fb4e514dc68bdba81a6a73e2
[openssl.git] / crypto / bn / old / info
1 Given A1A0 * B1B0 == S3S2S1S0
2
3 S0=     low(A0*B0)
4 S1=     low( (A1-A0)*(B0-B1)) +low( A1*B1) +high(A0*B0)
5 S2=     high((A1-A0)*(B0-B1)) +high(A1*B1) +low( A1*B1)
6 S3=     high(A1*B1);
7
8 Assume we know S1 and S0, and can calulate A1*B1 and high((A1-A0)*(B0-B1))
9
10 k0=     S0 == low(A0*B0)
11 k1=     S1
12 k2=     low( A1*B1)
13 k3=     high(A1*B1)
14 k4=     high((A1-A0)*(B0-B1))
15
16 k1=     low((A1-A0)*(B0-B1)) +k2 +high(A0*B0)
17 S2=     k4 +k3 +k2
18 S3=     k3
19
20 S1-k2= low((A1-A0)*(B0-B1)) +high(A0*B0)
21
22 We potentially have a carry or a borrow from S1