x86-mont.pl: fix bug in integer-only squaring path [from HEAD].
authorAndy Polyakov <appro@openssl.org>
Fri, 9 Dec 2011 14:28:48 +0000 (14:28 +0000)
committerAndy Polyakov <appro@openssl.org>
Fri, 9 Dec 2011 14:28:48 +0000 (14:28 +0000)
PR: 2648

crypto/bn/asm/mo-586.pl

index 0982293094d9838f92f0bd2380bc5a76cf184c7d..061127e0b11d2407bf171fbaed546553e926d2a8 100644 (file)
@@ -539,8 +539,10 @@ $sbit=$num;
        &jle    (&label("sqradd"));
 
        &mov    ($carry,"edx");
-       &lea    ("edx",&DWP(0,$sbit,"edx",2));
+       &add    ("edx","edx");
        &shr    ($carry,31);
+       &add    ("edx",$sbit);
+       &adc    ($carry,0);
 &set_label("sqrlast");
        &mov    ($word,$_n0);
        &mov    ($inp,$_np);