Some constification and stacks that slipped through the cracks (how?).
[openssl.git] / crypto / bn / bn_add.c
index 27b781a3675821116ad8d8d450f8ba9917661029..c5ab066c9e467a563cbcb084f5ab78afa29b6bd3 100644 (file)
 #include "bn_lcl.h"
 
 /* r can == a or b */
-int BN_add(r, a, b)
-BIGNUM *r;
-BIGNUM *a;
-BIGNUM *b;
+int BN_add(BIGNUM *r, BIGNUM *a, BIGNUM *b)
        {
        BIGNUM *tmp;
 
@@ -107,15 +104,12 @@ BIGNUM *b;
        }
 
 /* unsigned add of b to a, r must be large enough */
-int BN_uadd(r,a,b)
-BIGNUM *r;
-BIGNUM *a;
-BIGNUM *b;
+int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
        {
        register int i;
        int max,min;
        BN_ULONG *ap,*bp,*rp,carry,t1;
-       BIGNUM *tmp;
+       const BIGNUM *tmp;
 
        bn_check_top(a);
        bn_check_top(b);
@@ -170,12 +164,9 @@ BIGNUM *b;
        }
 
 /* unsigned subtraction of b from a, a must be larger than b. */
-int BN_usub(r, a, b)
-BIGNUM *r;
-BIGNUM *a;
-BIGNUM *b;
+int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
        {
-       int max,min,ret=1;
+       int max,min;
        register BN_ULONG t1,t2,*ap,*bp,*rp;
        int i,carry;
 #if defined(IRIX_CC_BUG) && !defined(LINT)
@@ -264,14 +255,11 @@ BIGNUM *b;
        return(1);
        }
 
-int BN_sub(r, a, b)
-BIGNUM *r;
-BIGNUM *a;
-BIGNUM *b;
+int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
        {
        int max;
        int add=0,neg=0;
-       BIGNUM *tmp;
+       const BIGNUM *tmp;
 
        bn_check_top(a);
        bn_check_top(b);