diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 4d062a45ae5dee..4c205f62c5049d 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -3533,23 +3533,32 @@ the corresponding digest algorithm. This does not work for all signature algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest algorithm names. -### `crypto.diffieHellman(options)` +### `crypto.diffieHellman(options[, callback])` * `options`: {Object} * `privateKey`: {KeyObject} * `publicKey`: {KeyObject} -* Returns: {Buffer} +* `callback` {Function} + * `err` {Error} + * `secret` {Buffer} +* Returns: {Buffer} if the `callback` function is not provided. Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'`, `'x448'`, or `'x25519'` (for ECDH). +If the `callback` function is provided this function uses libuv's threadpool. + ### `crypto.fips`