Crypt: CS adjustments

This commit is contained in:
terrafrost 2014-11-29 09:52:14 -06:00
parent 8476ae6383
commit 866b690248
2 changed files with 4 additions and 4 deletions

View File

@ -1322,7 +1322,7 @@ class Crypt_Base
$buffer['encrypted'] = substr($encryptIV, $overflow);
} else if (!strlen($buffer['encrypted'])) {
$ciphertext.= openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV);
$encryptIV = $this->_string_pop($ciphertext, $block_size);
$encryptIV = $this->_string_pop($ciphertext, $block_size);
}
$encryptIV = openssl_decrypt($encryptIV, $this->cipher_name_openssl_ecb, $key, $this->openssl_options);
if ($overflow) {
@ -1522,8 +1522,8 @@ class Crypt_Base
switch ($engine) {
case CRYPT_MODE_OPENSSL:
$this->openssl_emulate_ctr = false;
$result = $this->cipher_name_openssl &&
extension_loaded('openssl') &&
$result = $this->cipher_name_openssl &&
extension_loaded('openssl') &&
version_compare(PHP_VERSION, '5.3.0');
if (!$result) {
return false;

View File

@ -957,7 +957,7 @@ class Crypt_Rijndael extends Crypt_Base
// (Currently, for Crypt_Rijndael/AES, one generated $lambda_function cost on php5.5@32bit ~80kb unfreeable mem and ~130kb on php5.5@64bit)
// After that, we'll still create very fast optimized code but not the hi-ultimative code, for each $mode one.
$gen_hi_opt_code = (bool)( count($lambda_functions) < 10 );
// Generation of a uniqe hash for our generated code
$code_hash = "Crypt_Rijndael, {$this->mode}, {$this->Nr}, {$this->Nb}";
if ($gen_hi_opt_code) {