Commit c0e1856
authored
Make deriveBits length parameter optional and nullable (#345)
Allow omitting the `length` parameter from calls to `deriveBits`,
defaulting to `null`, and also allow passing `null` explicitly
(as the web platform tests already do).
The "derive bits" operations already handle `null` as it can also
be returned by the "get key length" operations.
In the case of ECDH, the operation returns the entire derived key;
in the case of HKDF and PBKDF2, the operation returns an error.
This is technically speaking a breaking change, since currently
passing `null` explicitly should cause it to be converted to `0`,
causing an empty `ArrayBuffer` to be returned. However, the only
implementation that actually does so (Chromium) is willing to
change this. Additionally, returning the entire value (for ECDH)
seems more expected and more useful than returning an empty value.1 parent d424b96 commit c0e1856
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
1260 | | - | |
| 1260 | + | |
1261 | 1261 | | |
1262 | 1262 | | |
1263 | 1263 | | |
| |||
0 commit comments