mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-08 14:51:00 +00:00
Merge branch '3.0'
This commit is contained in:
commit
259bd9f1e8
@ -385,35 +385,6 @@ abstract class TestCase extends PhpseclibTestCase
|
||||
$this->assertSame($aes->getKeyLength(), 256);
|
||||
}
|
||||
|
||||
public function testInvalidLengthKeyWithAES()
|
||||
{
|
||||
$plaintext = str_repeat('x', 16);
|
||||
|
||||
$aes = new Crypt_Rijndael();
|
||||
$aes->setKey(str_repeat('a', 19));
|
||||
$this->assertSame($aes->getKeyLength(), 160);
|
||||
|
||||
$ref = new Crypt_Rijndael();
|
||||
$ref->setKey(str_repeat('a', 19) . "\0");
|
||||
$this->assertSame(
|
||||
bin2hex($aes->encrypt($plaintext)),
|
||||
bin2hex($ref->encrypt($plaintext)),
|
||||
'actual and expected value do not match for 168 bit Rijndael'
|
||||
);
|
||||
|
||||
$aes = new Crypt_AES();
|
||||
$aes->setKey(str_repeat('a', 19));
|
||||
$this->assertSame($aes->getKeyLength(), 192);
|
||||
|
||||
$ref = new Crypt_AES();
|
||||
$ref->setKey(str_repeat('a', 19) . "\0\0\0\0\0");
|
||||
$this->assertSame(
|
||||
bin2hex($aes->encrypt($plaintext)),
|
||||
bin2hex($ref->encrypt($plaintext)),
|
||||
'actual and expected value do not match for 168 bit AES'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group github938
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user