Commit 29a5ab53 authored by Him188's avatar Him188

Use default shareKey if ECDH is not available

parent 680f452c
...@@ -77,6 +77,7 @@ actual class ECDH actual constructor(actual val keyPair: ECDHKeyPair) { ...@@ -77,6 +77,7 @@ actual class ECDH actual constructor(actual val keyPair: ECDHKeyPair) {
} }
actual fun calculateShareKeyByPeerPublicKey(peerPublicKey: ECDHPublicKey): ByteArray { actual fun calculateShareKeyByPeerPublicKey(peerPublicKey: ECDHPublicKey): ByteArray {
if (!isECDHAvailable) return keyPair.initialShareKey
return calculateShareKey(keyPair.privateKey, peerPublicKey) return calculateShareKey(keyPair.privateKey, peerPublicKey)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment