Use default shareKey if ECDH is not available

This commit is contained in:
Him188 2020-02-18 20:02:13 +08:00
parent 680f452cae
commit 29a5ab53a9

View File

@ -77,6 +77,7 @@ actual class ECDH actual constructor(actual val keyPair: ECDHKeyPair) {
}
actual fun calculateShareKeyByPeerPublicKey(peerPublicKey: ECDHPublicKey): ByteArray {
if (!isECDHAvailable) return keyPair.initialShareKey
return calculateShareKey(keyPair.privateKey, peerPublicKey)
}