@Override
  public byte[] decrypt(final byte[] ciphertext) throws GeneralSecurityException {
    if (ciphertext.length < NONCE_LENGTH_IN_BYTES) {
      throw new GeneralSecurityException("ciphertext too short");
    }
    byte[] nonce = Arrays.copyOf(ciphertext, NONCE_LENGTH_IN_BYTES);
    ByteBuffer rawCiphertext =
        ByteBuffer.wrap(
            ciphertext, NONCE_LENGTH_IN_BYTES, ciphertext.length - NONCE_LENGTH_IN_BYTES);
    return cipher.decrypt(nonce, rawCiphertext);
  }
Constructs a new XChaCha20 cipher with the supplied {@code key}.

@throws IllegalArgumentException when {@code key} length is not {@link
    com.google.crypto.tink.aead.internal.ChaCha20Util#KEY_SIZE_IN_BYTES}.
java_src/src/main/java/com/google/crypto/tink/subtle/XChaCha20.java