Skip to content

Add SHE (Secure Hardware Extension) support to wolfCrypt#10009

Draft
night1rider wants to merge 2 commits intowolfSSL:masterfrom
night1rider:SHE-update
Draft

Add SHE (Secure Hardware Extension) support to wolfCrypt#10009
night1rider wants to merge 2 commits intowolfSSL:masterfrom
night1rider:SHE-update

Conversation

@night1rider
Copy link
Contributor

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

@night1rider night1rider self-assigned this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant