Hash: tweaks to hash pre-computation

This commit is contained in:
terrafrost 2018-10-12 23:04:57 -05:00
parent 685e0abcc6
commit 2d7aadc689

View File

@ -126,6 +126,15 @@ class Crypt_Hash
*/ */
var $key = false; var $key = false;
/**
* Computed Key
*
* @see self::_computeKey()
* @var string
* @access private
*/
var $computedKey = false;
/** /**
* Outer XOR (Internal HMAC) * Outer XOR (Internal HMAC)
* *
@ -209,6 +218,11 @@ class Crypt_Hash
*/ */
function _computeKey() function _computeKey()
{ {
if ($this->key === false) {
$this->computedKey = false;
return;
}
if (strlen($this->key) <= $this->b) { if (strlen($this->key) <= $this->b) {
$this->computedKey = $this->key; $this->computedKey = $this->key;
return; return;