summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_shift.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_shift.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_shift.c')
-rw-r--r--crypto/bn/bn_shift.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c
index 70f785ea18..513e686f86 100644
--- a/crypto/bn/bn_shift.c
+++ b/crypto/bn/bn_shift.c
@@ -89,6 +89,7 @@ int BN_lshift1(BIGNUM *r, const BIGNUM *a)
*rp=1;
r->top++;
}
+ bn_check_top(r);
return(1);
}
@@ -117,7 +118,8 @@ int BN_rshift1(BIGNUM *r, const BIGNUM *a)
rp[i]=((t>>1)&BN_MASK2)|c;
c=(t&1)?BN_TBIT:0;
}
- bn_fix_top(r);
+ bn_correct_top(r);
+ bn_check_top(r);
return(1);
}
@@ -149,7 +151,8 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
/* for (i=0; i<nw; i++)
t[i]=0;*/
r->top=a->top+nw+1;
- bn_fix_top(r);
+ bn_correct_top(r);
+ bn_check_top(r);
return(1);
}
@@ -200,6 +203,7 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
*(t++) =(l>>rb)&BN_MASK2;
}
*t=0;
- bn_fix_top(r);
+ bn_correct_top(r);
+ bn_check_top(r);
return(1);
}