mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-06-03 09:00:52 +00:00
RSA: fix error when exponent isn't co-prime to lcm
This commit is contained in:
parent
73f167e99e
commit
0149644210
|
@ -641,12 +641,12 @@ class Crypt_RSA {
|
|||
$exponents[$i] = $e->modInverse($temp);
|
||||
}
|
||||
|
||||
list($lcm) = $lcm['top']->divide($lcm['bottom']);
|
||||
$gcd = $lcm->gcd($e);
|
||||
list($temp) = $lcm['top']->divide($lcm['bottom']);
|
||||
$gcd = $temp->gcd($e);
|
||||
$i0 = 1;
|
||||
} while (!$gcd->equals($this->one));
|
||||
|
||||
$d = $e->modInverse($lcm);
|
||||
$d = $e->modInverse($temp);
|
||||
|
||||
$coefficients[2] = $primes[2]->modInverse($primes[1]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user