diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-08-25 21:36:59 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-08-27 13:45:37 +0200 |
commit | c44b82faaf309c916a1aecf4ec939510e6384ae5 (patch) | |
tree | 5eaf5754848c42ce9a8d23eff6c166da3032b587 /src/network/channel.h | |
parent | 1d4fa8fafa707642f948da9b033a21d0bcde0bbf (diff) |
Switch to ChaCha20-Poly1305 AEAD scheme
Diffstat (limited to 'src/network/channel.h')
-rw-r--r-- | src/network/channel.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/network/channel.h b/src/network/channel.h index 98bfd29..bba11b3 100644 --- a/src/network/channel.h +++ b/src/network/channel.h @@ -44,8 +44,8 @@ public: vector<uint8_t> && key, bool ourRequest): peers(peers), key(std::move(key)), - nonceFixedOur({ uint8_t(ourRequest ? 1 : 2), 0, 0, 0, 0, 0 }), - nonceFixedPeer({ uint8_t(ourRequest ? 2 : 1), 0, 0, 0, 0, 0 }) + nonceFixedOur({ uint8_t(ourRequest ? 1 : 2), 0, 0, 0 }), + nonceFixedPeer({ uint8_t(ourRequest ? 2 : 1), 0, 0, 0 }) {} Channel(const Channel &) = delete; @@ -69,9 +69,10 @@ private: const vector<Stored<Signed<IdentityData>>> peers; const vector<uint8_t> key; - const array<uint8_t, 6> nonceFixedOur; - const array<uint8_t, 6> nonceFixedPeer; - atomic<uint64_t> nonceCounter = 0; + const array<uint8_t, 4> nonceFixedOur; + const array<uint8_t, 4> nonceFixedPeer; + atomic<uint64_t> counterNextOut = 0; + atomic<uint64_t> counterNextIn = 0; }; } |