Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 70f5502

Browse filesBrowse files
panvadanielleadams
authored andcommitted
doc,crypto: add null length to crypto.subtle.deriveBits
PR-URL: #44876 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent daf3152 commit 70f5502
Copy full SHA for 70f5502

File tree

Expand file treeCollapse file tree

1 file changed

+12
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/webcrypto.md‎

Copy file name to clipboardExpand all lines: doc/api/webcrypto.md
+12-4Lines changed: 12 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -562,16 +562,24 @@ changes:
562562

563563
* `algorithm`: {AlgorithmIdentifier|EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params}
564564
* `baseKey`: {CryptoKey}
565-
* `length`: {number}
565+
* `length`: {number|null}
566566
* Returns: {Promise} containing {ArrayBuffer}
567567

568568
<!--lint enable maximum-line-length remark-lint-->
569569

570570
Using the method and parameters specified in `algorithm` and the keying
571571
material provided by `baseKey`, `subtle.deriveBits()` attempts to generate
572-
`length` bits. The Node.js implementation requires that `length` is a
573-
multiple of `8`. If successful, the returned promise will be resolved with
574-
an {ArrayBuffer} containing the generated data.
572+
`length` bits.
573+
574+
The Node.js implementation requires that when `length` is a
575+
number it must be multiple of `8`.
576+
577+
When `length` is `null` the maximum number of bits for a given algorithm is
578+
generated. This is allowed for the `'ECDH'`, `'X25519'`[^1], and `'X448'`[^1]
579+
algorithms.
580+
581+
If successful, the returned promise will be resolved with an {ArrayBuffer}
582+
containing the generated data.
575583

576584
The algorithms currently supported include:
577585

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.