Skip to content

crypto: support Ed448 and ML-DSA context in node:crypto and Web Cryptography #59570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

panva
Copy link
Member

@panva panva commented Aug 21, 2025

This PR adds the option to define a context option on the key input for node:crypto sign() and verify() as well as enables the context option on the ContextParams WebIDL dictionary for use with Ed448 and ML-DSA algorithms in Web Cryptography.

The option specifies the optional context to differentiate signatures generated for different purposes with the same key.

@panva panva added crypto Issues and PRs related to the crypto subsystem. semver-minor PRs that contain new features and should be released in the next minor version. experimental Issues and PRs related to experimental features. webcrypto commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Aug 21, 2025
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/security-wg
  • @nodejs/web-infra

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Aug 21, 2025
@nodejs-github-bot

This comment was marked as outdated.

Copy link

codecov bot commented Aug 21, 2025

Codecov Report

❌ Patch coverage is 78.16092% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.86%. Comparing base (d30090b) to head (050c56a).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/crypto/crypto_sig.cc 70.27% 7 Missing and 4 partials ⚠️
lib/internal/crypto/sig.js 82.60% 4 Missing ⚠️
lib/internal/crypto/webidl.js 80.95% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59570      +/-   ##
==========================================
+ Coverage   89.74%   89.86%   +0.12%     
==========================================
  Files         667      667              
  Lines      195301   195385      +84     
  Branches    38261    38362     +101     
==========================================
+ Hits       175280   175590     +310     
+ Misses      12465    12243     -222     
+ Partials     7556     7552       -4     
Files with missing lines Coverage Δ
lib/internal/crypto/cfrg.js 96.76% <100.00%> (+<0.01%) ⬆️
lib/internal/crypto/ec.js 96.81% <100.00%> (+0.01%) ⬆️
lib/internal/crypto/ml_dsa.js 94.39% <100.00%> (+0.01%) ⬆️
lib/internal/crypto/rsa.js 94.05% <100.00%> (+0.01%) ⬆️
lib/internal/crypto/util.js 94.84% <100.00%> (-0.01%) ⬇️
src/crypto/crypto_sig.h 63.63% <ø> (ø)
lib/internal/crypto/sig.js 95.66% <82.60%> (-1.02%) ⬇️
lib/internal/crypto/webidl.js 98.25% <80.95%> (-0.49%) ⬇️
src/crypto/crypto_sig.cc 70.82% <70.27%> (+0.07%) ⬆️

... and 49 files with indirect coverage changes

🚀 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.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@PearlsAmos

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. crypto Issues and PRs related to the crypto subsystem. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. experimental Issues and PRs related to experimental features. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version. webcrypto
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants