swift
Loading...
Searching...
No Matches
src
core
afv
crypto
cryptodtochannel.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6
#ifndef SWIFT_CORE_AFV_CRYPTO_CRYPTODTOCHANNEL_H
7
#define SWIFT_CORE_AFV_CRYPTO_CRYPTODTOCHANNEL_H
8
9
#include <QByteArray>
10
#include <QDateTime>
11
#include <QVector>
12
13
#include "
core/afv/crypto/cryptodtomode.h
"
14
#include "
core/afv/dto.h
"
15
16
namespace
swift::core::afv::crypto
17
{
19
class
CCryptoDtoChannel
20
{
21
public
:
23
CCryptoDtoChannel
(
const
CryptoDtoChannelConfigDto
&channelConfig,
int
receiveSequenceHistorySize = 10);
24
27
QByteArray
getTransmitKey
(
CryptoDtoMode
mode);
28
QByteArray
getTransmitKey
(
CryptoDtoMode
mode, uint &sequenceToSend);
30
32
QString
getChannelTag
()
const
;
33
35
QByteArray
getReceiveKey
(
CryptoDtoMode
mode);
36
38
bool
checkReceivedSequence
(uint sequenceReceived);
39
40
private
:
41
bool
contains(uint sequence)
const
;
42
uint getMin(
int
&minIndex)
const
;
43
44
QByteArray
m_aeadTransmitKey;
45
QByteArray
m_aeadReceiveKey;
46
47
uint m_transmitSequence = 0;
48
QVector<uint>
m_receiveSequenceHistory;
49
int
m_receiveSequenceHistoryDepth;
50
int
m_receiveSequenceSizeMaxSize;
51
52
QByteArray
m_hmacKey;
53
QString
m_channelTag;
54
QDateTime
m_LastTransmitUtc;
55
QDateTime
m_lastReceiveUtc;
56
};
57
}
// namespace swift::core::afv::crypto
58
59
#endif
// SWIFT_CORE_AFV_CRYPTO_CRYPTODTOCHANNEL_H
swift::core::afv::crypto::CCryptoDtoChannel::getReceiveKey
QByteArray getReceiveKey(CryptoDtoMode mode)
Receiver key.
Definition
cryptodtochannel.cpp:72
swift::core::afv::crypto::CCryptoDtoChannel::checkReceivedSequence
bool checkReceivedSequence(uint sequenceReceived)
check the received sequence
Definition
cryptodtochannel.cpp:86
swift::core::afv::crypto::CCryptoDtoChannel::getTransmitKey
QByteArray getTransmitKey(CryptoDtoMode mode)
Transmit key.
Definition
cryptodtochannel.cpp:38
swift::core::afv::crypto::CCryptoDtoChannel::CCryptoDtoChannel
CCryptoDtoChannel(const CryptoDtoChannelConfigDto &channelConfig, int receiveSequenceHistorySize=10)
Ctor.
Definition
cryptodtochannel.cpp:16
swift::core::afv::crypto::CCryptoDtoChannel::getChannelTag
QString getChannelTag() const
Channel tag.
Definition
cryptodtochannel.cpp:70
cryptodtomode.h
swift::core::afv::crypto::CryptoDtoMode
CryptoDtoMode
DTO mode.
Definition
cryptodtomode.h:15
dto.h
QByteArray
QDateTime
QString
QVector
swift::core::afv::CryptoDtoChannelConfigDto
Channel config DTO.
Definition
dto.h:21
Generated on
for swift by
1.15.0