9 Commits
Author SHA1 Message Date
Filip Skokan 18c2b337af crypto: use current FIPS state for availability
Refresh conditional algorithm registration on FIPS changes and use the
current state for parameter restrictions.

Use per-algorithm availability checks in normalization and native named
key generation. Remove getPqcKeyTypes().

Enable supports() tests under FIPS and cover state transitions in warmed
workers.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/66160
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-09-23 08:50:56 +00:00
Filip Skokan 2d2250529d crypto: add Hybrid KEMs to Web Cryptography
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65759
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-09-05 10:42:52 +00:00
Filip Skokan e1cdcec718 crypto: improve SubtleCrypto.supports() accuracy
Constrain context parameters, ML-KEM derived-key imports, HKDF output
lengths, and RSA key generation.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65222
Refs: https://redirect.github.com/w3c/webcrypto/pull/558
Refs: https://redirect.github.com/WICG/webcrypto-modern-algos/pull/76
Refs: https://redirect.github.com/WICG/webcrypto-modern-algos/pull/77
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2026-08-13 21:39:12 +00:00
Filip Skokan 45550ee0f3 test: update tests to run with OpenSSL >= 3.0 FIPS mode
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64960
Fixes: https://github.com/nodejs/node/issues/48379
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-08-05 15:38:11 +00:00
Filip Skokan 8ec37ebbd6 crypto: support non-byte WebCrypto lengths and cSHAKE
Add shared bit-length helpers for WebCrypto operations that accept bit
sequences whose length is not byte-aligned.

Use the helpers for cSHAKE output, ECDH-derived bits, HMAC/KMAC key
generation/import/derivation, and KMAC sign/verify output. Preserve the
requested bit length in CryptoKey algorithm metadata while storing and
exporting rounded-up byte material with unused low bits cleared.

Keep byte-multiple validation for algorithms whose specs require it.

Extend the lower-end of KMAC's key length support.

Enable cSHAKE customization and functionName parameters.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63988
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-06-20 18:42:04 +02:00
Filip Skokan 589ef79bf8 crypto: support ML-KEM in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59569
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-23 17:01:51 +02:00
Filip Skokan 6dabd43e17 test: cleanup test-webcrypto-supports
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:59 +02:00
Filip Skokan 1c4d534b75 crypto: add SHA-3 Web Cryptography digest algorithms
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:57 +02:00
Filip Skokan 90ec54345d crypto: add SubtleCrypto.supports feature detection in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:54 +02:00