[@types/node] chacha20-poly1305 should not be part of CipherCCMTypes due to behavior differences #71621
Replies: 2 comments
-
Thanks for the discussion about "node", some useful links for everyone: Pinging the DT module owners: @microsoft, @jkomyno, @alvis, @r3nya, @btoueg, @smac89, @Touffy, @DeividasBakanas, @eyqs, @Hannes-Magnusson-CK, @hoo29, @kjin, @ajafff, @islishude, @mwiktorczyk, @mohsen1, @galkin, @parambirs, @eps1lon, @ThomasdenH, @WilcoBakker, @wwwy3y3, @samuela, @kuehlein, @bhongy, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky. |
Beta Was this translation helpful? Give feedback.
-
I have opened #71834 for your issue. You may want to have a look. |
Beta Was this translation helpful? Give feedback.
-
The
chacha20-poly1305
algorithm is currently included in theCipherCCMTypes
type in@types/node
, as shown below:However, its behavior differs from AES-CCM algorithms:
authTagLength
to be explicitly set, whilechacha20-poly1305
defaults to 16 bytes.chacha20-poly1305
without settingauthTagLength
, TypeScript incorrectly reports thatgetAuthTag
does not exist on theCipher
type.To avoid confusion,
chacha20-poly1305
should have its own type (e.g.,CipherChaCha20Poly1305Types
) instead of being part ofCipherCCMTypes
.https://nodejs.org/api/crypto.html#cryptocreatecipherivalgorithm-key-iv-options
Beta Was this translation helpful? Give feedback.
All reactions