@me2em/crypto
    Preparing search index...

    Function decryptAead

    • Decrypts AES-256-GCM ciphertext produced by encryptAead.

      Wraps WebCrypto errors in CryptoError to prevent DOMException from leaking into the public API.

      Parameters

      • key: CryptoKey

        CryptoKey imported via importAeadKey.

      • ciphertext: Uint8Array

        The ciphertext blob (includes the 16-byte GCM tag).

      • iv: Uint8Array

        The IV used during encryption.

      Returns Promise<Uint8Array>

      The decrypted plaintext.

      'CIPHER/DECRYPTION_FAILED' on auth failure or corrupt data.

      const plaintext = await decryptAead(key, ciphertext, iv);