Update crypto.md to correct description of `decipher.setAuthTag` by jbuhacoff · Pull Request #33097 · nodejs/node
Calling `decipher.setAuthTag` after `decipher.update` will result in an error like `Unsupported state or unable to authenticate data`. The example code in [CCM mode](https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_ccm_mode) is correct, but to demonstrate the mistake in the documentation you can take the same example and move the `setAuthTag` call to in between `update` and `final` you will see the error.
added
crypto
labels
Apr 27, 2020Restore note about calling setAuthTag before decipher.final and add new note about calling it before decipher.update for CCM mode.
Added detail to note about calling setAuthTag before decipher.final to mention that for CCM mode it must be called before decipher.update.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters