aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_exp.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2008-11-01 14:37:00 +0000
committerBen Laurie <ben@openssl.org>2008-11-01 14:37:00 +0000
commit4d6e1e4f29de455b5e644ea9cae5d5f5a2dbef33 (patch)
tree9b43a103ede688bfb7b006837387dacb02ec3dc5 /crypto/bn/bn_exp.c
parent122396f2dbeda0f25e9af1bb069a324ec793da57 (diff)
downloadopenssl-4d6e1e4f29de455b5e644ea9cae5d5f5a2dbef33.tar.gz
size_tification.
Diffstat (limited to 'crypto/bn/bn_exp.c')
-rw-r--r--crypto/bn/bn_exp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c
index 70a33f0d93..ac590e0f9d 100644
--- a/crypto/bn/bn_exp.c
+++ b/crypto/bn/bn_exp.c
@@ -521,7 +521,8 @@ 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, int top, unsigned char *buf, int idx, int width)
+static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, size_t top,
+ unsigned char *buf, int idx, int width)
{
size_t i, j;
@@ -541,7 +542,9 @@ static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top, unsigned char *buf,
return 1;
}
-static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, int width)
+static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, size_t top,
+ unsigned char *buf, int idx,
+ int width)
{
size_t i, j;
@@ -572,14 +575,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;
- int top;
+ size_t top;
BIGNUM *r;
const BIGNUM *aa;
BN_MONT_CTX *mont=NULL;
int numPowers;
unsigned char *powerbufFree=NULL;
- int powerbufLen = 0;
+ size_t powerbufLen = 0;
unsigned char *powerbuf=NULL;
BIGNUM *computeTemp=NULL, *am=NULL;
@@ -625,7 +628,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=(unsigned char*)OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL)
+ if ((powerbufFree=OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL)
goto err;
powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);