Files
node/doc/api
Jonathan Buhacoff d4e871424f 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-06-02 20:21:51 +02:00
..
2020-05-05 19:17:26 +02:00
2020-04-28 23:00:44 +01:00
2020-05-19 11:30:54 -07:00
2020-04-28 23:00:44 +01:00
2020-04-28 23:00:44 +01:00
2020-04-21 11:58:34 +01:00
2020-03-02 04:07:33 +00:00
2020-05-19 11:30:54 -07:00
2020-05-17 09:01:21 -07:00
2020-04-28 23:00:44 +01:00
2020-05-19 11:30:54 -07:00
2020-06-02 15:58:27 +02:00
2020-05-19 11:30:54 -07:00
2020-04-29 16:41:52 +01:00
2019-10-03 15:21:26 -07:00
2020-05-15 10:44:07 -07:00
2020-03-29 22:43:53 +02:00
2020-04-28 23:00:44 +01:00
2020-04-28 23:00:44 +01:00
2020-04-28 23:00:44 +01:00
2020-05-16 12:04:44 -07:00
2019-10-26 08:39:41 -07:00
2020-04-28 23:00:44 +01:00
2020-05-19 11:30:54 -07:00
2020-04-28 23:00:44 +01:00