title: AES GCM decrypt Firefox error only: "DOMException: The operation failed for an operation-specific reason", Chromium OK though
body: <p>I followed former answers from <a href="https://stackoverflow.com/questions/51172513/webcrypto-aes-cbc-decrypt-operation-error-the-operation-failed-for-an-operati">Webcrypto AES-CBC Decrypt: Operation Error - The operation failed for an operation-specific reason</a> and <a href="https://stackoverflow.com/questions/51531021/javascript-aes-encryption-and-decryption-advanced-encryption-standard">JavaScript AES encryption and decryption (Advanced Encryption Standard)</a>
  and used:</p>
  <pre><code>iv = crypto.getRandomValues(new Uint8Array(16))
  key = window.crypto.subtle.generateKey(
              {
                  name: &quot;AES-GCM&quot;,
                  length: 256,
              },
              false,
              [&quot;encrypt&quot;, &quot;decrypt&quot;]
          )
  </code></pre>
  <p>to generate the key
  and</p>
  <pre><code>Uint8ArrayEncrypted = window.crypto.subtle.encrypt(
          {name: &quot;aes-gcm&quot;, iv: iv, tagLength: 128}, 
          key,
          Uint8ArrayVar)
  </code></pre>
  <p>to encrypt and</p>
  <pre><code>Uint8ArrayDecrypted = window.crypto.subtle.decrypt(
          {name: &quot;aes-gcm&quot;, iv: iv, tagLength: 128}, 
          key,
          Uint8ArrayEncrypted)
  </code></pre>
  <p>to decrypt</p>
  <p>On Chromium 83 (Ubuntu) and Firefox 88, I successfully generate the key, the iv and encrypt.
  And on Chromium, it simply also decrypts without problem.<code>Uint8ArrayDecrypted</code> is correct ArrayBuffer.</p>
  <p>But FF throws the error &quot;The operation failed for an operation-specific reason&quot; and stop there. No <code>Uint8ArrayDecrypted</code> returned.</p>
  <p>I didn't use <code>tag</code>, like in <a href="https://stackoverflow.com/questions/66155504/webcrypto-api-domexception-the-provided-data-is-too-small">WebCrypto API: DOMException: The provided data is too small</a></p>
  <p>Reading <a href="https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt</a>,
  I don't see it uses tag.</p>
  <p>Does Firefox need something else specific?</p>
  <p>Why the error message is so &quot;generic&quot;? Which operation or specific reason?
  With an error so generic, I don't know where to look.</p>