Skip to content

Add ML-KEM and ML-DSA WebCrypto support#6872

Open
thibmeu wants to merge 8 commits into
cloudflare:mainfrom
thibmeu:cf/mlkem-mldsa-helpers
Open

Add ML-KEM and ML-DSA WebCrypto support#6872
thibmeu wants to merge 8 commits into
cloudflare:mainfrom
thibmeu:cf/mlkem-mldsa-helpers

Conversation

@thibmeu

@thibmeu thibmeu commented Jul 9, 2026

Copy link
Copy Markdown
Member

This adds the first opt-in slice of modern WebCrypto:

  • ML-KEM and ML-DSA support
  • encapsulate/decapsulate helpers
  • getPublicKey() and SubtleCrypto.supports()
  • JWK import/export
  • Tentative tests

It also adds webcrypto_modern_algorithms flag and gates the new API behind it.

Deferred from the original PR (#6403) SHA3/cSHAKE/TurboSHAKE and ChaCha20-Poly1305

Given the code is simply taken out from @panva 's PR, they are still credited as co-author

This first PR should facilitate review and support of other (relevant) algorithms defined in https://wicg.github.io/webcrypto-modern-algos/

I have read the CLA Document and I hereby sign the CLA

panva and others added 3 commits July 9, 2026 15:10
Assisted-by: Codex:gpt-5

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Keep ML-KEM, ML-DSA, helper APIs, and JWK support.

Defer SHA3, ChaCha20-Poly1305, and aws-lc Rust deps.

Co-authored-by: Filip Skokan <panva.ip@gmail.com>
@thibmeu thibmeu requested review from a team as code owners July 9, 2026 14:00
@thibmeu thibmeu requested a review from edmundhung July 9, 2026 14:00
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@thibmeu

thibmeu commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

recheck

@thibmeu

thibmeu commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

I have read the CLA Document and I hereby sign the CLA

@thibmeu

thibmeu commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

recheck

github-actions Bot added a commit that referenced this pull request Jul 9, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.50000% with 1576 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.36%. Comparing base (99057e4) to head (139a8da).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/workerd/api/crypto/mldsa.c++ 0.00% 521 Missing ⚠️
src/workerd/api/crypto/mlkem.c++ 0.00% 503 Missing ⚠️
src/workerd/api/crypto/crypto.c++ 2.38% 488 Missing and 4 partials ⚠️
src/workerd/api/crypto/keys.c++ 0.00% 22 Missing ⚠️
src/workerd/api/crypto/rsa.c++ 0.00% 12 Missing ⚠️
src/workerd/api/crypto/ec.c++ 0.00% 7 Missing and 2 partials ⚠️
src/workerd/api/crypto/impl.h 0.00% 9 Missing ⚠️
src/workerd/api/crypto/aes.c++ 0.00% 2 Missing and 2 partials ⚠️
src/workerd/api/crypto/digest.c++ 0.00% 1 Missing and 1 partial ⚠️
src/workerd/api/crypto/hkdf.c++ 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6872      +/-   ##
==========================================
- Coverage   67.21%   66.36%   -0.86%     
==========================================
  Files         424      426       +2     
  Lines      121180   122758    +1578     
  Branches    20175    20560     +385     
==========================================
+ Hits        81447    81463      +16     
- Misses      27663    29221    +1558     
- Partials    12070    12074       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants