(v10.x backport) Backport 12 crypto commits
This is a manual backport of all commits listed in https://github.com/nodejs/node/issues/20691. Full list of commits:
- https://github.com/nodejs/node/pull/20706/commits/40c014f6ec9056fe32bfe13874dadf0690d45570 [358d8ffa] - (SEMVER-MINOR) crypto: allow to restrict valid GCM tag length (Tobias Nießen) https://github.com/nodejs/node/pull/20039
- https://github.com/nodejs/node/pull/20706/commits/1cd6fae5e6f90f21881e2b00dffd8548139fe63a [c8512630] - crypto: add createCipher/WithIV functions (Daniel Bevenius) https://github.com/nodejs/node/pull/20164
- https://github.com/nodejs/node/pull/20706/commits/8d2b3d29512c25edf93f7f7837117682bbbafd27 [d024c2cd] - crypto: add addCipherPrototypeFunctions function (Daniel Bevenius) https://github.com/nodejs/node/pull/20164
- https://github.com/nodejs/node/pull/20706/commits/7ffaf72503e9fe6a9273d8169ca420a727b7e2e7 [9f97f104] - crypto: remove rsaPrivate and rename rsaPublic (Daniel Bevenius) https://github.com/nodejs/node/pull/20164
- https://github.com/nodejs/node/pull/20706/commits/1ae5218e252f2b37cf69b0cf092286a7931a0b9f [15fd0d95] - src: fix node_crypto.cc compiler warnings (Daniel Bevenius) https://github.com/nodejs/node/pull/20216
- https://github.com/nodejs/node/pull/20706/commits/9e9dad689afe2bd7987a0e7d41faf7a5948a901d [c521a20f] - test: remove crypto.DEFAULT_ENCODING usage (Daniel Bevenius) https://github.com/nodejs/node/pull/20221
- https://github.com/nodejs/node/pull/20706/commits/3bd5db3f5a69309d95a9c2a6c22151264125be80 [4809db93] - crypto: use kNoAuthTagLength in InitAuthenticated (Tobias Nießen) https://github.com/nodejs/node/pull/20225
- https://github.com/nodejs/node/pull/20706/commits/f57543b1ee4c74c24504783e71f81bfa885acbc3 [9d35f696] - crypto: add using directives for v8::Int32, Uint32 (Tobias Nießen) https://github.com/nodejs/node/pull/20225
- https://github.com/nodejs/node/pull/20706/commits/0259d30c0587c69000b46a8f301464388ef1866f [f9b9974f] - (SEMVER-MINOR) crypto: support authTagLength in GCM encryption (Tobias Nießen) https://github.com/nodejs/node/pull/20235
- https://github.com/nodejs/node/pull/20706/commits/bb975aa25a9dfa43ab4b919378b57bf6db9d0c42 [f7cdeba5] - crypto: allocate more memory for cipher.update() (Yihong Wang) https://github.com/nodejs/node/pull/20370
- https://github.com/nodejs/node/pull/20706/commits/60c5ada573013b095ba6d0e14a474419e96fd2d4 [d7cba768] - src: more automatic memory management in node_crypto.cc (Anna Henningsen) https://github.com/nodejs/node/pull/20238
- https://github.com/nodejs/node/pull/20706/commits/8177b22285e37de2966b1f0b9f01e235d86cdba9 [e3ceae72] - crypto: add test case for AES key wrapping (Yihong Wang) https://github.com/nodejs/node/pull/20587
It would be great if @danbev, @yhwang, @addaleax could have a look at their respective commits (FYI, Anna's commit landed without conflicts).