Skip to content
Permalink
Browse files Browse the repository at this point in the history
Update phpseclib to 2.0.1
New version uses PHP 7.0 random_bytes to generate cryptographically secure
pseudo-random bytes.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jan 19, 2016
1 parent f20970d commit cb7748a
Show file tree
Hide file tree
Showing 4 changed files with 305 additions and 339 deletions.
20 changes: 10 additions & 10 deletions libraries/phpseclib/Crypt/AES.php
Expand Up @@ -11,13 +11,13 @@
* just a wrapper to Rijndael.php you may consider using Rijndael.php instead of
* to save one include_once().
*
* If {@link \phpseclib\Crypt\AES::setKeyLength() setKeyLength()} isn't called, it'll be calculated from
* {@link \phpseclib\Crypt\AES::setKey() setKey()}. ie. if the key is 128-bits, the key length will be 128-bits. If it's 136-bits
* it'll be null-padded to 192-bits and 192 bits will be the key length until {@link \phpseclib\Crypt\AES::setKey() setKey()}
* If {@link self::setKeyLength() setKeyLength()} isn't called, it'll be calculated from
* {@link self::setKey() setKey()}. ie. if the key is 128-bits, the key length will be 128-bits. If it's 136-bits
* it'll be null-padded to 192-bits and 192 bits will be the key length until {@link self::setKey() setKey()}
* is called, again, at which point, it'll be recalculated.
*
* Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, some functions are available to be called that, in the context of AES, don't
* make a whole lot of sense. {@link \phpseclib\Crypt\AES::setBlockLength() setBlockLength()}, for instance. Calling that function,
* make a whole lot of sense. {@link self::setBlockLength() setBlockLength()}, for instance. Calling that function,
* however possible, won't do anything (AES has a fixed block length whereas Rijndael has a variable one).
*
* Here's a short example of how to use this library:
Expand Down Expand Up @@ -67,7 +67,7 @@ class AES extends Rijndael
*
* @see \phpseclib\Crypt\Rijndael::setBlockLength()
* @access public
* @param Integer $length
* @param int $length
*/
function setBlockLength($length)
{
Expand All @@ -82,7 +82,7 @@ function setBlockLength($length)
*
* @see \phpseclib\Crypt\Rijndael:setKeyLength()
* @access public
* @param Integer $length
* @param int $length
*/
function setKeyLength($length)
{
Expand All @@ -104,7 +104,7 @@ function setKeyLength($length)
* @see \phpseclib\Crypt\Rijndael:setKey()
* @see setKeyLength()
* @access public
* @param String $key
* @param string $key
*/
function setKey($key)
{
Expand All @@ -114,13 +114,13 @@ function setKey($key)
$length = strlen($key);
switch (true) {
case $length <= 16:
$this->key_size = 16;
$this->key_length = 16;
break;
case $length <= 24:
$this->key_size = 24;
$this->key_length = 24;
break;
default:
$this->key_size = 32;
$this->key_length = 32;
}
$this->_setEngine();
}
Expand Down

0 comments on commit cb7748a

Please sign in to comment.