format: ktlint
This commit is contained in:
parent
c71433ad1a
commit
4046828567
|
@ -22,7 +22,8 @@ class EnDecrypt(private val aapsLogger: AAPSLogger, private val nonce: Nonce, pr
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "Decrypt header ${header.toHex()} payload: ${payload.toHex()}")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "Decrypt header ${header.toHex()} payload: ${payload.toHex()}")
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "Decrypt NONCE ${n.toHex()}")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "Decrypt NONCE ${n.toHex()}")
|
||||||
cipher.init(
|
cipher.init(
|
||||||
false, AEADParameters(
|
false,
|
||||||
|
AEADParameters(
|
||||||
KeyParameter(ck),
|
KeyParameter(ck),
|
||||||
MAC_SIZE * 8, // in bits
|
MAC_SIZE * 8, // in bits
|
||||||
n,
|
n,
|
||||||
|
@ -44,7 +45,8 @@ class EnDecrypt(private val aapsLogger: AAPSLogger, private val nonce: Nonce, pr
|
||||||
val encryptedPayload = ByteArray(payload.size + MAC_SIZE)
|
val encryptedPayload = ByteArray(payload.size + MAC_SIZE)
|
||||||
|
|
||||||
cipher.init(
|
cipher.init(
|
||||||
true, AEADParameters(
|
true,
|
||||||
|
AEADParameters(
|
||||||
KeyParameter(ck),
|
KeyParameter(ck),
|
||||||
MAC_SIZE * 8, // in bits
|
MAC_SIZE * 8, // in bits
|
||||||
n,
|
n,
|
||||||
|
|
|
@ -93,6 +93,5 @@ class Session(
|
||||||
private const val COMMAND_PREFIX = "S0.0="
|
private const val COMMAND_PREFIX = "S0.0="
|
||||||
private const val COMMAND_SUFFIX = ",G0.0"
|
private const val COMMAND_SUFFIX = ",G0.0"
|
||||||
private const val RESPONSE_PREFIX = "0.0="
|
private const val RESPONSE_PREFIX = "0.0="
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -54,6 +54,5 @@ class EnDecryptTest {
|
||||||
val encrypted = enDecrypt.encrypt(msg)
|
val encrypted = enDecrypt.encrypt(msg)
|
||||||
|
|
||||||
Assert.assertEquals(encryptedMessage.toHex(), encrypted.asByteArray().toHex())
|
Assert.assertEquals(encryptedMessage.toHex(), encrypted.asByteArray().toHex())
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue