Skip to content

Add ML-KEM and ML-DSA crypto callback (cryptocb) examples - #648

Merged
mattia-moffa merged 2 commits into
wolfSSL:masterfrom
dgarske:mlkem_cryptocb
Oct 29, 2026
Merged

mattia-moffa merged 2 commits into
wolfSSL:masterfrom
dgarske:mlkem_cryptocb

Conversation

@dgarske

@dgarske dgarske commented Oct 23, 2026

Copy link
Copy Markdown
Member

Examples showing how to offload post-quantum operations to a device through the wolfCrypt crypto callback (cryptocb) interface - the path a secure element uses for ML-KEM key exchange and ML-DSA signatures.

  • pq/ml_kem_cryptocb/ - ML-KEM keygen, encapsulate and decapsulate through a registered callback.
  • pq/ml_dsa_cryptocb/ - ML-DSA keygen, sign and verify through a callback.
  • pq/tls_cryptocb/ - a TLS 1.3 client and server that offload the ML-KEM key_share using the SecP256r1MLKEM768 hybrid group.

Each callback delegates to the wolfCrypt software implementation so the examples run without hardware; a real device replaces each case body with its own calls. Built and run with --enable-cryptocb --enable-mlkem --enable-dilithium; the TLS pair is exercised in CI via the examples manifest. A pure, non-hybrid ML-KEM group needs wolfSSL built with --enable-tls-mlkem-standalone.

@aidangarske aidangarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skoll Code Review

Scan type: review

Overall recommendation: REQUEST_CHANGES
Findings: 2 total — 2 posted, 0 skipped
2 finding(s) posted as inline comments (see file-level comments below)

Posted findings

  • [High] TLS setup failures can exit with success status — pq/tls_cryptocb/client-tls13-mlkem.c:107-207; pq/tls_cryptocb/server-tls13-mlkem.c:108-189
  • [Medium] Feature guards do not cover all APIs used — pq/tls_cryptocb/client-tls13-mlkem.c:51; pq/tls_cryptocb/server-tls13-mlkem.c:50; pq/tls_cryptocb/mlkem-cryptocb.c:34

Review generated by Skoll

Comment thread pq/tls_cryptocb/client-tls13-mlkem.c Resolved
Comment thread pq/tls_cryptocb/client-tls13-mlkem.c Resolved
@dgarske
dgarske requested review from aidangarske and mattia-moffa and removed request for aidangarske October 27, 2026 16:15
@dgarske
dgarske force-pushed the mlkem_cryptocb branch 3 times, most recently from dc4fbc8 to bd3690f Compare October 28, 2026 23:50
Comment thread pq/ml_dsa_cryptocb/Makefile Resolved
@mattia-moffa
mattia-moffa merged commit a8a1b75 into wolfSSL:master Oct 29, 2026
227 checks passed
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.

4 participants