phpseclib/phpseclib — pull request #46 by petrich (2013-01-10 16:32:08+00:00)
Title: AES: Fix broken CFB and disableContinuousBuffer()

Related to: https://github.com/phpseclib/phpseclib/pull/45
Using mcrypt's (n)cfb mode better as Terra pointed it out.

Speedtest:
```php
define('CRYPT_AES_MODE',CRYPT_AES_MODE_MCRYPT);
$aes = new Crypt_AES(CRYPT_AES_MODE_CFB);
$aes->enableContinuousBuffer();

for($part_max_len=1;$part_max_len<=1000;$part_max_len*=10)
{
$text = str_repeat('a',10000*$part_max_len);
for($j=0;$j<3;$j++)
{
echo strlen($text)." bytes, randomly partitionated (between 1 and $part_max_len bytes each partition)... ";
$s=microtime(true);

for($i=0,$len=strlen($text);$i<$len;)
{
$part_len=mt_rand(1,$part_max_len);
$aes->decrypt($aes->encrypt(substr($text,$i,$part_len)));
$i+=$part_len;
}

$e=microtime(true);
echo "Time: ".round($e-$s,2)."\n";
}
echo "\n";
}

```