From 3d2ac63cee12e7911f49ef778c9e64742c44bf3b Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Mon, 3 Oct 2022 13:35:35 +0200 Subject: [PATCH 1/2] doc,crypto: add null length to crypto.subtle.deriveBits --- doc/api/webcrypto.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 0860080714aa01..80104c6a1cbb87 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -575,16 +575,24 @@ changes: * `algorithm`: {AlgorithmIdentifier|EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params} * `baseKey`: {CryptoKey} -* `length`: {number} +* `length`: {number|null} * Returns: {Promise} containing {ArrayBuffer} Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, `subtle.deriveBits()` attempts to generate -`length` bits. The Node.js implementation requires that `length` is a -multiple of `8`. If successful, the returned promise will be resolved with -an {ArrayBuffer} containing the generated data. +`length` bits. + +The Node.js implementation requires that when `length` is a +number it must be multiple of `8`. + +When `length` is `null` the maximum number of bits for a given algorithm is +generated. This is allowed for the `'ECDH'`, `'X25519'`[^1], and `'X448'`[^1] +algorithms. + +If successful, the returned promise will be resolved with an {ArrayBuffer} +containing the generated data. The algorithms currently supported include: From ffdd07002fafab7b60d0a482080063741499fc77 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Mon, 3 Oct 2022 13:36:03 +0200 Subject: [PATCH 2/2] doc,crypto: add missing CFRG curve algorithms to supported lists --- doc/api/webcrypto.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 80104c6a1cbb87..408d2b67cd4e2a 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -597,6 +597,8 @@ containing the generated data. The algorithms currently supported include: * `'ECDH'` +* `'X25519'`[^1] +* `'X448'`[^1] * `'HKDF'` * `'PBKDF2'` @@ -635,6 +637,8 @@ generate raw keying material, then passing the result into the The algorithms currently supported include: * `'ECDH'` +* `'X25519'`[^1] +* `'X448'`[^1] * `'HKDF'` * `'PBKDF2'` @@ -910,7 +914,11 @@ The unwrapped key algorithms supported include: * `'RSA-PSS'` * `'RSA-OAEP'` * `'ECDSA'` +* `'Ed25519'`[^1] +* `'Ed448'`[^1] * `'ECDH'` +* `'X25519'`[^1] +* `'X448'`[^1] * `'HMAC'` * `'AES-CTR'` * `'AES-CBC'`