@@ -569,11 +569,15 @@ The algorithms currently supported include:
569569* ` 'AES-CBC' `
570570* ` 'AES-GCM ` '
571571
572- ### ` subtle.deriveBits(algorithm, baseKey, length) `
572+ ### ` subtle.deriveBits(algorithm, baseKey[ , length] ) `
573573
574574<!-- YAML
575575added: v15.0.0
576576changes:
577+ - version: REPLACEME
578+ pr-url: https://github.com/nodejs/node/pull/53601
579+ description: The length parameter is now optional for `'ECDH'`, `'X25519'`,
580+ and `'X448'`.
577581 - version:
578582 - v18.4.0
579583 - v16.17.0
@@ -585,7 +589,7 @@ changes:
585589
586590* ` algorithm ` : {AlgorithmIdentifier|EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params}
587591* ` baseKey ` : {CryptoKey}
588- * ` length ` : {number|null}
592+ * ` length ` : {number|null} ** Default: ** ` null `
589593* Returns: {Promise} Fulfills with an {ArrayBuffer}
590594
591595<!-- lint enable maximum-line-length remark-lint-->
@@ -594,12 +598,12 @@ Using the method and parameters specified in `algorithm` and the keying
594598material provided by ` baseKey ` , ` subtle.deriveBits() ` attempts to generate
595599` length ` bits.
596600
597- The Node.js implementation requires that when ` length ` is a
598- number it must be multiple of ` 8 ` .
601+ The Node.js implementation requires that ` length ` , when a number, is a multiple
602+ of ` 8 ` .
599603
600- When ` length ` is ` null ` the maximum number of bits for a given algorithm is
601- generated. This is allowed for the ` 'ECDH' ` , ` 'X25519' ` , and ` 'X448' `
602- algorithms.
604+ When ` length ` is not provided or ` null ` the maximum number of bits for a given
605+ algorithm is generated. This is allowed for the ` 'ECDH' ` , ` 'X25519' ` , and ` 'X448' `
606+ algorithms, for other algorithms ` length ` is required to be a number .
603607
604608If successful, the returned promise will be resolved with an {ArrayBuffer}
605609containing the generated data.
0 commit comments