- doc: clarify tagHex may be empty when the auth tag is already appended
- dart + js bridges coerce a null/missing tagHex to "" so the call can't
throw before the method's own try/catch fallback
- js prelude defaults tagHex to "" so callers can omit it
(kept default padding for AESMode.gcm intentionally — see PR reply: in the
'encrypt' package, gcm isn't in _streamable, so padding:null would route
decrypt() to _processBlocks() and skip GCM tag verification.)
extensions couldn't do AES-GCM, only AES-CBC (via cryptoHandler). this
adds a decryptAESGCM bridge function so dart and js extensions can decrypt
AES/GCM/NoPadding payloads (needed to port extractors like MoonExtractor).
decryptAESGCM(encrypted, keyHex, ivHex, tagHex):
- encrypted = base64 ciphertext, key/iv/tag = hex
- appends the auth tag to the ciphertext (what pointycastle's GCM and
java's AES/GCM/NoPadding expect) and decrypts with tag verification
- also works when the tag is already appended to the ciphertext: just
pass an empty tagHex
- returns the decrypted utf-8 string, or the input on failure (same as
cryptoHandler)
wired in all three layers like the existing crypto helpers:
- lib/eval/model/m_bridge.dart (impl, via the 'encrypt' package)
- lib/eval/dart/bridge/m_provider.dart (dart/d4rt registration)
- lib/eval/javascript/utils.dart (js handler + prelude function)