public function wrap(string $key, string $kek): string
    {
        $key_len = strlen($key);
        // rfc3394 dictates n to be at least 2
        if ($key_len < 16) {
            throw new \UnexpectedValueException(
                "Key length must be at least 16 octets.");
        }
        if (0 !== $key_len % 8) {
            throw new \UnexpectedValueException(
                "Key length must be a multiple of 64 bits.");
        }
        $this->_checkKEKSize($kek);
        // P = plaintext as 64 bit blocks
        $P = [];
        $i = 1;
        foreach (str_split($key, 8) as $val) {
            $P[$i++] = $val;
        }
        $C = $this->_wrapBlocks($P, $kek, $this->_iv);
        return implode("", $C);
    }