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