Skip to content

[Insight] Code should not be duplicated - in src/Component/…/Util/RSACrypt.php, line 230 #32

@Spomky

Description

@Spomky

in src/Component/Encryption/Util/RSACrypt.php, line 230

The next 28 lines appear both in src/Component/Encryption/Util/RSACrypt.php:230 and src/Component/Signature/Util/RSA.php:65.

     *
     * @return BigInteger
     */
    private static function exponentiate(RSAKey $key, BigInteger $c): BigInteger
    {
        if ($key->isPublic() || empty($key->getPrimes()) || empty($key->getExponents()) || null === $key->getCoefficient()) {
            return $c->modPow($key->getExponent(), $key->getModulus());
        }

        $p = $key->getPrimes()[0];
        $q = $key->getPrimes()[1];

Posted from SensioLabsInsight

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions