Skip to content

require IPPCP for mbedtls ML-KEM and add ML-KEM UT/fuzz coverage#3628

Open
czwolak wants to merge 1 commit into
DMTF:mainfrom
czwolak:mlkem-mbedtls-ippcp-minimal
Open

require IPPCP for mbedtls ML-KEM and add ML-KEM UT/fuzz coverage#3628
czwolak wants to merge 1 commit into
DMTF:mainfrom
czwolak:mlkem-mbedtls-ippcp-minimal

Conversation

@czwolak
Copy link
Copy Markdown
Contributor

@czwolak czwolak commented May 22, 2026

Summary\n- require IPPCP for CRYPTO=mbedtls ML-KEM and fail closed when missing\n- implement ML-KEM via IPPCP in cryptlib_mbedtls\n- fix ML-KEM UT cleanup to use libspdm_mlkem_free instead of libspdm_dh_free\n- add ML-KEM negative UT coverage\n- add ML-KEM fuzz target, seed corpus, and runner integration\n\n## Validation\n- no regressions observed in existing cryptographic test flow\n- ML-KEM fuzz target seed smoke: PASS\n- ML-KEM fuzz target randomized corpus smoke (41 inputs): PASS (0 failures)

…rage

Implement ML-KEM for the mbedtls backend via IPPCP with fail-closed
configuration and add targeted validation coverage for the updated KEM path.

Changes:

- require IPPCP in CRYPTO=mbedtls ML-KEM configuration and remove optional
  compile-time toggles for this path

- keep ML-DSA and SLH-DSA hard-disabled for this task

- add IPPCP-backed ML-KEM context/keygen/encaps/decaps implementation

- fix ML-KEM unit-test cleanup to use libspdm_mlkem_free() instead of
  libspdm_dh_free(), preventing invalid free/segfault

- add ML-KEM negative UT coverage for input/size validation paths in
  unit_test/test_crypt

- add dedicated ML-KEM fuzz target (test_mlkem_kem_api), seed corpus, and wire
  it into fuzzing runners

Validation:

- no regressions observed in existing cryptographic test flow

- ML-KEM fuzz target seed smoke: PASS

- ML-KEM fuzz target randomized corpus smoke (41 inputs): PASS (0 failures)

Signed-off-by: Cezary Zwolak <cezary.zwolak@intel.com>
@czwolak czwolak changed the title libspdm: require IPPCP for mbedtls ML-KEM and add ML-KEM UT/fuzz coverage require IPPCP for mbedtls ML-KEM and add ML-KEM UT/fuzz coverage May 22, 2026
@czwolak
Copy link
Copy Markdown
Contributor Author

czwolak commented May 22, 2026

Draft review notes (WIP):\n\n1. Scope\n- Enforces ML-KEM on mbedtls via IPPCP path with explicit fail-closed configure behavior.\n- Removes optional ML-KEM compile-time toggles and keeps ML-DSA/SLH-DSA disabled for this task scope.\n- Adds ML-KEM coverage: existing UT fix (DH -> KEM free), negative-path UT, and dedicated fuzz target + seed wiring.\n\n2. Functional checks\n- Verify CMake behavior when IPPCP is absent/present for CRYPTO=mbedtls.\n- Verify cryptlib_mbedtls links IPPCP correctly in all CI toolchains used by this PR.\n- Verify ML-KEM API behavior for invalid buffer sizes and invalid NID paths.\n\n3. Risk areas to watch\n- CI environments without IPPCP (currently main source of failures in this PR).\n- Hard-coded size assumptions in ML-KEM tests (future-proofing for parameter-set changes).\n- Fuzz target early-return on invalid NID reducing mutation depth.\n\n4. Suggested acceptance criteria\n- CI matrix green for affected jobs.\n- No regression in existing crypto tests.\n- ML-KEM UT and fuzz smoke pass reliably in maintained configs.\n\n5. Follow-ups (optional)\n- Consider a CI-safe fallback strategy for missing IPPCP in generic jobs, while keeping strict behavior where ML-KEM is required.\n- Consider replacing hard-coded ML-KEM expected sizes in UT with helper-derived values where practical.

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