public function unwrapPad(string $ciphertext, string $kek): string
    {
        if (0 !== strlen($ciphertext) % 8) {
            throw new \UnexpectedValueException(
                "Ciphertext length must be a multiple of 64 bits.");
        }
        $this->_checkKEKSize($kek);
        list($P, $A) = $this->_unwrapPaddedCiphertext($ciphertext, $kek);
        // check message integrity
        $this->_checkPaddedIntegrity($A);
        // verify padding
        $len = $this->_verifyPadding($P, $A);
        // remove padding and return unwrapped key
        return substr(implode("", $P), 0, $len);
    }