GeezerVison is showing github.com — doc: clarify diffieHellman.generateKeys recomputes same key · nodejs/node@acc52ef
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/crypto.md +5-2Lines changed: 5 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1389,8 +1389,10 @@ If `encoding` is provided a string is returned; otherwise a |
1389 | 1389 | [`Buffer`][] is returned. |
1390 | 1390 |
|
1391 | 1391 | This function is a thin wrapper around [`DH_generate_key()`][]. In particular, |
1392 | | -once a private key has been generated or set, calling this function only updates |
1393 | | -the public key but does not generate a new private key. |
| 1392 | +once a private key has been generated or set, calling this function only |
| 1393 | +recomputes the public key from the existing private key. Since the public key is |
| 1394 | +determined by the private key, the result will be the same unless the private key |
| 1395 | +has been changed via [`diffieHellman.setPrivateKey()`][]. |
1394 | 1396 |
|
1395 | 1397 | ### `diffieHellman.getGenerator([encoding])` |
1396 | 1398 |
|
@@ -6936,6 +6938,7 @@ See the [list of SSL OP Flags][] for details. |
6936 | 6938 | [`decipher.final()`]: #decipherfinaloutputencoding |
6937 | 6939 | [`decipher.update()`]: #decipherupdatedata-inputencoding-outputencoding |
6938 | 6940 | [`diffieHellman.generateKeys()`]: #diffiehellmangeneratekeysencoding |
| 6941 | +[`diffieHellman.setPrivateKey()`]: #diffiehellmansetprivatekeyprivatekey-encoding |
6939 | 6942 | [`diffieHellman.setPublicKey()`]: #diffiehellmansetpublickeypublickey-encoding |
6940 | 6943 | [`ecdh.generateKeys()`]: #ecdhgeneratekeysencoding-format |
6941 | 6944 | [`ecdh.setPrivateKey()`]: #ecdhsetprivatekeyprivatekey-encoding |
|