0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00
nodejs/doc/api
Jonathan Buhacoff d093e788d1
doc: update function description for decipher.setAAD
According to the
[NodeJS CCM example](https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_ccm_mode],
when decrypting the `plaintextLength` parameter actually refers to the
ciphertext length, not the plaintext length:

```
decipher.setAAD(aad, {
  plaintextLength: ciphertext.length
});
```

The same can be seen in the
[OpenSSL docs](https://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption)
where a call to `EVP_DecryptUpdate` passes the ciphertext length:

```
/* Provide the total ciphertext length */
    if(1 != EVP_DecryptUpdate(ctx, NULL, &len, NULL, ciphertext_len))
        handleErrors();
```

This parameter probably should have been called `inputLength` or
`bufferLength` instead of `plaintextLength`, so that it makes sense
both when encrypting and decrypting, but at least we can correct the
sentence in the documentation for now to refer to the correct value.

PR-URL: https://github.com/nodejs/node/pull/33095
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-05-19 19:28:36 +02:00
..
addons.md
assert.md 2020-05-05, Version 14.2.0 (Current) 2020-05-05 20:24:37 +02:00
async_hooks.md async_hooks: move PromiseHook handler to JS 2020-05-09 07:52:22 +02:00
buffer.md doc: update Buffer(size) documentation 2020-05-08 01:16:03 +02:00
child_process.md
cli.md cli: add --trace-atomics-wait flag 2020-05-15 19:37:40 +02:00
cluster.md
console.md 2020-05-05, Version 14.2.0 (Current) 2020-05-05 20:24:37 +02:00
crypto.md doc: update function description for decipher.setAAD 2020-05-19 19:28:36 +02:00
debugger.md
deprecations.md repl: update deprecation codes 2020-05-18 03:20:40 +02:00
dgram.md
dns.md
documentation.md
domain.md
embedding.md
errors.md module: add specific error for dir import 2020-05-15 19:08:39 -07:00
esm.md doc: fix extension in esm example 2020-05-16 21:09:12 -05:00
events.md
fs.md fs: add .ref() and .unref() methods to watcher classes 2020-05-09 07:59:08 +02:00
globals.md
http2.md doc: add Uint8Array to end and write 2020-05-08 01:10:36 +02:00
http.md doc: add note about clientError writable handling 2020-05-12 20:02:49 +02:00
https.md 2020-04-29, Version 13.14.0 (Current) 2020-04-30 00:24:31 +02:00
index.md
inspector.md
intl.md
modules.md
n-api.md doc: fix typo in n-api.md 2020-05-12 05:39:05 +02:00
net.md doc: add warning for socket.connect reuse 2020-05-08 18:03:26 +02:00
os.md doc: fix markdown parsing on doc/api/os.md 2020-04-29 03:53:28 +02:00
path.md
perf_hooks.md doc: clarify about the Node.js-only extensions in perf_hooks 2020-05-19 22:16:10 +08:00
policy.md
process.md
punycode.md
querystring.md
readline.md
repl.md
report.md
stream.md doc: add comment about highWaterMark limit 2020-05-19 19:20:51 +02:00
string_decoder.md
synopsis.md
timers.md
tls.md tls: fix --tls-keylog option 2020-05-14 16:52:52 +02:00
tracing.md
tty.md
url.md doc: doc and test URLSearchParams discrepancy 2020-05-06 10:40:10 -07:00
util.md doc: add util.types.isArrayBufferView() 2020-05-02 10:32:26 +05:30
v8.md
vm.md Revert "vm: add importModuleDynamically option to compileFunction" 2020-05-15 12:14:35 +02:00
wasi.md wasi: update start() behavior to match spec 2020-04-28 13:04:43 -04:00
worker_threads.md doc: add warnings about transferring Buffers and ArrayBuffer 2020-05-08 00:59:15 +02:00
zlib.md