1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef LECMACCALCULATOR_H
4#define LECMACCALCULATOR_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtCore/private/qglobal_p.h>
18#include <QtCore/quuid.h>
19
20QT_BEGIN_NAMESPACE
21
22class Q_AUTOTEST_EXPORT LeCmacCalculator
23{
24public:
25 LeCmacCalculator();
26 ~LeCmacCalculator();
27
28 static QByteArray createFullMessage(const QByteArray &message, quint32 signCounter);
29
30 quint64 calculateMac(const QByteArray &message, QUuid::Id128Bytes csrk) const;
31
32 // Convenience function.
33 bool verify(const QByteArray &message, QUuid::Id128Bytes csrk, quint64 expectedMac) const;
34
35private:
36 int m_baseSocket = -1;
37};
38
39
40QT_END_NAMESPACE
41
42#endif // Header guard
43

source code of qtconnectivity/src/bluetooth/lecmaccalculator_p.h