mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 03:27:31 +00:00
[issue/39] Test case for Github ContinuousBuffer issue 39.
This commit is contained in:
parent
318ac0bd86
commit
f15bc38520
26
tests/Crypt/AES/ContinuousBufferTest.php
Normal file
26
tests/Crypt/AES/ContinuousBufferTest.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Andreas Fischer <bantu@phpbb.com>
|
||||
* @copyright MMXIII Andreas Fischer
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
*/
|
||||
|
||||
class Crypt_AES_ContinuousBufferTest extends Crypt_AES_TestCase
|
||||
{
|
||||
// https://github.com/phpseclib/phpseclib/issues/39
|
||||
public function testGithubIssue39EncryptDecrypt()
|
||||
{
|
||||
$aes = new Crypt_AES(CRYPT_AES_MODE_CFB);
|
||||
$aes->enableContinuousBuffer();
|
||||
|
||||
$expected = '12345678901234567';
|
||||
$actual = '';
|
||||
|
||||
for ($i = 0, $strlen = strlen($expected); $i < $strlen; ++$i)
|
||||
{
|
||||
$actual .= $aes->decrypt($aes->encrypt($expected[$i]));
|
||||
}
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user