noble-ciphers
noble-ciphers copied to clipboard
AES-GCM integration with webcrypto brakes when optional param not sent
When a cipher is generated with AES-GCM using integration with webcrypto, the third parameter of the gcm function, ADD, is optional, however undefined
is not accepted by the webcrypto API and error is launched. It didn't happen in nodejs, only in a browser environment.
See the reproduction of the bug:
My user agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
But you can reproduce by yourself in the following repository: https://antonioconselheiro.github.io/noble-cipher-bug-in-webcrypto-aes-gcm-integration/
I've opened a PR with the fix: https://github.com/paulmillr/noble-ciphers/pull/34