crypto: improve setAuthTag
This is an attempt to make the behavior of setAuthTag
match the documentation: In GCM mode, it can be called at any time before invoking final, even after the last call to update.
Fixes: https://github.com/nodejs/node/issues/22421
cc @nodejs/crypto @nodejs/security-wg @achronos0
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines