mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-09 23:28:33 +00: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)
|
* Sets the initialization vector. (optional)
|
||||||
*
|
*
|
||||||
@ -658,10 +645,6 @@ abstract class Base
|
|||||||
|
|
||||||
switch ($method) {
|
switch ($method) {
|
||||||
case 'bcrypt':
|
case 'bcrypt':
|
||||||
if (!class_exists('Crypt_Blowfish')) {
|
|
||||||
include_once 'Crypt/Blowfish.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
$func_args = func_get_args();
|
$func_args = func_get_args();
|
||||||
|
|
||||||
if (!isset($func_args[2])) {
|
if (!isset($func_args[2])) {
|
||||||
@ -673,7 +656,7 @@ abstract class Base
|
|||||||
$rounds = isset($func_args[3]) ? $func_args[3] : 16;
|
$rounds = isset($func_args[3]) ? $func_args[3] : 16;
|
||||||
$keylen = isset($func_args[4]) ? $func_args[4] : $this->key_length;
|
$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);
|
$key = $bf->bcrypt_pbkdf($password, $salt, $keylen + $this->block_size, $rounds);
|
||||||
if (!$key) {
|
if (!$key) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -532,12 +532,8 @@ class Blowfish extends Base
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists('Crypt_Hash')) {
|
|
||||||
include_once 'Crypt/Hash.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($this->sha512)) {
|
if (!isset($this->sha512)) {
|
||||||
$this->sha512 = new Crypt_Hash('sha512');
|
$this->sha512 = new Hash('sha512');
|
||||||
}
|
}
|
||||||
|
|
||||||
$sha2pass = $this->sha512->hash($pass);
|
$sha2pass = $this->sha512->hash($pass);
|
||||||
|
@ -1555,10 +1555,7 @@ class RSA
|
|||||||
}
|
}
|
||||||
$salt = $this->_string_shift($kdfoptions, $length);
|
$salt = $this->_string_shift($kdfoptions, $length);
|
||||||
extract(unpack('Nrounds', $this->_string_shift($kdfoptions, 4)));
|
extract(unpack('Nrounds', $this->_string_shift($kdfoptions, 4)));
|
||||||
if (!class_exists('Crypt_AES')) {
|
$crypto = new AES(AES::MODE_CTR);
|
||||||
include_once 'Crypt/AES.php';
|
|
||||||
}
|
|
||||||
$crypto = new Crypt_AES(CRYPT_MODE_CTR);
|
|
||||||
$crypto->disablePadding();
|
$crypto->disablePadding();
|
||||||
if (!$crypto->setPassword($this->password, 'bcrypt', $salt, $rounds, 32)) {
|
if (!$crypto->setPassword($this->password, 'bcrypt', $salt, $rounds, 32)) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user