1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-27 12:55:58 +01:00

Tests: CS adjustments

This commit is contained in:
terrafrost 2014-12-13 13:47:37 -06:00
parent 9a55ab1892
commit 4d6e7efda6
3 changed files with 14 additions and 14 deletions

View File

@ -11,7 +11,7 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
{
protected $engine;
private function checkEngine($aes)
private function _checkEngine($aes)
{
if ($aes->getEngine() != $this->engine) {
$engine = 'internal';
@ -78,7 +78,7 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
$aes->setIV($iv);
$aes->setKey($key);
$this->checkEngine($aes);
$this->_checkEngine($aes);
$actual = '';
for ($i = 0, $strlen = strlen($plaintext); $i < $strlen; ++$i) {
@ -100,7 +100,7 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
$aes->setPreferredEngine($this->engine);
$aes->disablePadding();
$aes->setKey(pack('H*', '2b7e151628aed2a6abf7158809cf4f3c762e7160')); // 160-bit key. Valid in Rijndael.
//$this->checkEngine($aes); // should only work in internal mode
//$this->_checkEngine($aes); // should only work in internal mode
$ciphertext = $aes->encrypt(pack('H*', '3243f6a8885a308d313198a2e0370734'));
$this->assertEquals($ciphertext, pack('H*', '231d844639b31b412211cfe93712b880'));
}
@ -116,7 +116,7 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
$aes->setPreferredEngine($this->engine);
$aes->disablePadding();
$aes->setKey(pack('H*', '2b7e151628aed2a6abf7158809cf4f3c762e7160')); // 160-bit key. AES should null pad to 192-bits
$this->checkEngine($aes);
$this->_checkEngine($aes);
$ciphertext = $aes->encrypt(pack('H*', '3243f6a8885a308d313198a2e0370734'));
$this->assertEquals($ciphertext, pack('H*', 'c109292b173f841b88e0ee49f13db8c0'));
}
@ -176,7 +176,7 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
$aes->setKey($key);
$aes->setIV($iv);
$this->checkEngine($aes);
$this->_checkEngine($aes);
$str = '';
$result = '';
@ -193,7 +193,7 @@ abstract class Unit_Crypt_AES_TestCase extends PhpseclibTestCase
$aes->setKey($key);
$aes->setIV($iv);
$this->checkEngine($aes);
$this->_checkEngine($aes);
foreach ($test as $len) {
$temp = str_repeat('d', $len);