@AccessesPartialKey
  @SuppressWarnings("InsecureCryptoUsage")
  public static Aead create(AesEaxKey key) throws GeneralSecurityException {
    if (!FIPS.isCompatible()) {
      throw new GeneralSecurityException("Can not use AES-EAX in FIPS-mode.");
    }
    if (key.getParameters().getTagSizeBytes() != TAG_SIZE_IN_BYTES) {
      throw new GeneralSecurityException(
          "AesEaxJce only supports 16 byte tag size, not " + key.getParameters().getTagSizeBytes());
    }
    return new AesEaxJce(
        key.getKeyBytes().toByteArray(InsecureSecretKeyAccess.get()),
        key.getParameters().getIvSizeBytes(),
        key.getOutputPrefix().toByteArray());
  }
This class implements the EAX mode using AES.

<p>EAX is an encryption mode proposed by Bellare, Rogaway and Wagner
(http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf). The encryption mode is an alternative to CCM
and has been proposed as a NIST standard:
http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/eax/eax-spec.pdf

<p>The parameter choices have been restricted to a small set of options:

<ul>
  <li>The tag size is always 16 bytes
  <li>Nonces are chosen by the implementation at random. Their size is 12 or 16 bytes.
</ul>

<p>Plans: The current implementation is slow since it uses JCA and only assumes that the
encryption modes "AES/ECB/NOPADDING" and "AES/CTR/NOPADDING" are implemented. Our plan is to
implement a native version of EAX.

@since 1.0.0
java_src/src/main/java/com/google/crypto/tink/subtle/AesEaxJce.java