Skip to content

Rust wrapper: Add ChaCha20Poly1305::finalize_verify()#10933

Open
holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:f-6445
Open

Rust wrapper: Add ChaCha20Poly1305::finalize_verify()#10933
holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:f-6445

Conversation

@holtrop-wolfssl

Copy link
Copy Markdown
Contributor

Description

Rust wrapper: Add ChaCha20Poly1305::finalize_verify()

Fixes F-6445

Testing

How did you test?

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@holtrop-wolfssl holtrop-wolfssl self-assigned this Jul 16, 2026
Copilot AI review requested due to automatic review settings July 16, 2026 16:49

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

Adds a safer/clearer decryption-finalization API to the Rust wolfCrypt ChaCha20-Poly1305 wrapper by introducing ChaCha20Poly1305::finalize_verify(), along with a new unit test and a changelog entry.

Changes:

  • Add ChaCha20Poly1305::finalize_verify() that finalizes and checks the expected authentication tag via wc_ChaCha20Poly1305_CheckTag.
  • Update finalize() docs to steer decrypt users toward finalize_verify() for tag checking.
  • Add a new Rust test covering success verification and tag-tamper failure; update CHANGELOG.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
wrapper/rust/wolfssl-wolfcrypt/src/chacha20_poly1305.rs Adds finalize_verify() and updates finalize() documentation to clarify decryption tag handling.
wrapper/rust/wolfssl-wolfcrypt/tests/test_chacha20_poly1305.rs Adds a unit test for finalize_verify() (success path + tampered-tag failure).
wrapper/rust/wolfssl-wolfcrypt/CHANGELOG.md Documents the new API as an unreleased feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wrapper/rust/wolfssl-wolfcrypt/src/chacha20_poly1305.rs Outdated
Comment thread wrapper/rust/wolfssl-wolfcrypt/src/chacha20_poly1305.rs Outdated
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.

2 participants