Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qmessageauthenticationcode.h
Go to the documentation of this file.
1
// Copyright (C) 2013 Ruslan Nigmatullin <euroelessar@yandex.ru>
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:critical reason:cryptography
4
5
#
ifndef
QMESSAGEAUTHENTICATIONCODE_H
6
#
define
QMESSAGEAUTHENTICATIONCODE_H
7
8
#
include
<
QtCore
/
qcryptographichash
.
h
>
9
10
QT_BEGIN_NAMESPACE
11
12
13
class
QMessageAuthenticationCodePrivate
;
14
class
QIODevice;
15
16
// implemented in qcryptographichash.cpp
17
class
Q_CORE_EXPORT
QMessageAuthenticationCode
18
{
19
public
:
20
#
if
QT_CORE_REMOVED_SINCE
(
6
,
6
)
21
explicit
QMessageAuthenticationCode(QCryptographicHash::Algorithm method,
22
const
QByteArray &key);
23
#
endif
24
explicit
QMessageAuthenticationCode(QCryptographicHash::Algorithm method,
25
QByteArrayView key = {});
26
27
QMessageAuthenticationCode(QMessageAuthenticationCode &&other)
noexcept
28
: d{std::exchange(other.d,
nullptr
)} {}
29
~QMessageAuthenticationCode();
30
31
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QMessageAuthenticationCode)
32
void
swap(QMessageAuthenticationCode &other)
noexcept
33
{ qt_ptr_swap(d, other.d); }
34
35
void
reset()
noexcept
;
36
37
#
if
QT_CORE_REMOVED_SINCE
(
6
,
6
)
38
void
setKey(
const
QByteArray &key);
39
#
endif
40
void
setKey(QByteArrayView key)
noexcept
;
41
42
void
addData(
const
char
*data, qsizetype length);
43
#
if
QT_CORE_REMOVED_SINCE
(
6
,
6
)
44
void
addData(
const
QByteArray &data);
45
#
endif
46
void
addData(QByteArrayView data)
noexcept
;
47
bool
addData(QIODevice *device);
48
49
QByteArrayView resultView()
const
noexcept
;
50
QByteArray result()
const
;
51
52
#
if
QT_CORE_REMOVED_SINCE
(
6
,
6
)
53
static
QByteArray hash(
const
QByteArray &message,
const
QByteArray &key,
54
QCryptographicHash::Algorithm method);
55
#
endif
56
static
QByteArray hash(QByteArrayView message, QByteArrayView key,
57
QCryptographicHash::Algorithm method);
58
59
static
QByteArrayView
60
hashInto(QSpan<
char
> buffer, QByteArrayView message, QByteArrayView key,
61
QCryptographicHash::Algorithm method)
noexcept
62
{
return
hashInto(as_writable_bytes(buffer), {&message, 1}, key, method); }
63
static
QByteArrayView
64
hashInto(QSpan<uchar> buffer, QByteArrayView message, QByteArrayView key,
65
QCryptographicHash::Algorithm method)
noexcept
66
{
return
hashInto(as_writable_bytes(buffer), {&message, 1}, key, method); }
67
static
QByteArrayView
68
hashInto(QSpan<std::byte> buffer, QByteArrayView message,
69
QByteArrayView key, QCryptographicHash::Algorithm method)
noexcept
70
{
return
hashInto(buffer, {&message, 1}, key, method); }
71
static
QByteArrayView
72
hashInto(QSpan<
char
> buffer, QSpan<
const
QByteArrayView> messageParts,
73
QByteArrayView key, QCryptographicHash::Algorithm method)
noexcept
74
{
return
hashInto(as_writable_bytes(buffer), messageParts, key, method); }
75
static
QByteArrayView
76
hashInto(QSpan<uchar> buffer, QSpan<
const
QByteArrayView> messageParts,
77
QByteArrayView key, QCryptographicHash::Algorithm method)
noexcept
78
{
return
hashInto(as_writable_bytes(buffer), messageParts, key, method); }
79
static
QByteArrayView
80
hashInto(QSpan<std::byte> buffer, QSpan<
const
QByteArrayView> message,
81
QByteArrayView key, QCryptographicHash::Algorithm method)
noexcept
;
82
83
private
:
84
Q_DISABLE_COPY(QMessageAuthenticationCode)
85
QMessageAuthenticationCodePrivate *d;
86
};
87
88
QT_END_NAMESPACE
89
90
#
endif
QCryptographicHashPrivate
Definition
qcryptographichash.cpp:269
QCryptographicHashPrivate::finalizeMutex
QBasicMutex finalizeMutex
Definition
qcryptographichash.cpp:347
QCryptographicHashPrivate::addData
void addData(QByteArrayView bytes) noexcept
Definition
qcryptographichash.cpp:819
QCryptographicHashPrivate::~QCryptographicHashPrivate
~QCryptographicHashPrivate()
Definition
qcryptographichash.cpp:275
QCryptographicHashPrivate::QCryptographicHashPrivate
QCryptographicHashPrivate(QCryptographicHash::Algorithm method) noexcept
Definition
qcryptographichash.cpp:271
QCryptographicHashPrivate::finalize
void finalize() noexcept
Definition
qcryptographichash.cpp:1001
QCryptographicHashPrivate::finalizeUnchecked
void finalizeUnchecked() noexcept
Definition
qcryptographichash.cpp:1016
QCryptographicHashPrivate::result
HashResult result
Definition
qcryptographichash.cpp:348
QCryptographicHashPrivate::resultView
QByteArrayView resultView() const noexcept
Definition
qcryptographichash.cpp:290
QCryptographicHashPrivate::reset
void reset() noexcept
Definition
qcryptographichash.cpp:679
QCryptographicHashPrivate::supportsAlgorithm
static bool supportsAlgorithm(QCryptographicHash::Algorithm method)
Definition
qcryptographichash.cpp:1305
QCryptographicHashPrivate::addData
bool addData(QIODevice *dev)
Definition
qcryptographichash.cpp:949
QCryptographicHashPrivate::finalizeUnchecked
QSpan< uchar > finalizeUnchecked(QSpan< uchar > buffer) noexcept
Definition
qcryptographichash.cpp:1028
QMessageAuthenticationCodePrivate
Definition
qcryptographichash.cpp:1434
QMessageAuthenticationCodePrivate::QMessageAuthenticationCodePrivate
QMessageAuthenticationCodePrivate(QCryptographicHash::Algorithm m) noexcept
Definition
qcryptographichash.cpp:1436
QMessageAuthenticationCodePrivate::initMessageHash
void initMessageHash() noexcept
Definition
qcryptographichash.cpp:1498
QMessageAuthenticationCodePrivate::setKey
void setKey(QByteArrayView k) noexcept
Definition
qcryptographichash.cpp:1463
QMessageAuthenticationCodePrivate::key
HashBlock key
Definition
qcryptographichash.cpp:1441
QMessageAuthenticationCodePrivate::finalize
void finalize()
Definition
qcryptographichash.cpp:1706
QMessageAuthenticationCodePrivate::messageHash
QCryptographicHashPrivate messageHash
Definition
qcryptographichash.cpp:1442
QMessageAuthenticationCodePrivate::finalizeUnchecked
void finalizeUnchecked() noexcept
Definition
qcryptographichash.cpp:1714
QMessageAuthenticationCode
\inmodule QtCore
Definition
qmessageauthenticationcode.h:18
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
maxHashBlockSize
constexpr int maxHashBlockSize()
Definition
qcryptographichash.cpp:1387
hashLengthInternal
QT_WARNING_PUSH QT_WARNING_POP static QT_BEGIN_NAMESPACE constexpr int hashLengthInternal(QCryptographicHash::Algorithm method) noexcept
Definition
qcryptographichash.cpp:125
qt_hash_block_size
static constexpr int qt_hash_block_size(QCryptographicHash::Algorithm method)
Definition
qcryptographichash.cpp:1338
xored
static HashBlock xored(const HashBlock &block, quint8 val) noexcept
Definition
qcryptographichash.cpp:1418
maxHashLength
static constexpr int maxHashLength()
Definition
qcryptographichash.cpp:168
minHashBlockSize
constexpr int minHashBlockSize()
Definition
qcryptographichash.cpp:1397
gcdHashBlockSize
constexpr int gcdHashBlockSize()
Definition
qcryptographichash.cpp:1407
BAD_HASHLEN
@ BAD_HASHLEN
Definition
qcryptographichash.cpp:33
SUCCESS
@ SUCCESS
Definition
qcryptographichash.cpp:33
FAIL
@ FAIL
Definition
qcryptographichash.cpp:33
DataLength
unsigned long long DataLength
Definition
qcryptographichash.cpp:32
SHA3Context
spongeState SHA3Context
Definition
qcryptographichash.cpp:47
BitSequence
unsigned char BitSequence
Definition
qcryptographichash.cpp:31
hashState
spongeState hashState
Definition
qcryptographichash.cpp:40
QBasicMutex
QMutex QBasicMutex
Definition
qmutex.h:361
CASE
#define CASE(mod, type)
QCryptographicHashPrivate::State
Definition
qcryptographichash.cpp:317
QCryptographicHashPrivate::State::sha3Finish
static void sha3Finish(SHA3Context &ctx, QSpan< uchar > result, Sha3Variant sha3Variant)
Definition
qcryptographichash.cpp:353
QCryptographicHashPrivate::State::blake2bContext
blake2b_state blake2bContext
Definition
qcryptographichash.cpp:343
QCryptographicHashPrivate::State::md4Context
md4_context md4Context
Definition
qcryptographichash.cpp:333
QCryptographicHashPrivate::State::sha384Context
SHA384Context sha384Context
Definition
qcryptographichash.cpp:336
QCryptographicHashPrivate::State::sha224Context
SHA224Context sha224Context
Definition
qcryptographichash.cpp:334
QCryptographicHashPrivate::State::addData
void addData(QCryptographicHash::Algorithm method, QByteArrayView data) noexcept
Definition
qcryptographichash.cpp:873
QCryptographicHashPrivate::State::sha1Context
Sha1State sha1Context
Definition
qcryptographichash.cpp:328
QCryptographicHashPrivate::State::sha3Context
SHA3Context sha3Context
Definition
qcryptographichash.cpp:339
QCryptographicHashPrivate::State::sha512Context
SHA512Context sha512Context
Definition
qcryptographichash.cpp:337
QCryptographicHashPrivate::State::sha256Context
SHA256Context sha256Context
Definition
qcryptographichash.cpp:335
QCryptographicHashPrivate::State::finalizeUnchecked
void finalizeUnchecked(QCryptographicHash::Algorithm method, QSpan< uchar > buffer) noexcept
Definition
qcryptographichash.cpp:1097
QCryptographicHashPrivate::State::destroy
void destroy(QCryptographicHash::Algorithm method)
Definition
qcryptographichash.cpp:673
QCryptographicHashPrivate::State::Sha3Variant
Sha3Variant
Definition
qcryptographichash.cpp:341
QCryptographicHashPrivate::State::Sha3Variant::Keccak
@ Keccak
Definition
qcryptographichash.cpp:341
QCryptographicHashPrivate::State::Sha3Variant::Sha3
@ Sha3
Definition
qcryptographichash.cpp:341
QCryptographicHashPrivate::State::blake2sContext
blake2s_state blake2sContext
Definition
qcryptographichash.cpp:344
QCryptographicHashPrivate::State::md5Context
MD5Context md5Context
Definition
qcryptographichash.cpp:332
QCryptographicHashPrivate::State::State
State(QCryptographicHash::Algorithm method)
Definition
qcryptographichash.cpp:621
QCryptographicHashPrivate::State::reset
void reset(QCryptographicHash::Algorithm method) noexcept
Definition
qcryptographichash.cpp:740
qtbase
src
corelib
tools
qmessageauthenticationcode.h
Generated on
for Qt by
1.18.0