private byte[] createIV(long machineId, long localSequenceNumber) {
ByteBuffer buffer = ByteBuffer.allocate(IV_SIZE);
buffer.putLong(machineId);
private byte[] createIV(long machineId, long localSequenceNumber) {
ByteBuffer buffer = ByteBuffer.allocate(IV_SIZE);
buffer.putLong(machineId);
// byte[] bytes = new byte[slotBytes.length + IV_SIZE];
// System.arraycopy(iVBytes, 0, bytes, 0, iVBytes.length);
// System.arraycopy(slotBytes, 0, bytes, IV_SIZE, slotBytes.length);
// byte[] bytes = new byte[slotBytes.length + IV_SIZE];
// System.arraycopy(iVBytes, 0, bytes, 0, iVBytes.length);
// System.arraycopy(slotBytes, 0, bytes, IV_SIZE, slotBytes.length);
url = buildRequest(false, sequencenumber, 0);
timer.startTime();
con = url.openConnection();
url = buildRequest(false, sequencenumber, 0);
timer.startTime();
con = url.openConnection();
throw new ServerException("getSlots failed", ServerException.TypeConnectTimeout);
} catch (ServerException e) {
timer.endTime();
throw new ServerException("getSlots failed", ServerException.TypeConnectTimeout);
} catch (ServerException e) {
timer.endTime();
// Encrypt the data for sending
// byte[] encryptedData = encryptCipher.doFinal(totalData);
// byte[] encryptedData = encryptCipher.doFinal(totalData);
// Encrypt the data for sending
// byte[] encryptedData = encryptCipher.doFinal(totalData);
// byte[] encryptedData = encryptCipher.doFinal(totalData);
byte[] encryptedData = encryptSlotAndPrependIV(totalData, iv);
// Open a TCP socket connection to a local device
byte[] encryptedData = encryptSlotAndPrependIV(totalData, iv);
// Open a TCP socket connection to a local device