Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
5bfdc7e
doc,crypto: cleanup unlinked and self method references webcrypto.md
panva Aug 26, 2025
430691d
crypto: support SLH-DSA KeyObject, sign, and verify
panva Aug 26, 2025
b1d2878
crypto: add Argon2 Web Cryptography algorithms
panva Aug 26, 2025
19d633f
tools: add script to make reviewing backport PRs easier
aduh95 Aug 26, 2025
2417797
test_runner: set mock timer's interval undefined
hotpineapple Aug 27, 2025
11de6c7
doc: fix missing link to the Error documentation in the `http` page
estliberitas Aug 27, 2025
2e6225a
deps: update amaro to 1.1.2
nodejs-github-bot Aug 27, 2025
0379a8b
src: remove JSONParser
joyeecheung Aug 27, 2025
772f8f4
inspector: add http2 tracking support
RaisinTen Aug 27, 2025
0718a70
src: add name for more threads
theanarkh Aug 27, 2025
c206f8d
repl: add isValidParentheses check before wrap input
meixg Aug 27, 2025
a4a8ed8
build: compile bundled uvwasi conditionally
carlocab Aug 27, 2025
bf26b47
sea: allow using inspector command line flags with SEA
joyeecheung Aug 27, 2025
5761724
deps: V8: cherry-pick 6b1b9bca2a8
Xiao-Tao Aug 28, 2025
3276bfa
doc: update migration recomendations for `util.is**()` deprecations
AugustinMauroy Aug 28, 2025
4c48ec0
test: deflake test-http-keep-alive-empty-line
lpinca Aug 28, 2025
61d0a2d
doc: fix filehandle.read typo
ruyadorno Aug 28, 2025
1798683
test: skip test-fs-cp* tests that are constantly failing on Windows
joyeecheung Aug 28, 2025
1f6c335
test: mark test-inspector-network-fetch as flaky again
joyeecheung Aug 28, 2025
c8d6b60
doc: fix quic session instance typo
jakecastelli Aug 29, 2025
2086f33
vm: sync-ify SourceTextModule linkage
legendecas Aug 29, 2025
6ab9306
doc: update install_tools.bat free disk space
StefanStojanovic Aug 29, 2025
d6d05ba
worker: add cpu profile APIs for worker
theanarkh Aug 29, 2025
062b2f7
doc: improve documentation for raw headers in HTTP/2 APIs
pimterry Aug 29, 2025
3d88aa9
src: remove duplicate code
theanarkh Aug 29, 2025
56ac9a2
src: migrate WriteOneByte to WriteOneByteV2
legendecas Aug 29, 2025
df63d37
test: fix internet/test-dns
targos Aug 30, 2025
1a93df8
lib: revert to using default derived class constructors
Renegade334 Aug 30, 2025
5e025c7
stream: replace manual function validation with validateFunction
JinhyeokFang Aug 30, 2025
c161635
wasi: fix `clean` target in `test/wasi/Makefile`
aduh95 Aug 30, 2025
44d7b92
benchmark: calibrate config array-vs-concat
RafaelGSS Aug 30, 2025
87f829b
doc: mark `path.matchesGlob` as stable
avivkeller Aug 31, 2025
bda32af
build: use `windows-2025` runner
targos Aug 31, 2025
0748160
lib: fix DOMException subclass support
legendecas Aug 31, 2025
e69be56
fs: fix dereference: false on cpSync
npaun Aug 31, 2025
96db47f
doc: add Miles Guicent as triager
milesguicent Aug 31, 2025
88d1ca8
src: use non-deprecated Get/SetPrototype methods
targos Aug 31, 2025
15cbd39
src: separate module.hasAsyncGraph and module.hasTopLevelAwait
joyeecheung Sep 1, 2025
2e54411
worker: optimize cpu profile implement
theanarkh Sep 1, 2025
6523c2d
tools: update gyp-next to 0.20.4
nodejs-github-bot Sep 2, 2025
90d0a1b
src,sqlite: refactor value conversion
geeksilva97 Sep 2, 2025
15fa779
src: fix race on process exit and off thread CA loading
legendecas Sep 2, 2025
4a31715
build: fix 'implicit-function-declaration' on OpenHarmony platform
hqzing Sep 2, 2025
e7bf712
doc: update "Type stripping in dependencies" section
joshkel Sep 2, 2025
7bbbcf6
benchmark: sqlite prevent create both tables on prepare selects
brunocroh Sep 3, 2025
34d7525
src: fix build on NetBSD
0-wiz-0 Sep 4, 2025
8dbd0f1
tools: add sccache to `test-internet` workflow
aduh95 Sep 4, 2025
7f347fc
build: fix getting OpenSSL version on Windows
targos Sep 4, 2025
2cd6a3b
src: track async resources via pointers to stack-allocated handles
addaleax Sep 4, 2025
dcdb259
test_runner: fix todo inheritance
MoLow Sep 4, 2025
dbe6e63
esm: fix missed renaming in ModuleJob.runSync
joyeecheung Sep 4, 2025
5806ea0
meta: bump actions/checkout from 4.2.2 to 5.0.0
dependabot[bot] Sep 4, 2025
34f7ab5
meta: bump actions/cache from 4.2.3 to 4.2.4
dependabot[bot] Sep 4, 2025
01b66b1
meta: bump github/codeql-action from 3.29.2 to 3.30.0
dependabot[bot] Sep 4, 2025
0bf9775
sea: implement sea.getAssetKeys()
joyeecheung Sep 4, 2025
45d148d
meta: bump actions/download-artifact from 4.3.0 to 5.0.0
dependabot[bot] Sep 4, 2025
9b5eb6e
doc: fix missing links in the `errors` page
meteorqz6 Sep 5, 2025
bb0755d
meta: bump `codecov/codecov-action`
dependabot[bot] Sep 5, 2025
41245ad
test: skip more sea tests on Linux ppc64le
richardlau Sep 5, 2025
70d2d6d
url: add err.input to ERR_INVALID_FILE_URL_PATH
joyeecheung Sep 5, 2025
65e4e68
util: hide duplicated stack frames when using util.inspect
BridgeAR Sep 5, 2025
a414c1e
repl: fix REPL completion under unary expressions
kingsword09 Sep 5, 2025
45af696
deps: upgrade npm to 11.6.0
npm-cli-bot Sep 5, 2025
6313706
test: update WPT for urlpattern to cff1ac1123
nodejs-github-bot Sep 6, 2025
f12c1ad
deps: update googletest to eb2d85e
nodejs-github-bot Sep 6, 2025
3e4b1e7
crypto: add KMAC Web Cryptography algorithms
panva Sep 6, 2025
6696d1d
tools: improve error handling in node_mksnapshot
jasnell Sep 7, 2025
39befdd
lib: prefer TypedArrayPrototype primordials
panva Sep 7, 2025
3273143
util: use getOptionValue('--no-deprecation') in deprecated()
haramj Sep 4, 2025
6f79450
util: remove outdated TODO comment
haramj Sep 5, 2025
4b631be
crypto: support Ed448 and ML-DSA context parameter in Web Cryptography
panva Aug 11, 2025
7a8e2c2
crypto: support Ed448 and ML-DSA context parameter in node:crypto
panva Aug 23, 2025
f5b6829
doc,crypto: add description to the KEM and supports() methods
panva Sep 7, 2025
4fd213c
lib: fix isReadable and isWritable return type value
joaoGabriel55 Sep 7, 2025
8eb0d9d
fs: fix wrong order of file names in cpSync error message
npaun Sep 7, 2025
d944a87
crypto: refactor subtle methods to use synchronous import
panva Sep 7, 2025
377bdb9
tools: add v8windbg target
legendecas Sep 7, 2025
b2e8f40
util: remove unnecessary template strings
btea Sep 7, 2025
583b1b2
doc: update OpenSSL default security level to 2
JeetuSuthar Sep 8, 2025
3d22557
Revert "lib: optimize writable stream buffer clearing"
ri7116 Sep 8, 2025
155a999
test: skip tests failing when run under root
LiviaMedeiros Sep 8, 2025
ade1175
http: use cached '1.1' http version string
ronag Sep 8, 2025
68732cf
deps: update histogram to 0.11.9
nodejs-github-bot Sep 8, 2025
0340fe9
repl: do not cause side effects in tab completion
addaleax Sep 8, 2025
794ca35
tools: do not attempt to compress tgz archive
aduh95 Sep 8, 2025
010458d
esm: populate separate cache for require(esm) in imported CJS
joyeecheung Sep 8, 2025
89fa1a9
tools: remove unused actions from `build-tarball.yml`
aduh95 Sep 8, 2025
1eca2cc
tools: use sparse checkout in `build-tarball.yml`
aduh95 Sep 8, 2025
1f7f6df
diagnostics_channel: revoke DEP0163
Renegade334 Sep 8, 2025
ad5cfcc
typings: add missing properties in ConfigBinding
wlgh1553 Sep 8, 2025
15e547b
typings: add typing for 'uv'
JinhyeokFang Sep 8, 2025
f667215
path: refactor path joining logic for clarity and performance
wlgh1553 Sep 8, 2025
e476e43
util: fix numericSeparator with negative fractional numbers
Han5991 Sep 8, 2025
d913872
assert: cap input size in myersDiff to avoid Int32Array overflow
haramj Sep 9, 2025
0d1e53d
deps: update uvwasi to 0.0.23
nodejs-github-bot Sep 9, 2025
44c2465
src: fixup node_messaging error handling
jasnell Sep 9, 2025
83d11f8
tools: print appropriate output when test aborted
hotpineapple Sep 9, 2025
bcb29fb
src: correctly report memory changes to V8
thunder-coding Sep 9, 2025
8671a6c
doc: stabilize --disable-sigusr1
RafaelGSS Sep 9, 2025
2865d2a
http: unbreak keepAliveTimeoutBuffer
ronag Sep 9, 2025
92128a8
src: use DictionaryTemplate for node_url_pattern
jasnell Sep 10, 2025
74a0948
inspector: undici as shared-library should pass tests
Uzlopak Sep 10, 2025
f9ec1b6
2025-09-10, Version 24.8.0 (Current)
nodejs-github-bot Sep 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
crypto: support SLH-DSA KeyObject, sign, and verify
PR-URL: #59537
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
panva authored and targos committed Aug 28, 2025
commit 430691d1afb5e2eb94fe7a639d4d78cb1de5adc4
24 changes: 24 additions & 0 deletions deps/ncrypto/ncrypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ constexpr static PQCMapping pqc_mappings[] = {
{"ML-KEM-512", EVP_PKEY_ML_KEM_512},
{"ML-KEM-768", EVP_PKEY_ML_KEM_768},
{"ML-KEM-1024", EVP_PKEY_ML_KEM_1024},
{"SLH-DSA-SHA2-128f", EVP_PKEY_SLH_DSA_SHA2_128F},
{"SLH-DSA-SHA2-128s", EVP_PKEY_SLH_DSA_SHA2_128S},
{"SLH-DSA-SHA2-192f", EVP_PKEY_SLH_DSA_SHA2_192F},
{"SLH-DSA-SHA2-192s", EVP_PKEY_SLH_DSA_SHA2_192S},
{"SLH-DSA-SHA2-256f", EVP_PKEY_SLH_DSA_SHA2_256F},
{"SLH-DSA-SHA2-256s", EVP_PKEY_SLH_DSA_SHA2_256S},
{"SLH-DSA-SHAKE-128f", EVP_PKEY_SLH_DSA_SHAKE_128F},
{"SLH-DSA-SHAKE-128s", EVP_PKEY_SLH_DSA_SHAKE_128S},
{"SLH-DSA-SHAKE-192f", EVP_PKEY_SLH_DSA_SHAKE_192F},
{"SLH-DSA-SHAKE-192s", EVP_PKEY_SLH_DSA_SHAKE_192S},
{"SLH-DSA-SHAKE-256f", EVP_PKEY_SLH_DSA_SHAKE_256F},
{"SLH-DSA-SHAKE-256s", EVP_PKEY_SLH_DSA_SHAKE_256S},
};

#endif
Expand Down Expand Up @@ -2659,6 +2671,18 @@ bool EVPKeyPointer::isOneShotVariant() const {
case EVP_PKEY_ML_DSA_44:
case EVP_PKEY_ML_DSA_65:
case EVP_PKEY_ML_DSA_87:
case EVP_PKEY_SLH_DSA_SHA2_128F:
case EVP_PKEY_SLH_DSA_SHA2_128S:
case EVP_PKEY_SLH_DSA_SHA2_192F:
case EVP_PKEY_SLH_DSA_SHA2_192S:
case EVP_PKEY_SLH_DSA_SHA2_256F:
case EVP_PKEY_SLH_DSA_SHA2_256S:
case EVP_PKEY_SLH_DSA_SHAKE_128F:
case EVP_PKEY_SLH_DSA_SHAKE_128S:
case EVP_PKEY_SLH_DSA_SHAKE_192F:
case EVP_PKEY_SLH_DSA_SHAKE_192S:
case EVP_PKEY_SLH_DSA_SHAKE_256F:
case EVP_PKEY_SLH_DSA_SHAKE_256S:
#endif
return true;
default:
Expand Down
61 changes: 44 additions & 17 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,35 @@ try {

The following table lists the asymmetric key types recognized by the [`KeyObject`][] API:

| Key Type | Description | OID |
| --------------------------- | -------------- | ----------------------- |
| `'dh'` | Diffie-Hellman | 1.2.840.113549.1.3.1 |
| `'dsa'` | DSA | 1.2.840.10040.4.1 |
| `'ec'` | Elliptic curve | 1.2.840.10045.2.1 |
| `'ed25519'` | Ed25519 | 1.3.101.112 |
| `'ed448'` | Ed448 | 1.3.101.113 |
| `'ml-dsa-44'`[^openssl35] | ML-DSA-44 | 2.16.840.1.101.3.4.3.17 |
| `'ml-dsa-65'`[^openssl35] | ML-DSA-65 | 2.16.840.1.101.3.4.3.18 |
| `'ml-dsa-87'`[^openssl35] | ML-DSA-87 | 2.16.840.1.101.3.4.3.19 |
| `'ml-kem-1024'`[^openssl35] | ML-KEM-1024 | 2.16.840.1.101.3.4.4.3 |
| `'ml-kem-512'`[^openssl35] | ML-KEM-512 | 2.16.840.1.101.3.4.4.1 |
| `'ml-kem-768'`[^openssl35] | ML-KEM-768 | 2.16.840.1.101.3.4.4.2 |
| `'rsa-pss'` | RSA PSS | 1.2.840.113549.1.1.10 |
| `'rsa'` | RSA | 1.2.840.113549.1.1.1 |
| `'x25519'` | X25519 | 1.3.101.110 |
| `'x448'` | X448 | 1.3.101.111 |
| Key Type | Description | OID |
| ---------------------------------- | ------------------ | ----------------------- |
| `'dh'` | Diffie-Hellman | 1.2.840.113549.1.3.1 |
| `'dsa'` | DSA | 1.2.840.10040.4.1 |
| `'ec'` | Elliptic curve | 1.2.840.10045.2.1 |
| `'ed25519'` | Ed25519 | 1.3.101.112 |
| `'ed448'` | Ed448 | 1.3.101.113 |
| `'ml-dsa-44'`[^openssl35] | ML-DSA-44 | 2.16.840.1.101.3.4.3.17 |
| `'ml-dsa-65'`[^openssl35] | ML-DSA-65 | 2.16.840.1.101.3.4.3.18 |
| `'ml-dsa-87'`[^openssl35] | ML-DSA-87 | 2.16.840.1.101.3.4.3.19 |
| `'ml-kem-1024'`[^openssl35] | ML-KEM-1024 | 2.16.840.1.101.3.4.4.3 |
| `'ml-kem-512'`[^openssl35] | ML-KEM-512 | 2.16.840.1.101.3.4.4.1 |
| `'ml-kem-768'`[^openssl35] | ML-KEM-768 | 2.16.840.1.101.3.4.4.2 |
| `'rsa-pss'` | RSA PSS | 1.2.840.113549.1.1.10 |
| `'rsa'` | RSA | 1.2.840.113549.1.1.1 |
| `'slh-dsa-sha2-128f'`[^openssl35] | SLH-DSA-SHA2-128f | 2.16.840.1.101.3.4.3.21 |
| `'slh-dsa-sha2-128s'`[^openssl35] | SLH-DSA-SHA2-128s | 2.16.840.1.101.3.4.3.22 |
| `'slh-dsa-sha2-192f'`[^openssl35] | SLH-DSA-SHA2-192f | 2.16.840.1.101.3.4.3.23 |
| `'slh-dsa-sha2-192s'`[^openssl35] | SLH-DSA-SHA2-192s | 2.16.840.1.101.3.4.3.24 |
| `'slh-dsa-sha2-256f'`[^openssl35] | SLH-DSA-SHA2-256f | 2.16.840.1.101.3.4.3.25 |
| `'slh-dsa-sha2-256s'`[^openssl35] | SLH-DSA-SHA2-256s | 2.16.840.1.101.3.4.3.26 |
| `'slh-dsa-shake-128f'`[^openssl35] | SLH-DSA-SHAKE-128f | 2.16.840.1.101.3.4.3.27 |
| `'slh-dsa-shake-128s'`[^openssl35] | SLH-DSA-SHAKE-128s | 2.16.840.1.101.3.4.3.28 |
| `'slh-dsa-shake-192f'`[^openssl35] | SLH-DSA-SHAKE-192f | 2.16.840.1.101.3.4.3.29 |
| `'slh-dsa-shake-192s'`[^openssl35] | SLH-DSA-SHAKE-192s | 2.16.840.1.101.3.4.3.30 |
| `'slh-dsa-shake-256f'`[^openssl35] | SLH-DSA-SHAKE-256f | 2.16.840.1.101.3.4.3.31 |
| `'slh-dsa-shake-256s'`[^openssl35] | SLH-DSA-SHAKE-256s | 2.16.840.1.101.3.4.3.32 |
| `'x25519'` | X25519 | 1.3.101.110 |
| `'x448'` | X448 | 1.3.101.111 |

## Class: `Certificate`

Expand Down Expand Up @@ -2046,6 +2058,9 @@ Other key details might be exposed via this API using additional attributes.
<!-- YAML
added: v11.6.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/59537
description: Add support for SLH-DSA keys.
- version: v24.7.0
pr-url: https://github.com/nodejs/node/pull/59461
description: Add support for ML-KEM keys.
Expand Down Expand Up @@ -3911,6 +3926,9 @@ underlying hash function. See [`crypto.createHmac()`][] for more information.
<!-- YAML
added: v10.12.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/59537
description: Add support for SLH-DSA key pairs.
- version: v24.7.0
pr-url: https://github.com/nodejs/node/pull/59461
description: Add support for ML-KEM key pairs.
Expand Down Expand Up @@ -4036,6 +4054,9 @@ a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
<!-- YAML
added: v10.12.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/59537
description: Add support for SLH-DSA key pairs.
- version: v24.7.0
pr-url: https://github.com/nodejs/node/pull/59461
description: Add support for ML-KEM key pairs.
Expand Down Expand Up @@ -5691,6 +5712,9 @@ Throws an error if FIPS mode is not available.
<!-- YAML
added: v12.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/59537
description: Add support for SLH-DSA signing.
- version: v24.6.0
pr-url: https://github.com/nodejs/node/pull/59259
description: Add support for ML-DSA signing.
Expand Down Expand Up @@ -5807,6 +5831,9 @@ not introduce timing vulnerabilities.
<!-- YAML
added: v12.0.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/59537
description: Add support for SLH-DSA signature verification.
- version: v24.6.0
pr-url: https://github.com/nodejs/node/pull/59259
description: Add support for ML-DSA signature verification.
Expand Down
51 changes: 31 additions & 20 deletions lib/internal/crypto/keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ const {
EVP_PKEY_ML_KEM_1024,
EVP_PKEY_ML_KEM_512,
EVP_PKEY_ML_KEM_768,
EVP_PKEY_SLH_DSA_SHA2_128F,
EVP_PKEY_SLH_DSA_SHA2_128S,
EVP_PKEY_SLH_DSA_SHA2_192F,
EVP_PKEY_SLH_DSA_SHA2_192S,
EVP_PKEY_SLH_DSA_SHA2_256F,
EVP_PKEY_SLH_DSA_SHA2_256S,
EVP_PKEY_SLH_DSA_SHAKE_128F,
EVP_PKEY_SLH_DSA_SHAKE_128S,
EVP_PKEY_SLH_DSA_SHAKE_192F,
EVP_PKEY_SLH_DSA_SHAKE_192S,
EVP_PKEY_SLH_DSA_SHAKE_256F,
EVP_PKEY_SLH_DSA_SHAKE_256S,
EVP_PKEY_X25519,
EVP_PKEY_X448,
OPENSSL_EC_NAMED_CURVE,
Expand Down Expand Up @@ -168,7 +180,7 @@ function parseKeyEncoding(keyType, options = kEmptyObject) {
];
}

const ids = {
const nidOnlyKeyPairs = {
'ed25519': EVP_PKEY_ED25519,
'ed448': EVP_PKEY_ED448,
'x25519': EVP_PKEY_X25519,
Expand All @@ -179,6 +191,18 @@ const ids = {
'ml-kem-512': EVP_PKEY_ML_KEM_512,
'ml-kem-768': EVP_PKEY_ML_KEM_768,
'ml-kem-1024': EVP_PKEY_ML_KEM_1024,
'slh-dsa-sha2-128f': EVP_PKEY_SLH_DSA_SHA2_128F,
'slh-dsa-sha2-128s': EVP_PKEY_SLH_DSA_SHA2_128S,
'slh-dsa-sha2-192f': EVP_PKEY_SLH_DSA_SHA2_192F,
'slh-dsa-sha2-192s': EVP_PKEY_SLH_DSA_SHA2_192S,
'slh-dsa-sha2-256f': EVP_PKEY_SLH_DSA_SHA2_256F,
'slh-dsa-sha2-256s': EVP_PKEY_SLH_DSA_SHA2_256S,
'slh-dsa-shake-128f': EVP_PKEY_SLH_DSA_SHAKE_128F,
'slh-dsa-shake-128s': EVP_PKEY_SLH_DSA_SHAKE_128S,
'slh-dsa-shake-192f': EVP_PKEY_SLH_DSA_SHAKE_192F,
'slh-dsa-shake-192s': EVP_PKEY_SLH_DSA_SHAKE_192S,
'slh-dsa-shake-256f': EVP_PKEY_SLH_DSA_SHAKE_256F,
'slh-dsa-shake-256s': EVP_PKEY_SLH_DSA_SHAKE_256S,
};

function createJob(mode, type, options) {
Expand Down Expand Up @@ -293,22 +317,6 @@ function createJob(mode, type, options) {
paramEncoding,
...encoding);
}
case 'ed25519':
case 'ed448':
case 'x25519':
case 'x448':
case 'ml-dsa-44':
case 'ml-dsa-65':
case 'ml-dsa-87':
case 'ml-kem-512':
case 'ml-kem-768':
case 'ml-kem-1024':
{
if (ids[type] === undefined) {
throw new ERR_INVALID_ARG_VALUE('type', type, 'must be a supported key type');
}
return new NidKeyPairGenJob(mode, ids[type], ...encoding);
}
case 'dh':
{
validateObject(options, 'options');
Expand Down Expand Up @@ -347,10 +355,13 @@ function createJob(mode, type, options) {
generator == null ? 2 : generator,
...encoding);
}
default:
// Fall through
default: {
if (nidOnlyKeyPairs[type] === undefined) {
throw new ERR_INVALID_ARG_VALUE('type', type, 'must be a supported key type');
}
return new NidKeyPairGenJob(mode, nidOnlyKeyPairs[type], ...encoding);
}
}
throw new ERR_INVALID_ARG_VALUE('type', type, 'must be a supported key type');
}

// Symmetric Key Generation
Expand Down
36 changes: 36 additions & 0 deletions src/crypto/crypto_keys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,30 @@ Local<Value> KeyObjectHandle::GetAsymmetricKeyType() const {
return env()->crypto_ml_kem_768_string();
case EVP_PKEY_ML_KEM_1024:
return env()->crypto_ml_kem_1024_string();
case EVP_PKEY_SLH_DSA_SHA2_128F:
return env()->crypto_slh_dsa_sha2_128f_string();
case EVP_PKEY_SLH_DSA_SHA2_128S:
return env()->crypto_slh_dsa_sha2_128s_string();
case EVP_PKEY_SLH_DSA_SHA2_192F:
return env()->crypto_slh_dsa_sha2_192f_string();
case EVP_PKEY_SLH_DSA_SHA2_192S:
return env()->crypto_slh_dsa_sha2_192s_string();
case EVP_PKEY_SLH_DSA_SHA2_256F:
return env()->crypto_slh_dsa_sha2_256f_string();
case EVP_PKEY_SLH_DSA_SHA2_256S:
return env()->crypto_slh_dsa_sha2_256s_string();
case EVP_PKEY_SLH_DSA_SHAKE_128F:
return env()->crypto_slh_dsa_shake_128f_string();
case EVP_PKEY_SLH_DSA_SHAKE_128S:
return env()->crypto_slh_dsa_shake_128s_string();
case EVP_PKEY_SLH_DSA_SHAKE_192F:
return env()->crypto_slh_dsa_shake_192f_string();
case EVP_PKEY_SLH_DSA_SHAKE_192S:
return env()->crypto_slh_dsa_shake_192s_string();
case EVP_PKEY_SLH_DSA_SHAKE_256F:
return env()->crypto_slh_dsa_shake_256f_string();
case EVP_PKEY_SLH_DSA_SHAKE_256S:
return env()->crypto_slh_dsa_shake_256s_string();
#endif
default:
return Undefined(env()->isolate());
Expand Down Expand Up @@ -1324,6 +1348,18 @@ void Initialize(Environment* env, Local<Object> target) {
NODE_DEFINE_CONSTANT(target, EVP_PKEY_ML_KEM_512);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_ML_KEM_768);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_ML_KEM_1024);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHA2_128F);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHA2_128S);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHA2_192F);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHA2_192S);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHA2_256F);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHA2_256S);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHAKE_128F);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHAKE_128S);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHAKE_192F);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHAKE_192S);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHAKE_256F);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_SLH_DSA_SHAKE_256S);
#endif
NODE_DEFINE_CONSTANT(target, EVP_PKEY_X25519);
NODE_DEFINE_CONSTANT(target, EVP_PKEY_X448);
Expand Down
12 changes: 12 additions & 0 deletions src/env_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@
V(crypto_ml_kem_512_string, "ml-kem-512") \
V(crypto_ml_kem_768_string, "ml-kem-768") \
V(crypto_ml_kem_1024_string, "ml-kem-1024") \
V(crypto_slh_dsa_sha2_128f_string, "slh-dsa-sha2-128f") \
V(crypto_slh_dsa_sha2_128s_string, "slh-dsa-sha2-128s") \
V(crypto_slh_dsa_sha2_192f_string, "slh-dsa-sha2-192f") \
V(crypto_slh_dsa_sha2_192s_string, "slh-dsa-sha2-192s") \
V(crypto_slh_dsa_sha2_256f_string, "slh-dsa-sha2-256f") \
V(crypto_slh_dsa_sha2_256s_string, "slh-dsa-sha2-256s") \
V(crypto_slh_dsa_shake_128f_string, "slh-dsa-shake-128f") \
V(crypto_slh_dsa_shake_128s_string, "slh-dsa-shake-128s") \
V(crypto_slh_dsa_shake_192f_string, "slh-dsa-shake-192f") \
V(crypto_slh_dsa_shake_192s_string, "slh-dsa-shake-192s") \
V(crypto_slh_dsa_shake_256f_string, "slh-dsa-shake-256f") \
V(crypto_slh_dsa_shake_256s_string, "slh-dsa-shake-256s") \
V(crypto_x25519_string, "x25519") \
V(crypto_x448_string, "x448") \
V(crypto_rsa_string, "rsa") \
Expand Down
Loading