Skip to content

Improve PKC unit test coverage#6485

Merged
thebentern merged 3 commits into
meshtastic:masterfrom
jasonbcox:pkc-test-coverage
Apr 3, 2025
Merged

Improve PKC unit test coverage#6485
thebentern merged 3 commits into
meshtastic:masterfrom
jasonbcox:pkc-test-coverage

Conversation

@jasonbcox

Copy link
Copy Markdown
Contributor

There is currently no unit test coverage for encryptCurve25519. As part of the efforts towards #6426, I want to make sure this behavior does not change.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • 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
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)
      Tests pass natively: pio test -e coverage

@thebentern thebentern requested review from Copilot and jp-bennett April 3, 2025 00:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves unit test coverage for Curve25519-based PKC operations by adding tests for both encryption and decryption, ensuring that changes in behavior are tracked.

  • Renamed the test function from test_PKC_Decrypt to test_PKC and expanded it to cover encryption.
  • Introduced a new variable (packetNum) for clearer test parameters and added assertions to validate encryption and subsequent decryption.
Comments suppressed due to low confidence (1)

test/test_crypto/test_main.cpp:113

  • [nitpick] The function name 'test_PKC' is generic; consider renaming it (e.g., 'test_Curve25519Crypto') to clearly indicate that it tests both encryption and decryption.
void test_PKC(void)

Comment thread test/test_crypto/test_main.cpp
@thebentern thebentern merged commit 0665802 into meshtastic:master Apr 3, 2025
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
* Cleanup PKC unit test a bit

* Add unit test coverage for encryptCurve25519

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants