@@ -567,11 +567,15 @@ The algorithms currently supported include:
567567* ` 'AES-CBC' `
568568* ` 'AES-GCM ` '
569569
570- ### ` subtle.deriveBits(algorithm, baseKey, length) `
570+ ### ` subtle.deriveBits(algorithm, baseKey[ , length] ) `
571571
572572<!-- YAML
573573added: v15.0.0
574574changes:
575+ - version: REPLACEME
576+ pr-url: https://github.com/nodejs/node/pull/53601
577+ description: The length parameter is now optional for `'ECDH'`, `'X25519'`,
578+ and `'X448'`.
575579 - version:
576580 - v18.4.0
577581 - v16.17.0
@@ -583,7 +587,7 @@ changes:
583587
584588* ` algorithm ` : {AlgorithmIdentifier|EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params}
585589* ` baseKey ` : {CryptoKey}
586- * ` length ` : {number|null}
590+ * ` length ` : {number|null} ** Default: ** ` null `
587591* Returns: {Promise} Fulfills with an {ArrayBuffer}
588592
589593<!-- lint enable maximum-line-length remark-lint-->
@@ -592,12 +596,12 @@ Using the method and parameters specified in `algorithm` and the keying
592596material provided by ` baseKey ` , ` subtle.deriveBits() ` attempts to generate
593597` length ` bits.
594598
595- The Node.js implementation requires that when ` length ` is a
596- number it must be multiple of ` 8 ` .
599+ The Node.js implementation requires that ` length ` , when a number, is a multiple
600+ of ` 8 ` .
597601
598- When ` length ` is ` null ` the maximum number of bits for a given algorithm is
599- generated. This is allowed for the ` 'ECDH' ` , ` 'X25519' ` , and ` 'X448' `
600- algorithms.
602+ When ` length ` is not provided or ` null ` the maximum number of bits for a given
603+ algorithm is generated. This is allowed for the ` 'ECDH' ` , ` 'X25519' ` , and ` 'X448' `
604+ algorithms, for other algorithms ` length ` is required to be a number .
601605
602606If successful, the returned promise will be resolved with an {ArrayBuffer}
603607containing the generated data.
0 commit comments