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 NONCE ${n.toHex()}")
|
||||
cipher.init(
|
||||
false, AEADParameters(
|
||||
false,
|
||||
AEADParameters(
|
||||
KeyParameter(ck),
|
||||
MAC_SIZE * 8, // in bits
|
||||
n,
|
||||
|
@ -44,7 +45,8 @@ class EnDecrypt(private val aapsLogger: AAPSLogger, private val nonce: Nonce, pr
|
|||
val encryptedPayload = ByteArray(payload.size + MAC_SIZE)
|
||||
|
||||
cipher.init(
|
||||
true, AEADParameters(
|
||||
true,
|
||||
AEADParameters(
|
||||
KeyParameter(ck),
|
||||
MAC_SIZE * 8, // in bits
|
||||
n,
|
||||
|
|
|
@ -93,6 +93,5 @@ class Session(
|
|||
private const val COMMAND_PREFIX = "S0.0="
|
||||
private const val COMMAND_SUFFIX = ",G0.0"
|
||||
private const val RESPONSE_PREFIX = "0.0="
|
||||
|
||||
}
|
||||
}
|
|
@ -54,6 +54,5 @@ class EnDecryptTest {
|
|||
val encrypted = enDecrypt.encrypt(msg)
|
||||
|
||||
Assert.assertEquals(encryptedMessage.toHex(), encrypted.asByteArray().toHex())
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue