firmware
firmware copied to clipboard
Dedup happy path for encrypting shared channel packets
This makes the code easier to read and more robust against regressions by avoiding duplicate changes to both code paths. The early return in the Curve25519 path also makes it more clear that nothing else is happening in that code path.
The few duplicate lines to handle encrypted.size and which_payload_variant before returning is a small price to pay for this improvement.
🤝 Attestations
- [x] I have tested that my proposed changes behave as described.
- [x] I have tested that my proposed changes do not cause any obvious regressions on the following devices:
- [ ] Heltec (Lora32) V3
- [ ] LilyGo T-Deck
- [ ] LilyGo T-Beam
- [x] RAK WisBlock 4631
- [x] Seeed Studio T-1000E tracker card
- [ ] Other (please specify below)