title: How to make GCM Encrypt with authentication tag for Android
body: <p>I want to make a function encrypt data by GCM mode with authentication tag for Android.
  This is my source code:</p>
  
  <pre><code>public static byte[] GCMEncrypt(String hexKey, String hexIV, byte[] aad) throws Exception {
          byte[] aKey = hexStringToByteArray(hexKey);
          byte[] aIV = hexStringToByteArray(hexIV);
          Key key = new SecretKeySpec(aKey, "AES");
          Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
          cipher.init(Cipher.ENCRYPT_MODE, key, new GCMParameterSpec(16 * Byte.SIZE, aIV));
          cipher.updateAAD(aad);
          byte[] encrypted = cipher.doFinal(aKey);
          return encrypted;
      }
  </code></pre>
  
  <p>How to insert authentication tag into this code?</p>