From 499e167fda19e01d384fb093f18447b5051d5da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodo=20M=C3=B6ller?= Date: Wed, 29 Nov 2000 09:41:19 +0000 Subject: Improve BN_mod_inverse performance. Get the BN_mod_exp_mont bugfix (for handling negative inputs) correct this time. --- crypto/bn/bn_exp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crypto/bn/bn_exp.c') diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c index eab394b962..35ab56efc0 100644 --- a/crypto/bn/bn_exp.c +++ b/crypto/bn/bn_exp.c @@ -376,7 +376,7 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, BN_init(&val[0]); ts=1; - if (!a->neg && BN_ucmp(a,m) >= 0) + if (a->neg || BN_ucmp(a,m) >= 0) { if (!BN_nnmod(&(val[0]),a,m,ctx)) goto err; -- cgit v1.2.3