summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_add.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-11-04 22:54:49 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-11-04 22:54:49 +0000
commitd870740cd75dd4f0cb66fb8c32653a7d47369706 (patch)
tree0c6cb1ce0b1083c96419c432d1f05c3dff51320d /crypto/bn/bn_add.c
parentd8ec0dcf457f4dec39f137657b702fcbeaf5cc04 (diff)
Put the first stage of my bignum debugging adventures into CVS. This code
is itself experimental, and in addition may cause execution to break on existing openssl "bugs" that previously were harmless or at least invisible.
Diffstat (limited to 'crypto/bn/bn_add.c')
-rw-r--r--crypto/bn/bn_add.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c
index 6cba07e9f6..a13b8a11cb 100644
--- a/crypto/bn/bn_add.c
+++ b/crypto/bn/bn_add.c
@@ -100,6 +100,7 @@ int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
r->neg=1;
else
r->neg=0;
+ bn_check_top(r);
return(1);
}
@@ -161,6 +162,7 @@ int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
}
/* memcpy(rp,ap,sizeof(*ap)*(max-i));*/
r->neg = 0;
+ bn_check_top(r);
return(1);
}
@@ -253,7 +255,7 @@ int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
r->top=max;
r->neg=0;
- bn_fix_top(r);
+ bn_correct_top(r);
return(1);
}
@@ -304,6 +306,7 @@ int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
if (!BN_usub(r,a,b)) return(0);
r->neg=0;
}
+ bn_check_top(r);
return(1);
}