Loading crypto/bn/bn_exp.c +16 −15 Original line number Diff line number Diff line Loading @@ -240,11 +240,6 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, ret = BN_one(r); return ret; } if (BN_is_zero(a)) { ret = BN_zero(r); return ret; } BN_CTX_start(ctx); if ((aa = BN_CTX_get(ctx)) == NULL) goto err; Loading @@ -256,6 +251,11 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, ts=1; if (!BN_nnmod(&(val[0]),a,m,ctx)) goto err; /* 1 */ if (BN_is_zero(&(val[0]))) { ret = BN_zero(r); goto err; } window = BN_window_bits_for_exponent_size(bits); if (window > 1) Loading Loading @@ -365,11 +365,7 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, ret = BN_one(rr); return ret; } if (BN_is_zero(a)) { ret = BN_zero(rr); return ret; } BN_CTX_start(ctx); d = BN_CTX_get(ctx); r = BN_CTX_get(ctx); Loading @@ -396,6 +392,11 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } else aa=a; if (BN_is_zero(aa)) { ret = BN_zero(rr); goto err; } if (!BN_to_montgomery(&(val[0]),aa,mont,ctx)) goto err; /* 1 */ window = BN_window_bits_for_exponent_size(bits); Loading Loading @@ -632,11 +633,6 @@ int BN_mod_exp_simple(BIGNUM *r, ret = BN_one(r); return ret; } if (BN_is_zero(a)) { ret = BN_one(r); return ret; } BN_CTX_start(ctx); if ((d = BN_CTX_get(ctx)) == NULL) goto err; Loading @@ -644,6 +640,11 @@ int BN_mod_exp_simple(BIGNUM *r, BN_init(&(val[0])); ts=1; if (!BN_nnmod(&(val[0]),a,m,ctx)) goto err; /* 1 */ if (BN_is_zero(&(val[0]))) { ret = BN_one(r); return ret; } window = BN_window_bits_for_exponent_size(bits); if (window > 1) Loading crypto/bn/bn_exp2.c +13 −7 Original line number Diff line number Diff line Loading @@ -144,11 +144,6 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, ret = BN_one(rr); return ret; } if (BN_is_zero(a1) || BN_is_zero(a2)) { ret = BN_zero(rr); return ret; } bits=(bits1 > bits2)?bits1:bits2; Loading @@ -173,7 +168,7 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, */ BN_init(&val1[0]); ts1=1; if (BN_ucmp(a1,m) >= 0) if (a1->neg || BN_ucmp(a1,m) >= 0) { if (!BN_mod(&(val1[0]),a1,m,ctx)) goto err; Loading @@ -181,6 +176,12 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, } else a_mod_m = a1; if (BN_is_zero(&(val1[0]))) { ret = BN_zero(rr); goto err; } if (!BN_to_montgomery(&(val1[0]),a_mod_m,mont,ctx)) goto err; if (window1 > 1) { Loading @@ -202,7 +203,7 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, */ BN_init(&val2[0]); ts2=1; if (BN_ucmp(a2,m) >= 0) if (a2->neg || BN_ucmp(a2,m) >= 0) { if (!BN_mod(&(val2[0]),a2,m,ctx)) goto err; Loading @@ -210,6 +211,11 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, } else a_mod_m = a2; if (BN_is_zero(&(val2[0]))) { ret = BN_zero(rr); goto err; } if (!BN_to_montgomery(&(val2[0]),a_mod_m,mont,ctx)) goto err; if (window2 > 1) { Loading Loading
crypto/bn/bn_exp.c +16 −15 Original line number Diff line number Diff line Loading @@ -240,11 +240,6 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, ret = BN_one(r); return ret; } if (BN_is_zero(a)) { ret = BN_zero(r); return ret; } BN_CTX_start(ctx); if ((aa = BN_CTX_get(ctx)) == NULL) goto err; Loading @@ -256,6 +251,11 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, ts=1; if (!BN_nnmod(&(val[0]),a,m,ctx)) goto err; /* 1 */ if (BN_is_zero(&(val[0]))) { ret = BN_zero(r); goto err; } window = BN_window_bits_for_exponent_size(bits); if (window > 1) Loading Loading @@ -365,11 +365,7 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, ret = BN_one(rr); return ret; } if (BN_is_zero(a)) { ret = BN_zero(rr); return ret; } BN_CTX_start(ctx); d = BN_CTX_get(ctx); r = BN_CTX_get(ctx); Loading @@ -396,6 +392,11 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } else aa=a; if (BN_is_zero(aa)) { ret = BN_zero(rr); goto err; } if (!BN_to_montgomery(&(val[0]),aa,mont,ctx)) goto err; /* 1 */ window = BN_window_bits_for_exponent_size(bits); Loading Loading @@ -632,11 +633,6 @@ int BN_mod_exp_simple(BIGNUM *r, ret = BN_one(r); return ret; } if (BN_is_zero(a)) { ret = BN_one(r); return ret; } BN_CTX_start(ctx); if ((d = BN_CTX_get(ctx)) == NULL) goto err; Loading @@ -644,6 +640,11 @@ int BN_mod_exp_simple(BIGNUM *r, BN_init(&(val[0])); ts=1; if (!BN_nnmod(&(val[0]),a,m,ctx)) goto err; /* 1 */ if (BN_is_zero(&(val[0]))) { ret = BN_one(r); return ret; } window = BN_window_bits_for_exponent_size(bits); if (window > 1) Loading
crypto/bn/bn_exp2.c +13 −7 Original line number Diff line number Diff line Loading @@ -144,11 +144,6 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, ret = BN_one(rr); return ret; } if (BN_is_zero(a1) || BN_is_zero(a2)) { ret = BN_zero(rr); return ret; } bits=(bits1 > bits2)?bits1:bits2; Loading @@ -173,7 +168,7 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, */ BN_init(&val1[0]); ts1=1; if (BN_ucmp(a1,m) >= 0) if (a1->neg || BN_ucmp(a1,m) >= 0) { if (!BN_mod(&(val1[0]),a1,m,ctx)) goto err; Loading @@ -181,6 +176,12 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, } else a_mod_m = a1; if (BN_is_zero(&(val1[0]))) { ret = BN_zero(rr); goto err; } if (!BN_to_montgomery(&(val1[0]),a_mod_m,mont,ctx)) goto err; if (window1 > 1) { Loading @@ -202,7 +203,7 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, */ BN_init(&val2[0]); ts2=1; if (BN_ucmp(a2,m) >= 0) if (a2->neg || BN_ucmp(a2,m) >= 0) { if (!BN_mod(&(val2[0]),a2,m,ctx)) goto err; Loading @@ -210,6 +211,11 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, } else a_mod_m = a2; if (BN_is_zero(&(val2[0]))) { ret = BN_zero(rr); goto err; } if (!BN_to_montgomery(&(val2[0]),a_mod_m,mont,ctx)) goto err; if (window2 > 1) { Loading