static byte[] getChaCha20Nonce(byte[] nonce) {
    byte[] chacha20Nonce = new byte[12];
    System.arraycopy(
        /* src= */ nonce,
        /* srcPos= */ 16,
        /* dest= */ chacha20Nonce,
        /* destPos= */ 4,
        /* length= */ 8);
    return chacha20Nonce;
  }
ChaCha20Poly1305Jce implements an AEAD for ChaCha20Poly1305, as described in <a
href="https://tools.ietf.org/html/rfc8439#section-2.8">RFC 8439, section 2.8</a>.

<p>It uses the JCE, and requires that algorithm "ChaCha20-Poly1305" is present.
java_src/src/main/java/com/google/crypto/tink/aead/internal/XChaCha20Poly1305Jce.java