protected function isMacValid($data, $bytes)
    {
        $calculated = hash_hmac(
            'sha384', $this->mac($data['iv'], $data['value']), $bytes, true
        );

        return hash_equals(
            hash_hmac('sha384', $data['hash_mac'], $bytes, true), $calculated
        );
    }