private byte[] rawDecrypt(final byte[] ciphertext, final byte[] associatedData)
      throws GeneralSecurityException {
    if (ciphertext.length < XChaCha20.NONCE_LENGTH_IN_BYTES + Poly1305.MAC_TAG_SIZE_IN_BYTES) {
      throw new GeneralSecurityException("ciphertext too short");
    }
    byte[] nonce = Arrays.copyOf(ciphertext, XChaCha20.NONCE_LENGTH_IN_BYTES);
    ByteBuffer rawCiphertext =
        ByteBuffer.wrap(
            ciphertext,
            XChaCha20.NONCE_LENGTH_IN_BYTES,
            ciphertext.length - XChaCha20.NONCE_LENGTH_IN_BYTES);
    return cipher.decrypt(rawCiphertext, nonce, associatedData);
  }
XChaCha20Poly1305 AEAD construction, as described in
https://tools.ietf.org/html/draft-arciszewski-xchacha-01.
java_src/src/main/java/com/google/crypto/tink/subtle/XChaCha20Poly1305.java