Hello!

BN_mod_inverse has a lines such as:
 if (sign < 0)
  {
    if (!BN_sub(Y,n,Y)) goto err;
  }

This is incorrect call of BN_sub(BIGNUM *r, const BIGNUM *a, const
BIGNUM *b), because BN_sub change first parameter r during arithmetic
operations and suppose r and b are different objects.

I think those lines of code must be look like this:
if (sign < 0)
  {
    if (!BN_sub(R,n,Y)) goto err;
    if (BN_copy(Y,R) == NULL) goto err;
  }

-- 
 Eugene.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to