- AES should try to auto-predict the size of keys when the size isn't specified; last update interfered with that

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@137 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2010-12-02 03:38:22 +00:00
parent 4d4cc0e0f5
commit 354a0965e8
2 changed files with 2 additions and 2 deletions

View File

@ -457,7 +457,7 @@ class Crypt_AES extends Crypt_Rijndael {
$this->key_size = 32;
}
$this->key = substr($this->key, 0, $this->key_size);
$this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));
$this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, 16), 16, chr(0));
if (!isset($this->enmcrypt)) {

View File

@ -532,7 +532,7 @@ class Crypt_Rijndael {
*/
function setKey($key)
{
$this->key = str_pad(substr($key, 0, $this->key_size), $this->key_size, chr(0));
$this->key = $key;
$this->changed = true;
}