mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 02:32:23 +00:00
Rename packetNum to packetId
This commit is contained in:
@@ -17,28 +17,28 @@ class NRF52CryptoEngine : public CryptoEngine
|
||||
*
|
||||
* @param bytes is updated in place
|
||||
*/
|
||||
virtual void encrypt(uint32_t fromNode, uint64_t packetNum, size_t numBytes, uint8_t *bytes) override
|
||||
virtual void encrypt(uint32_t fromNode, uint64_t packetId, size_t numBytes, uint8_t *bytes) override
|
||||
{
|
||||
// DEBUG_MSG("NRF52 encrypt!\n");
|
||||
|
||||
if (key.length > 0) {
|
||||
ocrypto_aes_ctr_ctx ctx;
|
||||
|
||||
initNonce(fromNode, packetNum);
|
||||
initNonce(fromNode, packetId);
|
||||
ocrypto_aes_ctr_init(&ctx, key.bytes, key.length, nonce);
|
||||
|
||||
ocrypto_aes_ctr_encrypt(&ctx, bytes, bytes, numBytes);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void decrypt(uint32_t fromNode, uint64_t packetNum, size_t numBytes, uint8_t *bytes) override
|
||||
virtual void decrypt(uint32_t fromNode, uint64_t packetId, size_t numBytes, uint8_t *bytes) override
|
||||
{
|
||||
// DEBUG_MSG("NRF52 decrypt!\n");
|
||||
|
||||
if (key.length > 0) {
|
||||
ocrypto_aes_ctr_ctx ctx;
|
||||
|
||||
initNonce(fromNode, packetNum);
|
||||
initNonce(fromNode, packetId);
|
||||
ocrypto_aes_ctr_init(&ctx, key.bytes, key.length, nonce);
|
||||
|
||||
ocrypto_aes_ctr_decrypt(&ctx, bytes, bytes, numBytes);
|
||||
|
||||
Reference in New Issue
Block a user