doc,crypto: add null length to crypto.subtle.deriveBits

PR-URL: https://github.com/nodejs/node/pull/44876
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Filip Skokan authored and Danielle Adams committed 2022-10-10 09:05:05 -04:00
1 parent daf3152f7e
commit 70f55020d3
1 file changed
+12 -4
+12 -4
View File
@@ -562,16 +562,24 @@ changes:
* `algorithm`: {AlgorithmIdentifier|EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params}
* `baseKey`: {CryptoKey}
* `length`: {number}
* `length`: {number|null}
* Returns: {Promise} containing {ArrayBuffer}
<!--lint enable maximum-line-length remark-lint-->
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: