From e706c549c107b177593f00bf29e1af1a0bb881d2 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Fri, 8 Mar 2019 08:36:16 -0600 Subject: [PATCH] Hash: adjustments for 2.0 branch --- phpseclib/Crypt/Hash.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index 42a0a8a0..d89fd2d7 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -203,13 +203,13 @@ class Hash } switch ($mode) { - case CRYPT_HASH_MODE_MHASH: + case self::MODE_MHASH: $this->computedKey = mhash($this->hash, $this->key); break; - case CRYPT_HASH_MODE_HASH: + case self::MODE_HASH: $this->computedKey = hash($this->hash, $this->key, true); break; - case CRYPT_HASH_MODE_INTERNAL: + case self::MODE_INTERNAL: $this->computedKey = call_user_func($this->hash, $this->key); } } @@ -306,7 +306,7 @@ class Hash default: $this->hash = MHASH_SHA1; } - $this->_computeKey(CRYPT_HASH_MODE_MHASH); + $this->_computeKey(self::MODE_MHASH); return; case self::MODE_HASH: switch ($hash) { @@ -323,7 +323,7 @@ class Hash default: $this->hash = 'sha1'; } - $this->_computeKey(CRYPT_HASH_MODE_HASH); + $this->_computeKey(self::MODE_HASH); return; } @@ -349,7 +349,7 @@ class Hash $this->ipad = str_repeat(chr(0x36), $this->b); $this->opad = str_repeat(chr(0x5C), $this->b); - $this->_computeKey(CRYPT_HASH_MODE_INTERNAL); + $this->_computeKey(self::MODE_INTERNAL); } /**