mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-19 17:22:59 +00:00
Rename packetNum to packetId
This commit is contained in:
@@ -16,12 +16,12 @@ void CryptoEngine::setKey(const CryptoKey &k)
|
||||
*
|
||||
* @param bytes is updated in place
|
||||
*/
|
||||
void CryptoEngine::encrypt(uint32_t fromNode, uint64_t packetNum, size_t numBytes, uint8_t *bytes)
|
||||
void CryptoEngine::encrypt(uint32_t fromNode, uint64_t packetId, size_t numBytes, uint8_t *bytes)
|
||||
{
|
||||
DEBUG_MSG("WARNING: noop encryption!\n");
|
||||
}
|
||||
|
||||
void CryptoEngine::decrypt(uint32_t fromNode, uint64_t packetNum, size_t numBytes, uint8_t *bytes)
|
||||
void CryptoEngine::decrypt(uint32_t fromNode, uint64_t packetId, size_t numBytes, uint8_t *bytes)
|
||||
{
|
||||
DEBUG_MSG("WARNING: noop decryption!\n");
|
||||
}
|
||||
@@ -29,13 +29,13 @@ void CryptoEngine::decrypt(uint32_t fromNode, uint64_t packetNum, size_t numByte
|
||||
/**
|
||||
* Init our 128 bit nonce for a new packet
|
||||
*/
|
||||
void CryptoEngine::initNonce(uint32_t fromNode, uint64_t packetNum)
|
||||
void CryptoEngine::initNonce(uint32_t fromNode, uint64_t packetId)
|
||||
{
|
||||
memset(nonce, 0, sizeof(nonce));
|
||||
|
||||
// use memcpy to avoid breaking strict-aliasing
|
||||
memcpy(nonce, &packetNum, sizeof(uint64_t));
|
||||
memcpy(nonce, &packetId, sizeof(uint64_t));
|
||||
memcpy(nonce + sizeof(uint64_t), &fromNode, sizeof(uint32_t));
|
||||
//*((uint64_t *)&nonce[0]) = packetNum;
|
||||
//*((uint64_t *)&nonce[0]) = packetId;
|
||||
//*((uint32_t *)&nonce[8]) = fromNode;
|
||||
}
|
||||
Reference in New Issue
Block a user