@@ -552,11 +552,15 @@ The algorithms currently supported include:
552552* ` 'AES-CBC' `
553553* ` 'AES-GCM ` '
554554
555- ### ` subtle.deriveBits(algorithm, baseKey, length) `
555+ ### ` subtle.deriveBits(algorithm, baseKey[ , length] ) `
556556
557557<!-- YAML
558558added: v15.0.0
559559changes:
560+ - version: REPLACEME
561+ pr-url: https://github.com/nodejs/node/pull/53601
562+ description: The length parameter is now optional for `'ECDH'`, `'X25519'`,
563+ and `'X448'`.
560564 - version: v18.4.0
561565 pr-url: https://github.com/nodejs/node/pull/42507
562566 description: Added `'X25519'`, and `'X448'` algorithms.
@@ -566,21 +570,21 @@ changes:
566570
567571* ` algorithm ` : {AlgorithmIdentifier|EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params}
568572* ` baseKey ` : {CryptoKey}
569- * ` length ` : {number|null}
570- * Returns: {Promise} containing {ArrayBuffer}
573+ * ` length ` : {number|null} ** Default: ** ` null `
574+ * Returns: {Promise} Fulfills with an {ArrayBuffer}
571575
572576<!-- lint enable maximum-line-length remark-lint-->
573577
574578Using the method and parameters specified in ` algorithm ` and the keying
575579material provided by ` baseKey ` , ` subtle.deriveBits() ` attempts to generate
576580` length ` bits.
577581
578- The Node.js implementation requires that when ` length ` is a
579- number it must be multiple of ` 8 ` .
582+ The Node.js implementation requires that ` length ` , when a number, is a multiple
583+ of ` 8 ` .
580584
581- When ` length ` is ` null ` the maximum number of bits for a given algorithm is
582- generated. This is allowed for the ` 'ECDH' ` , ` 'X25519' ` , and ` 'X448' `
583- algorithms.
585+ When ` length ` is not provided or ` null ` the maximum number of bits for a given
586+ algorithm is generated. This is allowed for the ` 'ECDH' ` , ` 'X25519' ` , and ` 'X448' `
587+ algorithms, for other algorithms ` length ` is required to be a number .
584588
585589If successful, the returned promise will be resolved with an {ArrayBuffer}
586590containing the generated data.
0 commit comments