1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-11 16:49:42 +01:00

RSA/PrivateKey: add comment to explain things

This commit is contained in:
terrafrost 2022-02-14 17:59:41 -06:00
parent 3460c70e3a
commit 91a674a781

View File

@ -228,7 +228,7 @@ class PrivateKey extends RSA implements Common\PrivateKey
$h = $this->hash->hash($m2); $h = $this->hash->hash($m2);
$ps = str_repeat(chr(0), $emLen - $sLen - $this->hLen - 2); $ps = str_repeat(chr(0), $emLen - $sLen - $this->hLen - 2);
$db = $ps . chr(1) . $salt; $db = $ps . chr(1) . $salt;
$dbMask = $this->mgf1($h, $emLen - $this->hLen - 1); $dbMask = $this->mgf1($h, $emLen - $this->hLen - 1); // ie. stlren($db)
$maskedDB = $db ^ $dbMask; $maskedDB = $db ^ $dbMask;
$maskedDB[0] = ~chr(0xFF << ($emBits & 7)) & $maskedDB[0]; $maskedDB[0] = ~chr(0xFF << ($emBits & 7)) & $maskedDB[0];
$em = $maskedDB . $h . chr(0xBC); $em = $maskedDB . $h . chr(0xBC);