@@ -567,11 +567,15 @@ The algorithms currently supported include:
567
567
* ` 'AES-CBC' `
568
568
* ` 'AES-GCM ` '
569
569
570
- ### ` subtle.deriveBits(algorithm, baseKey, length) `
570
+ ### ` subtle.deriveBits(algorithm, baseKey[ , length] ) `
571
571
572
572
<!-- YAML
573
573
added: v15.0.0
574
574
changes:
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'`.
575
579
- version:
576
580
- v18.4.0
577
581
- v16.17.0
@@ -583,7 +587,7 @@ changes:
583
587
584
588
* ` algorithm ` : {AlgorithmIdentifier|EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params}
585
589
* ` baseKey ` : {CryptoKey}
586
- * ` length ` : {number|null}
590
+ * ` length ` : {number|null} ** Default: ** ` null `
587
591
* Returns: {Promise} Fulfills with an {ArrayBuffer}
588
592
589
593
<!-- lint enable maximum-line-length remark-lint-->
@@ -592,12 +596,12 @@ Using the method and parameters specified in `algorithm` and the keying
592
596
material provided by ` baseKey ` , ` subtle.deriveBits() ` attempts to generate
593
597
` length ` bits.
594
598
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 ` .
597
601
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 .
601
605
602
606
If successful, the returned promise will be resolved with an {ArrayBuffer}
603
607
containing the generated data.
0 commit comments