nxp hashcrypt: preserve AES OFB/CFB streaming state across calls - #11262
Open
night1rider wants to merge 1 commit into
Open
nxp hashcrypt: preserve AES OFB/CFB streaming state across calls#11262night1rider wants to merge 1 commit into
night1rider wants to merge 1 commit into
Conversation
|
Can one of the admins verify this patch? |
Drive OFB/CFB from the ECB primitive with reg/tmp/left kept in the Aes context, add NULL/zero-length guards, and re-enable the streaming regression checks.
night1rider
force-pushed
the
fenrir-8259
branch
from
August 27, 2026 03:34
c661d83 to
6cc25e2
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the NXP HASHCRYPT AES port to correctly maintain OFB/CFB streaming state across multiple calls by generating keystream from the ECB primitive and persisting reg/tmp/left in the Aes context. It also re-enables previously-disabled regression checks to verify correct streaming behavior.
Changes:
- Rework NXP HASHCRYPT AES OFB/CFB to be stateful across calls using per-block ECB keystream generation stored in the
Aescontext. - Add
NULLargument guards and explicit zero-length fast-path returns for the new OFB/CFB implementations. - Remove
#ifndef WOLFSSL_NXP_HASHCRYPT_AESskips in AES OFB/CFB streaming regression checks so the tests run for the NXP port again.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| wolfcrypt/src/port/nxp/hashcrypt_port.c | Implements stateful OFB/CFB using ECB keystream blocks and persisted context state (reg/tmp/left) to preserve streaming across calls. |
| wolfcrypt/test/test.c | Re-enables OFB/CFB streaming regression comparisons for WOLFSSL_NXP_HASHCRYPT_AES now that the port preserves state correctly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Drive OFB/CFB from the ECB primitive with reg/tmp/left kept in the Aes context, add NULL/zero-length guards, and re-enable the streaming regression checks.