/** * Encodes the specified integer data as a four byte array. * * @param data The integer data to encode. * * @return The encoded data. */ public static byte[] encodeIntData(final int data) { return IntegerUtils.toBytes(data); }
/** * Encodes the specified data as {@code data.length || data}. * * @param data The data to encode, may be {@code null}. * * @return The encoded data. */ public static byte[] encodeDataWithLength(final byte[] data) { byte[] bytes = data != null ? data : new byte[0]; byte[] length = IntegerUtils.toBytes(bytes.length); return ByteUtils.concat(length, bytes); }
if (i == 1) inputBytes = ByteUtils.concat(salt, IntegerUtils.toBytes(blockIndex)); currentU = prf.doFinal(inputBytes); xorU = currentU;
byte[] counterBytes = IntegerUtils.toBytes(i);