private byte[] createIV(long machineId, long localSequenceNumber) {
ByteBuffer buffer = ByteBuffer.allocate(IV_SIZE);
buffer.putLong(machineId);
- buffer.putLong(localSequenceNumber);
+ long localSequenceNumberShifted = localSequenceNumber << 16;
+ buffer.putLong(localSequenceNumberShifted);
return buffer.array();
}
public byte[] getSlotCryptIV() {
ByteBuffer buffer = ByteBuffer.allocate(CloudComm.IV_SIZE);
buffer.putLong(machineid);
- buffer.putLong(localSequenceNumber);
+ long localSequenceNumberShift = localSequenceNumber << 16;
+ buffer.putLong(localSequenceNumberShift);
return buffer.array();
}
-
public String toString() {
return "<" + getSequenceNumber() + ">";
}