mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-31 01:45:45 +00:00
* redesigned TRACE packet structure
This commit is contained in:
@@ -14,11 +14,7 @@ void Packet::calculatePacketHash(uint8_t* hash) const {
|
||||
SHA256 sha;
|
||||
uint8_t t = getPayloadType();
|
||||
sha.update(&t, 1);
|
||||
if (t == PAYLOAD_TYPE_TRACE) {
|
||||
sha.update(payload, 3+CIPHER_MAC_SIZE+CIPHER_BLOCK_SIZE); // the 'content' part of TRACE packets is just the fixed-len encrypted part
|
||||
} else {
|
||||
sha.update(payload, payload_len);
|
||||
}
|
||||
sha.update(payload, payload_len);
|
||||
sha.finalize(hash, MAX_HASH_SIZE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user