Skip to content

crypto: add TurboSHAKE and KangarooTwelve Web Cryptography algorithms#62183

Open
panva wants to merge 1 commit intonodejs:mainfrom
panva:turbo-kangaroo
Open

crypto: add TurboSHAKE and KangarooTwelve Web Cryptography algorithms#62183
panva wants to merge 1 commit intonodejs:mainfrom
panva:turbo-kangaroo

Conversation

@panva
Copy link
Member

@panva panva commented Mar 10, 2026

Adds RFC 9861 - KangarooTwelve and TurboSHAKE digest algorithm to Web Cryptography API per WICG/webcrypto-modern-algos#41 using adapted OpenSSL's keccak1600 implementation, to be replaced when OpenSSL supports them natively at which point we'd also make them available in stable node:crypto.

Refs: https://wicg.github.io/webcrypto-modern-algos/#kangarootwelve
Refs: https://wicg.github.io/webcrypto-modern-algos/#turboshake
Refs: https://www.rfc-editor.org/rfc/rfc9861.html
Refs: https://redirect.github.com/openssl/openssl/issues/30304

The tests for the implementation use both test vectors from the RFC as well as ones generated using PyCryptodome

@panva panva added 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 labels Mar 10, 2026
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Mar 10, 2026

Review requested:

  • @nodejs/crypto
  • @nodejs/gyp
  • @nodejs/web-standards

@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 Mar 10, 2026
@panva panva force-pushed the turbo-kangaroo branch 2 times, most recently from 4afe257 to a9f6b32 Compare March 10, 2026 13:23
@panva panva changed the title crypto: Add TurboSHAKE and KangarooTwelve Web Cryptography algorithms crypto: add TurboSHAKE and KangarooTwelve Web Cryptography algorithms Mar 10, 2026
@panva panva marked this pull request as ready for review March 10, 2026 14:28
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.67%. Comparing base (ab8dc2b) to head (cded65c).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/crypto/crypto_turboshake.cc 83.42% 33 Missing and 25 partials ⚠️
src/crypto/crypto_turboshake.h 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62183      +/-   ##
==========================================
- Coverage   89.68%   89.67%   -0.01%     
==========================================
  Files         676      678       +2     
  Lines      206555   206989     +434     
  Branches    39556    39642      +86     
==========================================
+ Hits       185241   185625     +384     
- Misses      13447    13492      +45     
- Partials     7867     7872       +5     
Files with missing lines Coverage Δ
lib/internal/crypto/hash.js 99.00% <100.00%> (+0.06%) ⬆️
lib/internal/crypto/util.js 95.51% <100.00%> (+0.06%) ⬆️
lib/internal/crypto/webidl.js 98.41% <100.00%> (+0.08%) ⬆️
src/node_crypto.cc 81.81% <ø> (ø)
src/crypto/crypto_turboshake.h 33.33% <33.33%> (ø)
src/crypto/crypto_turboshake.cc 83.42% <83.42%> (ø)

... and 44 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.

@panva panva added the crypto Issues and PRs related to the crypto subsystem. label Mar 10, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@panva panva requested a review from anonrig March 17, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crypto Issues and PRs related to the crypto subsystem. 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