Commit cb8e0b0
committed
Add ML-KEM (FIPS 203) post-quantum KEM support
Implement full client-server ML-KEM (Module-Lattice-Based Key Encapsulation
Mechanism) support across all wolfHSM layers, enabling post-quantum key
exchange operations to be offloaded to the HSM.
Client API (wh_client_crypto):
- Key management: import, export, set/get key ID
- Key generation: MakeExportKey (ephemeral) and MakeCacheKey (server-cached)
- Encapsulation and decapsulation operations
- DMA variants for all operations
Server handling (wh_server_crypto):
- Request handlers for ML-KEM keygen, encapsulate, and decapsulate
- Auto-import with evict-after-use for uncached keys
- DMA request handlers
Crypto callback integration (wh_client_cryptocb):
- Register PQC KEM keygen/encaps/decaps handlers so wolfCrypt ML-KEM calls
are transparently forwarded to the HSM via WH_DEV_ID
Message layer (wh_message_crypto):
- Define request/response structures for keygen, encapsulate, decapsulate
- Endian translation functions for cross-platform support
Shared utilities (wh_crypto):
- ML-KEM key serialization/deserialization with automatic level probing
Supports all three ML-KEM parameter sets (512, 768, 1024). Includes tests
for all operations and DMA paths, and benchmarks for keygen, encaps, and
decaps at each security level.
Also fixes key export response to use actual stored key length from NVM
metadata instead of the request size.1 parent 9e6cc82 commit cb8e0b0
19 files changed
Lines changed: 4233 additions & 345 deletions
File tree
- benchmark
- bench_modules
- config
- examples/posix/wh_posix_server
- src
- test
- config
- wolfhsm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
382 | 427 | | |
0 commit comments