ec/ecp_nistz256.c: harmonize with latest indent script.
[oweals/openssl.git] / crypto / bn / bn_add.c
index fa27ff77b77f2cdaa7fed7366ee489c4f1130af4..2584234cbfa3cca649949e57b2156b6f52b1ea38 100644 (file)
@@ -56,7 +56,8 @@
  * [including the GNU Public Licence.]
  */
 
-#include <stdio.h>
+
+
 #include "cryptlib.h"
 #include "bn_lcl.h"
 
@@ -69,7 +70,8 @@ int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
        bn_check_top(a);
        bn_check_top(b);
 
-       /*  a +  b      a+b
+       /*-
+        *  a +  b      a+b
         *  a + -b      a-b
         * -a +  b      b-a
         * -a + -b      -(a+b)
@@ -104,8 +106,9 @@ int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 /* unsigned add of b to a */
 int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
        {
-       size_t max,min,dif;
-       BN_ULONG *ap,*bp,*rp,carry,t1,t2;
+       int max,min,dif;
+       const BN_ULONG *ap,*bp;
+       BN_ULONG *rp,carry,t1,t2;
        const BIGNUM *tmp;
 
        bn_check_top(a);
@@ -165,12 +168,10 @@ int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 /* unsigned subtraction of b from a, a must be larger than b. */
 int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
        {
-       size_t max,min,dif;
-       register BN_ULONG t1,t2,*ap,*bp,*rp;
+       int max,min,dif;
+       register BN_ULONG t1,t2,*rp;
+       register const BN_ULONG *ap,*bp;
        int i,carry;
-#if defined(IRIX_CC_BUG) && !defined(LINT)
-       int dummy;
-#endif
 
        bn_check_top(a);
        bn_check_top(b);
@@ -207,9 +208,6 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
                        carry=(t1 < t2);
                        t1=(t1-t2)&BN_MASK2;
                        }
-#if defined(IRIX_CC_BUG) && !defined(LINT)
-               dummy=t1;
-#endif
                *(rp++)=t1&BN_MASK2;
                }
 #else
@@ -262,14 +260,15 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 
 int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
        {
-       size_t max;
+       int max;
        int add=0,neg=0;
        const BIGNUM *tmp;
 
        bn_check_top(a);
        bn_check_top(b);
 
-       /*  a -  b      a-b
+       /*-
+        *  a -  b      a-b
         *  a - -b      a+b
         * -a -  b      -(a+b)
         * -a - -b      b-a