mirror of
https://github.com/danog/phpseclib.git
synced 2025-01-22 04:51:19 +01:00
fix bad merge
This commit is contained in:
parent
11977eeb3c
commit
abb6a62384
@ -536,19 +536,6 @@ abstract class Base
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP4 compatible Default Constructor.
|
||||
*
|
||||
* @see self::__construct()
|
||||
* @param int $mode
|
||||
* @access public
|
||||
*/
|
||||
function Crypt_Base($mode = CRYPT_MODE_CBC)
|
||||
{
|
||||
$this->__construct($mode);
|
||||
>>>>>>> bcrypt
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the initialization vector. (optional)
|
||||
*
|
||||
@ -658,10 +645,6 @@ abstract class Base
|
||||
|
||||
switch ($method) {
|
||||
case 'bcrypt':
|
||||
if (!class_exists('Crypt_Blowfish')) {
|
||||
include_once 'Crypt/Blowfish.php';
|
||||
}
|
||||
|
||||
$func_args = func_get_args();
|
||||
|
||||
if (!isset($func_args[2])) {
|
||||
@ -673,7 +656,7 @@ abstract class Base
|
||||
$rounds = isset($func_args[3]) ? $func_args[3] : 16;
|
||||
$keylen = isset($func_args[4]) ? $func_args[4] : $this->key_length;
|
||||
|
||||
$bf = new Crypt_Blowfish();
|
||||
$bf = new Blowfish();
|
||||
$key = $bf->bcrypt_pbkdf($password, $salt, $keylen + $this->block_size, $rounds);
|
||||
if (!$key) {
|
||||
return false;
|
||||
|
@ -532,12 +532,8 @@ class Blowfish extends Base
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!class_exists('Crypt_Hash')) {
|
||||
include_once 'Crypt/Hash.php';
|
||||
}
|
||||
|
||||
if (!isset($this->sha512)) {
|
||||
$this->sha512 = new Crypt_Hash('sha512');
|
||||
$this->sha512 = new Hash('sha512');
|
||||
}
|
||||
|
||||
$sha2pass = $this->sha512->hash($pass);
|
||||
|
@ -1555,10 +1555,7 @@ class RSA
|
||||
}
|
||||
$salt = $this->_string_shift($kdfoptions, $length);
|
||||
extract(unpack('Nrounds', $this->_string_shift($kdfoptions, 4)));
|
||||
if (!class_exists('Crypt_AES')) {
|
||||
include_once 'Crypt/AES.php';
|
||||
}
|
||||
$crypto = new Crypt_AES(CRYPT_MODE_CTR);
|
||||
$crypto = new AES(AES::MODE_CTR);
|
||||
$crypto->disablePadding();
|
||||
if (!$crypto->setPassword($this->password, 'bcrypt', $salt, $rounds, 32)) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user