Extend/Add label/id extension functions#10072
Open
night1rider wants to merge 4 commits intowolfSSL:masterfrom
Open
Extend/Add label/id extension functions#10072night1rider wants to merge 4 commits intowolfSSL:masterfrom
night1rider wants to merge 4 commits intowolfSSL:masterfrom
Conversation
…to the AES init call Refactor CMAC init to common function, add wc_AesNew_Id/Label API, do same for RSA new functions, and add test init helpers for id[] support along with some test disable options
8854bc6 to
3321d70
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10072
Scan targets checked: wolfcrypt-bugs, wolfcrypt-src
No new issues found in the changed files. ✅
bigbrett
previously approved these changes
Mar 26, 2026
Contributor
bigbrett
left a comment
There was a problem hiding this comment.
Kinda hate the test/bench wrappers, but not sure what can be done about that while keeping APIs consistent, unless perhaps we just called the new variants of the functions directly and allowed them to default back to the old Init if WOLF_PRIVATE_KEY_ID wasn't defined? Might declutter. Food for thought.
OK as is.
wolfcrypt/test/test.c
Outdated
| ERROR_OUT(WC_TEST_RET_ENC_NC, done); | ||
| } | ||
|
|
||
| #ifndef WC_TEST_NO_ECC_CHECK_KEY |
Contributor
There was a problem hiding this comment.
nit: naming is inconsistent with other gating macros you introduced ("skip").
Contributor
Author
There was a problem hiding this comment.
Updated to match
ef08f21 to
cafea6b
Compare
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.
Summary
Add
wc_InitCmac_Id()/wc_InitCmac_Label()so CMAC can forward a hardware key-slot identifier to the underlying AES context.Add
wc_AesNew_Id()/wc_AesNew_Label()andwc_NewRsaKey_Id()/wc_NewRsaKey_Label()constructors following the same pattern.Refactor each algorithm's init into a single internal
_commonfunction to avoid duplication. Public API is fully backward-compatible.Add per-algorithm init helpers in
test.candbenchmark.cthat switch between plain and Id-based init whenWC_TEST_<ALG>_IDmacros are defined.Add test skip macros:
WC_TEST_SKIP_ECC_CHECK_KEY,WC_TEST_SKIP_RSA_PRIVATE_EXPORT,WC_TEST_SKIP_ECC_PRIVATE_EXPORT,WC_TEST_SKIP_ZERO_LEN_CMAC.