<BUG>if (random == null) {random = new SecureRandom();}random.nextBytes(iv);} else if (expectedIvLength == 0 && iv != null) {</BUG><CONTEXT>if (!encrypting) {throw new InvalidAlgorithmParameterException("IV must be specified in " + mode+ " mode");}iv = new byte[expectedIvLength];<extra_id_0>throw new InvalidAlgorithmParameterException("IV not used in " + mode + " mode");</CONTEXT>
if (random != null) {} else {NativeCrypto.RAND_bytes(iv);} else if (expectedIvLength == 0 && iv != null) {