crypto/bn/bn_nist.c: work around MSC ARM compiler bug.
authorAndy Polyakov <appro@openssl.org>
Wed, 24 Sep 2014 22:42:26 +0000 (00:42 +0200)
committerAndy Polyakov <appro@openssl.org>
Wed, 24 Sep 2014 22:48:40 +0000 (00:48 +0200)
RT: 3541
Reviewed-by: Emilia Kasper <emilia@openssl.org>
(cherry picked from commit 8b07c005fe006044d0e4a795421447deca3c9f2c)

crypto/bn/bn_nist.c

index c6de032696e05ffe56a6ad4fad18cd28b8c10aae..904bd110c11c68a19b1f7980af1a954a5a16fa8e 100644 (file)
@@ -824,9 +824,9 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
        /* ... and right shift */
        for (val=t_d[0],i=0; i<BN_NIST_521_TOP-1; i++)
                {
-               tmp = val>>BN_NIST_521_RSHIFT;
-               val = t_d[i+1];
-               t_d[i] = (tmp | val<<BN_NIST_521_LSHIFT) & BN_MASK2;
+               t_d[i] = ( val>>BN_NIST_521_RSHIFT |
+                         (tmp=t_d[i+1])<<BN_NIST_521_LSHIFT ) & BN_MASK2;
+               val=tmp;
                }
        t_d[i] = val>>BN_NIST_521_RSHIFT;
        /* lower 521 bits */