Skip to content

Commit 8e631aa

Browse files
panvaaduh95
authored andcommitted
crypto: add Hybrid KEMs to Web Cryptography
Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: #65759 Backport-PR-URL: #66233 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 61a73d3 commit 8e631aa

17 files changed

Lines changed: 2300 additions & 35 deletions

‎doc/api/webcrypto.md‎

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<!-- YAML
44
changes:
5+
- version: REPLACEME
6+
pr-url: https://github.com/nodejs/node/pull/65759
7+
description: Hybrid KEM algorithms are now supported.
58
- version: v24.18.0
69
pr-url: https://github.com/nodejs/node/pull/62183
710
description: TurboSHAKE and KangarooTwelve algorithms
@@ -133,6 +136,9 @@ Algorithms:
133136
* `'ML-KEM-512'`[^openssl35]
134137
* `'ML-KEM-768'`[^openssl35]
135138
* `'ML-KEM-1024'`[^openssl35]
139+
* `'MLKEM768-P256'`[^openssl35]
140+
* `'MLKEM768-X25519'`[^openssl35]
141+
* `'MLKEM1024-P384'`[^openssl35]
136142
* `'SHA3-256'`
137143
* `'SHA3-384'`
138144
* `'SHA3-512'`
@@ -528,9 +534,10 @@ Crypto API implementation and the APIs supported for each:
528534
`'ECDSA'`, `'Ed25519'`, `'Ed448'`[^secure-curves],
529535
`'ML-DSA-44'`[^modern-algos], `'ML-DSA-65'`[^modern-algos],
530536
`'ML-DSA-87'`[^modern-algos], `'ML-KEM-512'`[^modern-algos],
531-
`'ML-KEM-768'`[^modern-algos], `'ML-KEM-1024'`[^modern-algos], `'RSA-OAEP'`,
532-
`'RSA-PSS'`, `'RSASSA-PKCS1-v1_5'`, `'X25519'`, and
533-
`'X448'`[^secure-curves].
537+
`'ML-KEM-768'`[^modern-algos], `'ML-KEM-1024'`[^modern-algos],
538+
`'MLKEM768-P256'`[^modern-algos], `'MLKEM768-X25519'`[^modern-algos],
539+
`'MLKEM1024-P384'`[^modern-algos], `'RSA-OAEP'`, `'RSA-PSS'`,
540+
`'RSASSA-PKCS1-v1_5'`, `'X25519'`, and `'X448'`[^secure-curves].
534541
535542
### Crypto Operation APIs
536543
@@ -550,8 +557,10 @@ Crypto API implementation and the APIs supported for each:
550557
`'ChaCha20-Poly1305'`[^modern-algos], and `'RSA-OAEP'`.
551558
* [`subtle.encapsulateBits()`][], [`subtle.decapsulateBits()`][],
552559
[`subtle.encapsulateKey()`][], and [`subtle.decapsulateKey()`][] support
553-
`'ML-KEM-512'`[^modern-algos], `'ML-KEM-768'`[^modern-algos], and
554-
`'ML-KEM-1024'`[^modern-algos].
560+
`'ML-KEM-512'`[^modern-algos], `'ML-KEM-768'`[^modern-algos],
561+
`'ML-KEM-1024'`[^modern-algos], `'MLKEM768-P256'`[^modern-algos],
562+
`'MLKEM768-X25519'`[^modern-algos], and
563+
`'MLKEM1024-P384'`[^modern-algos].
555564
* [`subtle.digest()`][] supports `'cSHAKE128'`[^modern-algos],
556565
`'cSHAKE256'`[^modern-algos], `'KT128'`[^modern-algos],
557566
`'KT256'`[^modern-algos], `'SHA-1'`, `'SHA-256'`, `'SHA-384'`, `'SHA-512'`,
@@ -583,6 +592,10 @@ and [`subtle.exportKey()`][].
583592
`'ML-KEM-768'`[^modern-algos], and `'ML-KEM-1024'`[^modern-algos]** can be
584593
imported and exported using `'spki'`, `'pkcs8'`, `'jwk'`,
585594
`'raw-public'`[^modern-algos], and `'raw-seed'`[^modern-algos].
595+
* **`'MLKEM768-P256'`[^modern-algos],
596+
`'MLKEM768-X25519'`[^modern-algos], and
597+
`'MLKEM1024-P384'`[^modern-algos]** can be imported and exported using
598+
`'jwk'`, `'raw-public'`[^modern-algos], and `'raw-seed'`[^modern-algos].
586599
* **`'RSA-OAEP'`, `'RSA-PSS'`, and `'RSASSA-PKCS1-v1_5'`** can be imported
587600
and exported using `'spki'`, `'pkcs8'`, and `'jwk'`.
588601
@@ -787,6 +800,9 @@ The algorithms currently supported include:
787800
* `'ML-KEM-512'`[^modern-algos]
788801
* `'ML-KEM-768'`[^modern-algos]
789802
* `'ML-KEM-1024'`[^modern-algos]
803+
* `'MLKEM768-P256'`[^modern-algos]
804+
* `'MLKEM768-X25519'`[^modern-algos]
805+
* `'MLKEM1024-P384'`[^modern-algos]
790806
791807
### `subtle.decapsulateKey(decapsulationAlgorithm, decapsulationKey, ciphertext, sharedKeyAlgorithm, extractable, keyUsages)`
792808
@@ -813,6 +829,9 @@ The algorithms currently supported include:
813829
* `'ML-KEM-512'`[^modern-algos]
814830
* `'ML-KEM-768'`[^modern-algos]
815831
* `'ML-KEM-1024'`[^modern-algos]
832+
* `'MLKEM768-P256'`[^modern-algos]
833+
* `'MLKEM768-X25519'`[^modern-algos]
834+
* `'MLKEM1024-P384'`[^modern-algos]
816835
817836
### `subtle.decrypt(algorithm, key, data)`
818837
@@ -1009,6 +1028,9 @@ The algorithms currently supported include:
10091028
* `'ML-KEM-512'`[^modern-algos]
10101029
* `'ML-KEM-768'`[^modern-algos]
10111030
* `'ML-KEM-1024'`[^modern-algos]
1031+
* `'MLKEM768-P256'`[^modern-algos]
1032+
* `'MLKEM768-X25519'`[^modern-algos]
1033+
* `'MLKEM1024-P384'`[^modern-algos]
10121034
10131035
### `subtle.encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKeyAlgorithm, extractable, keyUsages)`
10141036
@@ -1033,6 +1055,9 @@ The algorithms currently supported include:
10331055
* `'ML-KEM-512'`[^modern-algos]
10341056
* `'ML-KEM-768'`[^modern-algos]
10351057
* `'ML-KEM-1024'`[^modern-algos]
1058+
* `'MLKEM768-P256'`[^modern-algos]
1059+
* `'MLKEM768-X25519'`[^modern-algos]
1060+
* `'MLKEM1024-P384'`[^modern-algos]
10361061
10371062
### `subtle.encrypt(algorithm, key, data)`
10381063
@@ -1071,6 +1096,9 @@ The algorithms currently supported include:
10711096
<!-- YAML
10721097
added: v15.0.0
10731098
changes:
1099+
- version: REPLACEME
1100+
pr-url: https://github.com/nodejs/node/pull/65759
1101+
description: Hybrid KEM algorithms are now supported.
10741102
- version: v24.18.0
10751103
pr-url: https://github.com/nodejs/node/pull/62706
10761104
description: Added JWK format support for ML-KEM key types.
@@ -1135,6 +1163,9 @@ Derives the public key from a given private key.
11351163
<!-- YAML
11361164
added: v15.0.0
11371165
changes:
1166+
- version: REPLACEME
1167+
pr-url: https://github.com/nodejs/node/pull/65759
1168+
description: Hybrid KEM algorithms are now supported.
11381169
- version: v24.8.0
11391170
pr-url: https://github.com/nodejs/node/pull/59647
11401171
description: KMAC algorithms are now supported.
@@ -1176,6 +1207,9 @@ include:
11761207
* `'ML-KEM-512'`[^modern-algos]
11771208
* `'ML-KEM-768'`[^modern-algos]
11781209
* `'ML-KEM-1024'`[^modern-algos]
1210+
* `'MLKEM768-P256'`[^modern-algos]
1211+
* `'MLKEM768-X25519'`[^modern-algos]
1212+
* `'MLKEM1024-P384'`[^modern-algos]
11791213
* `'RSA-OAEP'`
11801214
* `'RSA-PSS'`
11811215
* `'RSASSA-PKCS1-v1_5'`
@@ -1199,6 +1233,9 @@ The {CryptoKey} (secret key) generating algorithms supported include:
11991233
<!-- YAML
12001234
added: v15.0.0
12011235
changes:
1236+
- version: REPLACEME
1237+
pr-url: https://github.com/nodejs/node/pull/65759
1238+
description: Hybrid KEM algorithms are now supported.
12021239
- version: v24.18.0
12031240
pr-url: https://github.com/nodejs/node/pull/62706
12041241
description: Added JWK format support for ML-KEM key types.
@@ -1368,6 +1405,9 @@ The unwrapped key algorithms supported include:
13681405
* `'ML-KEM-512'`[^modern-algos]
13691406
* `'ML-KEM-768'`[^modern-algos]
13701407
* `'ML-KEM-1024'`[^modern-algos]
1408+
* `'MLKEM768-P256'`[^modern-algos]
1409+
* `'MLKEM768-X25519'`[^modern-algos]
1410+
* `'MLKEM1024-P384'`[^modern-algos]
13711411
* `'RSA-OAEP'`
13721412
* `'RSA-PSS'`
13731413
* `'RSASSA-PKCS1-v1_5'`

0 commit comments

Comments
 (0)