From a7e0f1b28806833e70f099ba641ea8a5a33e561d Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 15 Dec 2021 21:13:50 +0000 Subject: [PATCH] Initialize ecKf before static-init for ECDH on Android, #1732 --- mirai-core/src/androidMain/kotlin/utils/crypto/ECDHAndroid.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mirai-core/src/androidMain/kotlin/utils/crypto/ECDHAndroid.kt b/mirai-core/src/androidMain/kotlin/utils/crypto/ECDHAndroid.kt index 40559a54f..3ec9e1fcb 100644 --- a/mirai-core/src/androidMain/kotlin/utils/crypto/ECDHAndroid.kt +++ b/mirai-core/src/androidMain/kotlin/utils/crypto/ECDHAndroid.kt @@ -67,6 +67,8 @@ internal actual class ECDH actual constructor(actual val keyPair: ECDHKeyPair) { init { isECDHAvailable = kotlin.runCatching { + ecKf // init + fun testECDH() { ECDHKeyPairImpl( KeyPairGenerator.getInstance("ECDH")