diff --git a/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php b/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php index 24600124..04d5b6e1 100644 --- a/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php +++ b/src/Library/Encryption/Algorithm/KeyEncryption/AbstractECDH.php @@ -89,7 +89,7 @@ protected function calculateAgreementKey(JWK $private_key, JWK $public_key): str $publicPem = ECKey::convertPublicKeyToPEM($public_key); $privatePem = ECKey::convertPrivateKeyToPEM($private_key); - $res = openssl_pkey_derive($publicPem, $privatePem, $curve->getSize()); + $res = openssl_pkey_derive($publicPem, $privatePem); if ($res === false) { throw new RuntimeException('Unable to derive the key'); } diff --git a/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php b/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php index 3eab015c..547b6c46 100644 --- a/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php +++ b/tests/EncryptionAlgorithm/ContentEncryption/AESCBC/AESCBC_HSContentEncryptionTest.php @@ -320,10 +320,8 @@ public function a256CBCHS512EncryptAndDecrypt(): void protected static function getMethod(string $class, string $name): ReflectionMethod { $class = new ReflectionClass($class); - $method = $class->getMethod($name); - $method->setAccessible(true); - return $method; + return $class->getMethod($name); } private function convertArrayToBinString(array $data): string