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 7a731ef

Browse filesBrowse files
tniessentargos
authored andcommitted
doc,lib,test: rename HKDF 'key' argument
PR-URL: #39474 Refs: #39471 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent e53ec68 commit 7a731ef
Copy full SHA for 7a731ef

3 files changed

+11-11Lines changed: 11 additions & 11 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/crypto.md‎

Copy file name to clipboardExpand all lines: doc/api/crypto.md
+8-8Lines changed: 8 additions & 8 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -3839,14 +3839,14 @@ const {
38393839
console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]
38403840
```
38413841

3842-
### `crypto.hkdf(digest, key, salt, info, keylen, callback)`
3842+
### `crypto.hkdf(digest, ikm, salt, info, keylen, callback)`
38433843
<!-- YAML
38443844
added: v15.0.0
38453845
-->
38463846

38473847
* `digest` {string} The digest algorithm to use.
3848-
* `key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} The secret
3849-
key. It must be at least one byte in length.
3848+
* `ikm` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} The input
3849+
keying material. It must be at least one byte in length.
38503850
* `salt` {string|ArrayBuffer|Buffer|TypedArray|DataView} The salt value. Must
38513851
be provided but can be zero-length.
38523852
* `info` {string|ArrayBuffer|Buffer|TypedArray|DataView} Additional info value.
@@ -3859,7 +3859,7 @@ added: v15.0.0
38593859
* `err` {Error}
38603860
* `derivedKey` {Buffer}
38613861

3862-
HKDF is a simple key derivation function defined in RFC 5869. The given `key`,
3862+
HKDF is a simple key derivation function defined in RFC 5869. The given `ikm`,
38633863
`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
38643864

38653865
The supplied `callback` function is called with two arguments: `err` and
@@ -3892,14 +3892,14 @@ hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {
38923892
});
38933893
```
38943894

3895-
### `crypto.hkdfSync(digest, key, salt, info, keylen)`
3895+
### `crypto.hkdfSync(digest, ikm, salt, info, keylen)`
38963896
<!-- YAML
38973897
added: v15.0.0
38983898
-->
38993899

39003900
* `digest` {string} The digest algorithm to use.
3901-
* `key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} The secret
3902-
key. It must be at least one byte in length.
3901+
* `ikm` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} The input
3902+
keying material. It must be at least one byte in length.
39033903
* `salt` {string|ArrayBuffer|Buffer|TypedArray|DataView} The salt value. Must
39043904
be provided but can be zero-length.
39053905
* `info` {string|ArrayBuffer|Buffer|TypedArray|DataView} Additional info value.
@@ -3911,7 +3911,7 @@ added: v15.0.0
39113911
* Returns: {ArrayBuffer}
39123912

39133913
Provides a synchronous HKDF key derivation function as defined in RFC 5869. The
3914-
given `key`, `salt` and `info` are used with the `digest` to derive a key of
3914+
given `ikm`, `salt` and `info` are used with the `digest` to derive a key of
39153915
`keylen` bytes.
39163916

39173917
The successfully generated `derivedKey` will be returned as an {ArrayBuffer}.
Collapse file

‎lib/internal/crypto/hkdf.js‎

Copy file name to clipboardExpand all lines: lib/internal/crypto/hkdf.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function prepareKey(key) {
9191

9292
if (!isArrayBufferView(key)) {
9393
throw new ERR_INVALID_ARG_TYPE(
94-
'key',
94+
'ikm',
9595
[
9696
'string',
9797
'SecretKeyObject',
Collapse file

‎test/parallel/test-crypto-hkdf.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-crypto-hkdf.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ const {
2929
[1, {}, [], false, Infinity].forEach((i) => {
3030
assert.throws(() => hkdf('sha256', i), {
3131
code: 'ERR_INVALID_ARG_TYPE',
32-
message: /^The "key" argument must be /
32+
message: /^The "ikm" argument must be /
3333
});
3434
assert.throws(() => hkdfSync('sha256', i), {
3535
code: 'ERR_INVALID_ARG_TYPE',
36-
message: /^The "key" argument must be /
36+
message: /^The "ikm" argument must be /
3737
});
3838
});
3939

0 commit comments

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