Skip to content

Commit

Permalink
Kotlin examples: Use Bouncy256k1
Browse files Browse the repository at this point in the history
This is because Kotlin does not yet support JDK 22, so
we'll have to limit the Kotlin examples to the (incomplete) Bouncy
implementation for  now...
  • Loading branch information
msgilligan committed Mar 8, 2024
1 parent 0e9f679 commit 2186156
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.bitcoinj.secp256k1.kotlin.examples

import org.bitcoinj.secp256k1.foreign.Secp256k1Foreign
import org.bitcoinj.secp256k1.bouncy.Bouncy256k1
import java.security.MessageDigest
import java.security.NoSuchAlgorithmException
import java.util.*
Expand All @@ -20,7 +20,7 @@ object Ecdsa {
@JvmStatic
fun main(args: Array<String>) {
println("Running secp256k1-jdk Ecdsa example...")
Secp256k1Foreign().use { secp ->
Bouncy256k1().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
@@ -1,7 +1,7 @@
package org.bitcoinj.secp256k1.kotlin.examples

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

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

0 comments on commit 2186156

Please sign in to comment.