Skip to content

Commit

Permalink
build: update Kotlin to 1.9.20
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Moussa <[email protected]>
  • Loading branch information
hamada147 committed Dec 7, 2023
1 parent 6b8543d commit f2afe7f
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 282 deletions.
15 changes: 15 additions & 0 deletions apollo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dev.petuska.npm.publish.extension.domain.NpmAccess
import org.gradle.internal.os.OperatingSystem
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackOutput.Target
import org.jetbrains.kotlin.gradle.tasks.CInteropProcess
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand Down Expand Up @@ -59,6 +60,7 @@ kotlin {

binaries.framework {
baseName = "ApolloLibrary"
embedBitcode(BitcodeEmbeddingMode.DISABLE)
}
}
iosX64 {
Expand All @@ -67,6 +69,7 @@ kotlin {

binaries.framework {
baseName = "ApolloLibrary"
embedBitcode(BitcodeEmbeddingMode.DISABLE)
}
}
iosSimulatorArm64 {
Expand All @@ -75,6 +78,7 @@ kotlin {

binaries.framework {
baseName = "ApolloLibrary"
embedBitcode(BitcodeEmbeddingMode.DISABLE)
}
}
macosArm64 {
Expand All @@ -83,6 +87,7 @@ kotlin {

binaries.framework {
baseName = "ApolloLibrary"
embedBitcode(BitcodeEmbeddingMode.DISABLE)
}
}
js(IR) {
Expand Down Expand Up @@ -347,3 +352,13 @@ npmPublish {
}
}
}

// Workaround for a bug in Gradle
afterEvaluate {
tasks.named("lintAnalyzeDebug") {
this.enabled = false
}
tasks.named("lintAnalyzeRelease") {
this.enabled = false
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
package io.iohk.atala.prism.apollo.secp256k1

import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.UByteVar
import kotlinx.cinterop.allocArray
import kotlinx.cinterop.memScoped
import kotlinx.cinterop.ptr
import kotlinx.cinterop.readBytes
import secp256k1.secp256k1_ecdh
import fr.acinq.secp256k1.Secp256k1Native

class ECDH : Secp256k1() {
class ECDH {
/**
* Compute an elliptic curve Diffie-Hellman secret.
*/
@OptIn(ExperimentalForeignApi::class)
fun ecdh(privateKey: ByteArray, publicKey: ByteArray): ByteArray {
require(privateKey.size == 32)
require(publicKey.size == 33 || publicKey.size == 65)
memScoped {
val nPubkey = allocPublicKey(publicKey)
val nPrivkey = toNat(privateKey)
val output = allocArray<UByteVar>(32)
secp256k1_ecdh(ctx, output, nPubkey.ptr, nPrivkey, null, null).requireSuccess("secp256k1_ecdh() failed")
return output.readBytes(32)
}
return Secp256k1Native.ecdh(privateKey, publicKey)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.iohk.atala.prism.apollo.secp256k1

import fr.acinq.secp256k1.Secp256k1Native

class ECDSA : Secp256k1() {
class ECDSA {
/**
* Create a normalized ECDSA signature.
*
Expand Down

This file was deleted.

Loading

0 comments on commit f2afe7f

Please sign in to comment.