Repository navigation
aes: add AES-128/192/256-OFB - #509
Open
MarkAtwood wants to merge 1 commit into
Open
MarkAtwood wants to merge 1 commit into
MarkAtwood wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
OFB currently reports incorrect block-size metadata and has unsafe context duplication and build-configuration behavior.
3 open findings
What changed in this PR
Adds AES-128/192/256-OFB support backed by wolfCrypt.
Changes:
- Registers OFB cipher implementations, names, and OIDs.
- Adds streaming OFB processing and feature gating.
- Adds interoperability and NIST vector tests.
| File | Description |
|---|---|
README.md |
Documents OFB support. |
include/wolfprovider/alg_funcs.h |
Declares OFB names and dispatch tables. |
include/wolfprovider/settings.h |
Adds the OFB feature flag. |
src/wp_aes_stream.c |
Implements OFB processing. |
src/wp_wolfprov.c |
Registers OFB algorithms. |
test/test_cipher.c |
Adds OFB interoperability and KAT coverage. |
test/unit.c |
Registers OFB tests. |
test/unit.h |
Declares OFB tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+670
to
+678
| if (ctx->enc) { | ||
| rc = wc_AesOfbEncrypt(&ctx->aes, out, in, chunk); | ||
| } | ||
| else { | ||
| rc = wc_AesOfbDecrypt(&ctx->aes, out, in, chunk); | ||
| } | ||
| if (rc != 0) { | ||
| WOLFPROV_MSG_DEBUG_RETCODE(WP_LOG_LEVEL_DEBUG, | ||
| "wc_AesOfbEncrypt/wc_AesOfbDecrypt", rc); |
| */ | ||
| #ifdef WP_HAVE_AESOFB | ||
| /** wp_aes256ofb_functions */ | ||
| IMPLEMENT_AES_STREAM(ofb, OFB, 0, 256, 128) |
Comment on lines
+1072
to
+1074
| IMPLEMENT_AES_STREAM(ofb, OFB, 0, 192, 128) | ||
| /** wp_aes128ofb_functions */ | ||
| IMPLEMENT_AES_STREAM(ofb, OFB, 0, 128, 128) |
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.


no AES-OFB in wolfprovider, so as default provider this fails:
wolfcrypt already has it (
WOLFSSL_AES_OFB), this adds 128/192/256 next to CFB with openssl's names and OIDs. tests compare against the default provider plus NIST CAVP OFBMMT vectors both directions, split updates and re-init. tested on cd8836f, openssl 3.5.4, wolfssl 5.9.4, default, replace-default, and fips ready all pass,openssl encoutput matches stock openssl