diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-01-08 13:06:24 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-01-08 13:06:24 -0800 |
| commit | 9c7ee5a21e2875baf3b1643101f660f41c903124 (patch) | |
| tree | eb3dbdcd28b769839149a4fe96f7a79a4c6dfd62 /node/Packet.cpp | |
| parent | a9c4ce38f0b3aaae7e354e56dd6548f8e1ae928d (diff) | |
| download | infinitytier-9c7ee5a21e2875baf3b1643101f660f41c903124.tar.gz infinitytier-9c7ee5a21e2875baf3b1643101f660f41c903124.zip | |
Tear out old "link quality" stuff since it is not currently used and will be done differently.
Diffstat (limited to 'node/Packet.cpp')
| -rw-r--r-- | node/Packet.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/node/Packet.cpp b/node/Packet.cpp index af42cda5..cb9e1e0f 100644 --- a/node/Packet.cpp +++ b/node/Packet.cpp @@ -1061,18 +1061,16 @@ static inline int LZ4_decompress_safe(const char* source, char* dest, int compre const unsigned char Packet::ZERO_KEY[32] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -void Packet::armor(const void *key,bool encryptPayload,unsigned int counter) +void Packet::armor(const void *key,bool encryptPayload) { uint8_t mangledKey[32]; uint8_t *const data = reinterpret_cast<uint8_t *>(unsafeData()); - // Mask least significant 3 bits of packet ID with counter to embed packet send counter for QoS use - data[7] = (data[7] & 0xf8) | (uint8_t)(counter & 0x07); - // Set flag now, since it affects key mangle function setCipher(encryptPayload ? ZT_PROTO_CIPHER_SUITE__C25519_POLY1305_SALSA2012 : ZT_PROTO_CIPHER_SUITE__C25519_POLY1305_NONE); _salsa20MangleKey((const unsigned char *)key,mangledKey); + if (ZT_HAS_FAST_CRYPTO()) { const unsigned int encryptLen = (encryptPayload) ? (size() - ZT_PACKET_IDX_VERB) : 0; uint64_t keyStream[(ZT_PROTO_MAX_PACKET_LENGTH + 64 + 8) / 8]; |
