Repository navigation
Accept zero-length ciphertext in TSIP AES-GCM decrypt - #11679
Merged
Merged
Conversation
- Add zero-length decrypt cases to the RX72N TSIP unit test.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new behavior is tested only with AES-128 despite using distinct TSIP AES-256 entry points.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Enables TSIP AES-GCM decryption for zero-length ciphertexts, supporting GMAC/AAD-only operations.
Changes:
- Allows null input/output when ciphertext length is zero.
- Avoids zero-size allocations and copies.
- Adds round-trip and corrupted-tag tests.
| File | Description |
|---|---|
wolfcrypt/src/port/Renesas/renesas_tsip_aes.c |
Handles zero-length TSIP AES-GCM decrypt input. |
IDE/Renesas/e2studio/RX72N/EnvisionKit/wolfssl_demo/wolfssl_tsip_unit_test.c |
Adds zero-length AES-GCM regression cases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
philljj
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
wc_tsip_AesGcmDecrypt()rejectedsz == 0, so AAD-only (GMAC) decrypt failed.It now accepts a zero-length ciphertext and skips the zero-size buffer
allocation and copies, matching
wc_tsip_AesGcmEncrypt().Testing
Added zero-length decrypt cases to
tsip_aesgcm_zerolen_test():Verified on RX72N EnvisionKit (TSIP); all TSIP unit tests pass.
Checklist