summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_div.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2008-11-12 03:58:08 +0000
committerGeoff Thorpe <geoff@openssl.org>2008-11-12 03:58:08 +0000
commit6343829a391df59e46e513c84b6264ee71ad9518 (patch)
tree9823103bf5828e47081ac906203516bdc332f577 /crypto/bn/bn_div.c
parent2401debe83e8df930907a39065ebf9a54354f123 (diff)
Revert the size_t modifications from HEAD that had led to more
knock-on work than expected - they've been extracted into a patch series that can be completed elsewhere, or in a different branch, before merging back to HEAD.
Diffstat (limited to 'crypto/bn/bn_div.c')
-rw-r--r--crypto/bn/bn_div.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c
index 68ff960aef..6db472f8c3 100644
--- a/crypto/bn/bn_div.c
+++ b/crypto/bn/bn_div.c
@@ -181,12 +181,11 @@ static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
BN_CTX *ctx)
{
- int norm_shift,i;
- size_t loop;
+ int norm_shift,i,loop;
BIGNUM *tmp,wnum,*snum,*sdiv,*res;
BN_ULONG *resp,*wnump;
BN_ULONG d0,d1;
- size_t num_n,div_n;
+ int num_n,div_n;
/* Invalid zero-padding would have particularly bad consequences
* in the case of 'num', so don't just rely on bn_check_top() for this one
@@ -266,7 +265,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
resp= &(res->d[loop-1]);
/* space for temp */
- if (!bn_wexpand(tmp, div_n+1)) goto err;
+ if (!bn_wexpand(tmp,(div_n+1))) goto err;
if (BN_ucmp(&wnum,sdiv) >= 0)
{
@@ -430,7 +429,7 @@ static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
BIGNUM *tmp,wnum,*snum,*sdiv,*res;
BN_ULONG *resp,*wnump;
BN_ULONG d0,d1;
- size_t num_n,div_n;
+ int num_n,div_n;
bn_check_top(dv);
bn_check_top(rm);
@@ -499,12 +498,12 @@ static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
/* Setup to 'res' */
res->neg= (num->neg^divisor->neg);
- if (!bn_wexpand(res,loop+1U)) goto err;
+ if (!bn_wexpand(res,(loop+1))) goto err;
res->top=loop-1;
resp= &(res->d[loop-1]);
/* space for temp */
- if (!bn_wexpand(tmp,div_n+1U)) goto err;
+ if (!bn_wexpand(tmp,(div_n+1))) goto err;
/* if res->top == 0 then clear the neg value otherwise decrease
* the resp pointer */