@Test
public void testBasicAesCtrHmacAead() throws Exception {

  byte[] aesCtrKeyValue = Random.randBytes(AES_KEY_SIZE);
  byte[] hmacKeyValue = Random.randBytes(HMAC_KEY_SIZE);
  int ivSize = 12;
  int tagSize = 16;
  KeysetHandle keysetHandle =
      TestUtil.createKeysetHandle(
          TestUtil.createKeyset(
              TestUtil.createKey(
                  TestUtil.createAesCtrHmacAeadKeyData(
                      aesCtrKeyValue, ivSize, hmacKeyValue, tagSize),
                  42,
                  KeyStatusType.ENABLED,
                  OutputPrefixType.TINK)));
  Aead aead = new AeadWrapper().wrap(Registry.getPrimitives(keysetHandle, Aead.class));
  byte[] plaintext = Random.randBytes(20);
  byte[] associatedData = Random.randBytes(20);
  byte[] ciphertext = aead.encrypt(plaintext, associatedData);
  byte[] decrypted = aead.decrypt(ciphertext, associatedData);
  assertArrayEquals(plaintext, decrypted);
}