int doFinalInternal(ByteBuffer input, ByteBuffer output)
            throws ShortBufferException, IllegalBlockSizeException, BadPaddingException {
        checkInitialization();
        byte[] aad = getAad();
        final int bytesWritten;
        try {
            if (isEncrypting()) {
                bytesWritten = NativeCrypto.EVP_AEAD_CTX_seal_buf(
                        evpAead, encodedKey, tagLengthInBytes, output, iv, input, aad);
            } else {
                bytesWritten = NativeCrypto.EVP_AEAD_CTX_open_buf(
                        evpAead, encodedKey, tagLengthInBytes, output, iv, input, aad);
            }
        } catch (BadPaddingException e) {
            throwAEADBadTagExceptionIfAvailable(e.getMessage(), e.getCause());
            throw e;
        }
        if (isEncrypting()) {
            mustInitialize = true;
        }
        return bytesWritten;
    }
Returns whether reusing nonces is allowed (aka, whether this is nonce misuse-resistant).
Most AEAD ciphers are not, but some are specially constructed so that reusing a key/nonce
pair is safe.
common/src/main/java/org/conscrypt/OpenSSLAeadCipher.java