private static void validateParameters(AesGcmParameters parameters)
      throws GeneralSecurityException {
    /** Current implementation restricts tag size to 16 bytes */
    if (parameters.getTagSizeBytes() != 16) {
      throw new GeneralSecurityException(
          String.format(
              "Invalid tag size in bytes %d. Currently Tink only supports serialization of AES GCM"
                  + " keys with tag size equal to 16 bytes.",
              parameters.getTagSizeBytes()));
    }
    /** Current implementation restricts IV size to 12 bytes */
    if (parameters.getIvSizeBytes() != 12) {
      throw new GeneralSecurityException(
          String.format(
              "Invalid IV size in bytes %d. Currently Tink only supports serialization of AES GCM"
                  + " keys with IV size equal to 12 bytes.",
              parameters.getIvSizeBytes()));
    }
  }
Parse LEGACY prefix to CRUNCHY, since they act the same for this type of key
java_src/src/main/java/com/google/crypto/tink/aead/internal/AesGcmProtoSerialization.java