phpseclib\Crypt\Blowfish::_decryptBlock PHP Method

_decryptBlock() public method

Decrypts a block
public _decryptBlock ( string $in ) : string
$in string
return string
    function _decryptBlock($in)
    {
        $p = $this->bctx["p"];
        $sb_0 = $this->bctx["sb"][0];
        $sb_1 = $this->bctx["sb"][1];
        $sb_2 = $this->bctx["sb"][2];
        $sb_3 = $this->bctx["sb"][3];
        $in = unpack("N*", $in);
        $l = $in[1];
        $r = $in[2];
        for ($i = 17; $i > 2; $i -= 2) {
            $l ^= $p[$i];
            $r ^= ($sb_0[$l >> 24 & 0xff] + $sb_1[$l >> 16 & 0xff] ^ $sb_2[$l >> 8 & 0xff]) + $sb_3[$l & 0xff];
            $r ^= $p[$i - 1];
            $l ^= ($sb_0[$r >> 24 & 0xff] + $sb_1[$r >> 16 & 0xff] ^ $sb_2[$r >> 8 & 0xff]) + $sb_3[$r & 0xff];
        }
        return pack("N*", $r ^ $p[0], $l ^ $p[1]);
    }