diff options
author | Bodo Möller <bodo@openssl.org> | 2000-11-30 00:18:19 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-11-30 00:18:19 +0000 |
commit | cd2eebfd6497ac1ca4d450960ba843f14643a9b2 (patch) | |
tree | 04a45f2588ea5b3a984aab36c32fa75c6471cbc1 /crypto/bn/bn_exp2.c | |
parent | 06676624fc148d511543586502126b3f2bf8b5dd (diff) |
BN_sqrt
Diffstat (limited to 'crypto/bn/bn_exp2.c')
-rw-r--r-- | crypto/bn/bn_exp2.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/bn/bn_exp2.c b/crypto/bn/bn_exp2.c index 70c4d83a79..56f1c959bd 100644 --- a/crypto/bn/bn_exp2.c +++ b/crypto/bn/bn_exp2.c @@ -141,9 +141,15 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, bits2=BN_num_bits(p2); if ((bits1 == 0) && (bits2 == 0)) { - BN_one(rr); - return(1); + 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; BN_CTX_start(ctx); |