Skip to content

Commit

Permalink
Kotlin examples: switch to using the FFM (foreign) implementation
Browse files Browse the repository at this point in the history
Now that Kotlin supports JDK 22 the Kotlin examples should use the
implementation that is complete and actually works.
  • Loading branch information
msgilligan committed Apr 10, 2024
1 parent 19ec078 commit 3d0f393
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions secp256k1-examples-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ plugins {

dependencies {
implementation project(':secp256k1-api')
implementation project(':secp256k1-bouncy')
//implementation project(':secp256k1-foreign')
//implementation project(':secp256k1-bouncy')
implementation project(':secp256k1-foreign')
implementation 'org.bouncycastle:bcprov-jdk18on:1.77'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.bitcoinj.secp256k1.kotlin.examples

import org.bitcoinj.secp256k1.bouncy.Bouncy256k1
import org.bitcoinj.secp256k1.foreign.Secp256k1Foreign
import java.security.MessageDigest
import java.security.NoSuchAlgorithmException
import java.util.*
Expand All @@ -35,7 +35,7 @@ object Ecdsa {
@JvmStatic
fun main(args: Array<String>) {
println("Running secp256k1-jdk Ecdsa example...")
Bouncy256k1().use { secp ->
Secp256k1Foreign().use { secp ->
/* === Key Generation === */
/* Return a non-zero, in-range private key */
val privKey = secp.ecPrivKeyCreate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.bitcoinj.secp256k1.kotlin.examples

import org.bitcoinj.secp256k1.api.P256K1XOnlyPubKey
import org.bitcoinj.secp256k1.bouncy.Bouncy256k1
import org.bitcoinj.secp256k1.foreign.Secp256k1Foreign
import java.util.*

/**
Expand All @@ -31,7 +31,7 @@ object Schnorr {
@JvmStatic
fun main(args: Array<String>) {
println("Running secp256k1-jdk Schnorr example...")
Bouncy256k1().use { secp ->
Secp256k1Foreign().use { secp ->
/* === Key Generation === */
/* Return a non-zero, in-range private key */
val keyPair = secp.ecKeyPairCreate()
Expand Down

0 comments on commit 3d0f393

Please sign in to comment.