diff options
author | Geoff Thorpe <geoff@openssl.org> | 2008-11-12 03:58:08 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2008-11-12 03:58:08 +0000 |
commit | 6343829a391df59e46e513c84b6264ee71ad9518 (patch) | |
tree | 9823103bf5828e47081ac906203516bdc332f577 /crypto/bn/bn_exp.c | |
parent | 2401debe83e8df930907a39065ebf9a54354f123 (diff) | |
download | openssl-6343829a391df59e46e513c84b6264ee71ad9518.tar.gz |
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_exp.c')
-rw-r--r-- | crypto/bn/bn_exp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c index ac590e0f9d..70a33f0d93 100644 --- a/crypto/bn/bn_exp.c +++ b/crypto/bn/bn_exp.c @@ -521,8 +521,7 @@ err: * as cache lines are concerned. The following functions are used to transfer a BIGNUM * from/to that table. */ -static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, size_t top, - unsigned char *buf, int idx, int width) +static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, int width) { size_t i, j; @@ -542,9 +541,7 @@ static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, size_t top, return 1; } -static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, size_t top, - unsigned char *buf, int idx, - int width) +static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, int width) { size_t i, j; @@ -575,14 +572,14 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) { int i,bits,ret=0,idx,window,wvalue; - size_t top; + int top; BIGNUM *r; const BIGNUM *aa; BN_MONT_CTX *mont=NULL; int numPowers; unsigned char *powerbufFree=NULL; - size_t powerbufLen = 0; + int powerbufLen = 0; unsigned char *powerbuf=NULL; BIGNUM *computeTemp=NULL, *am=NULL; @@ -628,7 +625,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, */ numPowers = 1 << window; powerbufLen = sizeof(m->d[0])*top*numPowers; - if ((powerbufFree=OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL) + if ((powerbufFree=(unsigned char*)OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL) goto err; powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree); |