diff --git a/tests/Unit/Crypt/DES.php b/tests/Unit/Crypt/DES.php index 56810bbe..9ae77c03 100644 --- a/tests/Unit/Crypt/DES.php +++ b/tests/Unit/Crypt/DES.php @@ -22,9 +22,7 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase $result = pack('H*', '3e7613642049af1e'); $internal = $des->encrypt('d'); - if (!$this->assertEquals($result, $internal)) { - $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result'); - } + $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result'); $des->setPreferredEngine(CRYPT_ENGINE_MCRYPT); if ($des->getEngine() == CRYPT_ENGINE_MCRYPT) { @@ -57,10 +55,13 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase $des->setPreferredEngine(CRYPT_ENGINE_INTERNAL); $internal = $des->decrypt('d'); + $result = pack('H*', '36a86ebd0f9e048f'); + $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result'); + $des->setPreferredEngine(CRYPT_ENGINE_MCRYPT); if ($des->getEngine() == CRYPT_ENGINE_MCRYPT) { $mcrypt = $des->decrypt('d'); - $this->assertEquals($internal, $mcrypt, 'Failed asserting that the internal and mcrypt engines produce identical results'); + $this->assertEquals($result, $mcrypt, 'Failed asserting that the mcrypt engine produced the correct result'); } else { self::markTestSkipped('Unable to initialize mcrypt engine'); } @@ -68,7 +69,7 @@ class Unit_Crypt_DES_TestCase extends PhpseclibTestCase $des->setPreferredEngine(CRYPT_ENGINE_OPENSSL); if ($des->getEngine() == CRYPT_ENGINE_OPENSSL) { $openssl = $des->decrypt('d'); - $this->assertEquals($internal, $openssl, 'Failed asserting that the internal and OpenSSL engines produce identical results'); + $this->assertEquals($result, $openssl, 'Failed asserting that the OpenSSL engine produced the correct result'); } else { self::markTestSkipped('Unable to initialize OpenSSL engine'); }