mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
Cleanup unnecessary global dereferencing in CryptoEngine (#8611)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
committed by
Ben Meadors
parent
ef4cb2abfb
commit
edcdb2dcb2
@@ -92,10 +92,10 @@ bool CryptoEngine::encryptCurve25519(uint32_t toNode, uint32_t fromNode, meshtas
|
|||||||
LOG_DEBUG("Node %d or their public_key not found", toNode);
|
LOG_DEBUG("Node %d or their public_key not found", toNode);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!crypto->setDHPublicKey(remotePublic.bytes)) {
|
if (!setDHPublicKey(remotePublic.bytes)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
crypto->hash(shared_key, 32);
|
hash(shared_key, 32);
|
||||||
initNonce(fromNode, packetNum, extraNonceTmp);
|
initNonce(fromNode, packetNum, extraNonceTmp);
|
||||||
|
|
||||||
// Calculate the shared secret with the destination node and encrypt
|
// Calculate the shared secret with the destination node and encrypt
|
||||||
@@ -134,10 +134,10 @@ bool CryptoEngine::decryptCurve25519(uint32_t fromNode, meshtastic_UserLite_publ
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the shared secret with the sending node and decrypt
|
// Calculate the shared secret with the sending node and decrypt
|
||||||
if (!crypto->setDHPublicKey(remotePublic.bytes)) {
|
if (!setDHPublicKey(remotePublic.bytes)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
crypto->hash(shared_key, 32);
|
hash(shared_key, 32);
|
||||||
|
|
||||||
initNonce(fromNode, packetNum, extraNonce);
|
initNonce(fromNode, packetNum, extraNonce);
|
||||||
printBytes("Attempt decrypt with nonce: ", nonce, 13);
|
printBytes("Attempt decrypt with nonce: ", nonce, 13);
|
||||||
|
|||||||
Reference in New Issue
Block a user