Add SHE (Secure Hardware Extension) support to wolfCrypt#10009
Draft
night1rider wants to merge 2 commits intowolfSSL:masterfrom
Draft
Add SHE (Secure Hardware Extension) support to wolfCrypt#10009night1rider wants to merge 2 commits intowolfSSL:masterfrom
night1rider wants to merge 2 commits intowolfSSL:masterfrom
Conversation
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.
Implements software-only SHE CMD_LOAD_KEY message generation (M1/M2/M3) and verification message computation (M4/M5) with optional crypto callback support for hardware offload.
New files:
- wolfssl/wolfcrypt/she.h: API declarations, constants, wc_SHE context
- wolfcrypt/src/she.c: Miyaguchi-Preneel KDF, message generation, verification computation, export, and crypto callback integration
- tests/api/test_she.c/h: API tests with 98.2% line / 100% function coverage
API:
- wc_SHE_Init/Free, Init_Id, Init_Label (lifecycle)
- wc_SHE_SetUID (callback optional), SetAuthKey, SetNewKey, SetCounter, SetFlags (setters)
- wc_SHE_GenerateLoadKey (software M1/M2/M3 generation)
- wc_SHE_ComputeVerification (callback optional M4/M5 computation)
- wc_SHE_ExportKey (callback optional, partial export with size checks)
Crypto callback integration:
- WC_ALGO_TYPE_SHE added to wc_AlgoType enum
- Callback sub-types: WC_SHE_SET_UID, WC_SHE_COMPUTE_VERIFICATION, WC_SHE_EXPORT_KEY
- Per-operation structs in wc_CryptoInfo union with discriminator
- Dispatch functions in cryptocb.c
Build system:
- configure.ac: --enable-she option
- src/include.am, CMakeLists.txt: she.c compilation
- .github/workflows/os-check.yml: CI configs for SHE
Ported from wolfHSM wh_she_crypto.c