diff --git a/README.adoc b/README.adoc index 9aa1785..3b6b171 100644 --- a/README.adoc +++ b/README.adoc @@ -65,7 +65,7 @@ If necessary copy updated, extracted headers into `src/main/java/org/consensusj/ (This assumes a specific hash/version of secp256k1 was installed with nixpkgs) -. `./gradlew -PjavaPath="/nix/store/j9mf1fh4wbb8c3x1zwqfs218bhml1rbw-secp256k1-0.4.0/lib/" run` +. `./gradlew -PjavaPath="/nix/store/j9mf1fh4wbb8c3x1zwqfs218bhml1rbw-secp256k1-0.4.0/lib/" secp256k1-examples-java:run` == Building with Nix diff --git a/build.gradle b/build.gradle index d1a9481..33b6932 100644 --- a/build.gradle +++ b/build.gradle @@ -1,49 +1,53 @@ -plugins { - id "application" -} +allprojects { + apply plugin: 'java' + apply plugin: 'groovy' + //apply plugin: 'test-report-aggregation' -java { - sourceCompatibility = JavaVersion.toVersion("21") - targetCompatibility = JavaVersion.toVersion("21") -} + version = secp256k1Version // set in gradle.properties + group = 'org.bitcoinj.secp256k1' -repositories { - mavenCentral() -} + repositories { + mavenCentral() + } -group = 'org.consensusj' + dependencies { + implementation 'org.bouncycastle:bcprov-jdk18on:1.77' // Bouncy & EggCC-only -dependencies { - implementation 'org.bouncycastle:bcprov-jdk18on:1.77' // Bouncy & EggCC-only + testImplementation("org.bitcoinj:bitcoinj-core:0.17-alpha3"); + testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.0" + testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.0" + } - testImplementation("org.bitcoinj:bitcoinj-core:0.17-alpha3"); - testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.0" - testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.0" -} + java { + sourceCompatibility = JavaVersion.toVersion("21") + targetCompatibility = JavaVersion.toVersion("21") + } -tasks.withType(JavaCompile).configureEach { - options.release = 21 - options.compilerArgs += ['--enable-preview'] -} + test { + useJUnitPlatform() + systemProperty "java.library.path", findProperty("javaPath") ?: "/nix/store/j9mf1fh4wbb8c3x1zwqfs218bhml1rbw-secp256k1-0.4.0/lib/" + jvmArgs += '--enable-preview' + jvmArgs += '--enable-native-access=ALL-UNNAMED' + } -tasks.withType(JavaExec) { - jvmArgs += '--enable-preview' - jvmArgs += '--enable-native-access=ALL-UNNAMED' -} + tasks.withType(JavaCompile).configureEach { + options.release = 21 + options.compilerArgs += ['--enable-preview'] + } -test { - useJUnitPlatform() - systemProperty "java.library.path", findProperty("javaPath") ?: "/nix/store/j9mf1fh4wbb8c3x1zwqfs218bhml1rbw-secp256k1-0.4.0/lib/" - jvmArgs += '--enable-preview' - jvmArgs += '--enable-native-access=ALL-UNNAMED' + tasks.withType(JavaExec) { + jvmArgs += '--enable-preview' + jvmArgs += '--enable-native-access=ALL-UNNAMED' + } } -application { -// mainClass = 'org.consensusj.secp256k1.examples.Ecdsa' - mainClass = 'org.consensusj.secp256k1.examples.Schnorr' -} +// Currently only Tests are in the root module +// TODO: Move the tests to various submodules -run { - systemProperty "java.library.path", findProperty("javaPath") ?: "" +dependencies { + implementation project(':secp256k1-api') + implementation project(':secp256k1-bouncy') + implementation project(':secp256k1-foreign') + implementation project(':secp256k1-sandbox') } diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..f05845e --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +secp256k1Version = 0.0.1 \ No newline at end of file diff --git a/secp256k1-api/build.gradle b/secp256k1-api/build.gradle new file mode 100644 index 0000000..3400ec3 --- /dev/null +++ b/secp256k1-api/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'java-library' +} + +tasks.withType(JavaCompile).configureEach { + //options.release = 9 +} + +ext.moduleName = 'org.bitcoinj.secp256k1.api' + +jar { + inputs.property("moduleName", moduleName) + manifest { + attributes 'Implementation-Title': 'Secp256k1 API', + 'Automatic-Module-Name': moduleName, + 'Implementation-Version': archiveVersion.get() + } +} diff --git a/src/main/java/org/consensusj/secp256k1/api/CompressedPubKeyData.java b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/CompressedPubKeyData.java similarity index 68% rename from src/main/java/org/consensusj/secp256k1/api/CompressedPubKeyData.java rename to secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/CompressedPubKeyData.java index c0cb4a1..e91a577 100644 --- a/src/main/java/org/consensusj/secp256k1/api/CompressedPubKeyData.java +++ b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/CompressedPubKeyData.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.api; +package org.bitcoinj.secp256k1.api; /** * diff --git a/src/main/java/org/consensusj/secp256k1/api/CompressedSignatureData.java b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/CompressedSignatureData.java similarity index 68% rename from src/main/java/org/consensusj/secp256k1/api/CompressedSignatureData.java rename to secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/CompressedSignatureData.java index b5c2fc9..d3a7adf 100644 --- a/src/main/java/org/consensusj/secp256k1/api/CompressedSignatureData.java +++ b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/CompressedSignatureData.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.api; +package org.bitcoinj.secp256k1.api; /** * diff --git a/src/main/java/org/consensusj/secp256k1/api/P256K1KeyPair.java b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256K1KeyPair.java similarity index 79% rename from src/main/java/org/consensusj/secp256k1/api/P256K1KeyPair.java rename to secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256K1KeyPair.java index e1887fd..bcd291b 100644 --- a/src/main/java/org/consensusj/secp256k1/api/P256K1KeyPair.java +++ b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256K1KeyPair.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.api; +package org.bitcoinj.secp256k1.api; /** * A single object with a private and public key diff --git a/src/main/java/org/consensusj/secp256k1/api/P256K1XOnlyPubKey.java b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256K1XOnlyPubKey.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/api/P256K1XOnlyPubKey.java rename to secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256K1XOnlyPubKey.java index c6363f7..468b448 100644 --- a/src/main/java/org/consensusj/secp256k1/api/P256K1XOnlyPubKey.java +++ b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256K1XOnlyPubKey.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.api; +package org.bitcoinj.secp256k1.api; import java.math.BigInteger; import java.util.Optional; diff --git a/src/main/java/org/consensusj/secp256k1/api/P256k1PrivKey.java b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256k1PrivKey.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/api/P256k1PrivKey.java rename to secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256k1PrivKey.java index 3c5d609..5398687 100644 --- a/src/main/java/org/consensusj/secp256k1/api/P256k1PrivKey.java +++ b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256k1PrivKey.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.api; +package org.bitcoinj.secp256k1.api; import java.math.BigInteger; import java.security.interfaces.ECPrivateKey; diff --git a/src/main/java/org/consensusj/secp256k1/api/P256k1PubKey.java b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256k1PubKey.java similarity index 98% rename from src/main/java/org/consensusj/secp256k1/api/P256k1PubKey.java rename to secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256k1PubKey.java index a6017de..cc13a4c 100644 --- a/src/main/java/org/consensusj/secp256k1/api/P256k1PubKey.java +++ b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/P256k1PubKey.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.api; +package org.bitcoinj.secp256k1.api; import java.math.BigInteger; import java.security.interfaces.ECPublicKey; diff --git a/src/main/java/org/consensusj/secp256k1/api/Secp256k1.java b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/Secp256k1.java similarity index 98% rename from src/main/java/org/consensusj/secp256k1/api/Secp256k1.java rename to secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/Secp256k1.java index 9eb9b35..13efff6 100644 --- a/src/main/java/org/consensusj/secp256k1/api/Secp256k1.java +++ b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/Secp256k1.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.api; +package org.bitcoinj.secp256k1.api; import java.math.BigInteger; import java.nio.charset.StandardCharsets; diff --git a/src/main/java/org/consensusj/secp256k1/api/SignatureData.java b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/SignatureData.java similarity index 66% rename from src/main/java/org/consensusj/secp256k1/api/SignatureData.java rename to secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/SignatureData.java index 1355f6b..7691bc7 100644 --- a/src/main/java/org/consensusj/secp256k1/api/SignatureData.java +++ b/secp256k1-api/src/main/java/org/bitcoinj/secp256k1/api/SignatureData.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.api; +package org.bitcoinj.secp256k1.api; /** * diff --git a/secp256k1-bouncy/build.gradle b/secp256k1-bouncy/build.gradle new file mode 100644 index 0000000..99b72d5 --- /dev/null +++ b/secp256k1-bouncy/build.gradle @@ -0,0 +1,22 @@ +plugins { + id 'java-library' +} + +tasks.withType(JavaCompile).configureEach { + //options.release = 9 +} + +ext.moduleName = 'org.bitcoinj.secp256k1.bouncy' + +dependencies { + api project(':secp256k1-api') +} + +jar { + inputs.property("moduleName", moduleName) + manifest { + attributes 'Implementation-Title': 'Secp256k1 Bouncy Castle Implementation', + 'Automatic-Module-Name': moduleName, + 'Implementation-Version': archiveVersion.get() + } +} diff --git a/src/main/java/org/consensusj/secp256k1/bouncy/Bouncy256k1.java b/secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/Bouncy256k1.java similarity index 88% rename from src/main/java/org/consensusj/secp256k1/bouncy/Bouncy256k1.java rename to secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/Bouncy256k1.java index 01b8f88..8c486b7 100644 --- a/src/main/java/org/consensusj/secp256k1/bouncy/Bouncy256k1.java +++ b/secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/Bouncy256k1.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.bouncy; +package org.bitcoinj.secp256k1.bouncy; import org.bouncycastle.asn1.x9.X9ECParameters; import org.bouncycastle.crypto.AsymmetricCipherKeyPair; @@ -7,20 +7,17 @@ import org.bouncycastle.crypto.params.ECDomainParameters; import org.bouncycastle.crypto.params.ECKeyGenerationParameters; import org.bouncycastle.crypto.params.ECPrivateKeyParameters; -import org.bouncycastle.math.ec.ECFieldElement; import org.bouncycastle.math.ec.ECPoint; import org.bouncycastle.math.ec.FixedPointCombMultiplier; import org.bouncycastle.math.ec.FixedPointUtil; -import org.bouncycastle.math.ec.custom.sec.SecP256K1FieldElement; -import org.bouncycastle.math.ec.custom.sec.SecP256K1Point; -import org.consensusj.secp256k1.api.P256K1KeyPair; -import org.consensusj.secp256k1.api.P256K1XOnlyPubKey; -import org.consensusj.secp256k1.api.Secp256k1; -import org.consensusj.secp256k1.api.CompressedPubKeyData; -import org.consensusj.secp256k1.api.CompressedSignatureData; -import org.consensusj.secp256k1.api.P256k1PrivKey; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.api.SignatureData; +import org.bitcoinj.secp256k1.api.P256K1KeyPair; +import org.bitcoinj.secp256k1.api.P256K1XOnlyPubKey; +import org.bitcoinj.secp256k1.api.Secp256k1; +import org.bitcoinj.secp256k1.api.CompressedPubKeyData; +import org.bitcoinj.secp256k1.api.CompressedSignatureData; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.api.SignatureData; import java.math.BigInteger; import java.security.SecureRandom; diff --git a/src/main/java/org/consensusj/secp256k1/bouncy/BouncyKeyPair.java b/secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyKeyPair.java similarity index 84% rename from src/main/java/org/consensusj/secp256k1/bouncy/BouncyKeyPair.java rename to secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyKeyPair.java index 7e04330..a3c5bd6 100644 --- a/src/main/java/org/consensusj/secp256k1/bouncy/BouncyKeyPair.java +++ b/secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyKeyPair.java @@ -1,6 +1,6 @@ -package org.consensusj.secp256k1.bouncy; +package org.bitcoinj.secp256k1.bouncy; -import org.consensusj.secp256k1.api.P256K1KeyPair; +import org.bitcoinj.secp256k1.api.P256K1KeyPair; /** * diff --git a/src/main/java/org/consensusj/secp256k1/bouncy/BouncyPrivKey.java b/secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyPrivKey.java similarity index 89% rename from src/main/java/org/consensusj/secp256k1/bouncy/BouncyPrivKey.java rename to secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyPrivKey.java index 6e34e2d..8f2fd13 100644 --- a/src/main/java/org/consensusj/secp256k1/bouncy/BouncyPrivKey.java +++ b/secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyPrivKey.java @@ -1,7 +1,7 @@ -package org.consensusj.secp256k1.bouncy; +package org.bitcoinj.secp256k1.bouncy; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; import org.bouncycastle.math.ec.custom.sec.SecP256K1FieldElement; -import org.consensusj.secp256k1.api.P256k1PrivKey; import java.math.BigInteger; import java.util.Arrays; diff --git a/src/main/java/org/consensusj/secp256k1/bouncy/BouncyPubKey.java b/secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyPubKey.java similarity index 87% rename from src/main/java/org/consensusj/secp256k1/bouncy/BouncyPubKey.java rename to secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyPubKey.java index 655ca40..5ab740b 100644 --- a/src/main/java/org/consensusj/secp256k1/bouncy/BouncyPubKey.java +++ b/secp256k1-bouncy/src/main/java/org/bitcoinj/secp256k1/bouncy/BouncyPubKey.java @@ -1,10 +1,10 @@ -package org.consensusj.secp256k1.bouncy; +package org.bitcoinj.secp256k1.bouncy; import org.bouncycastle.math.ec.ECPoint; -import org.consensusj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; -import static org.consensusj.secp256k1.bouncy.Bouncy256k1.BC_CURVE; +import static org.bitcoinj.secp256k1.bouncy.Bouncy256k1.BC_CURVE; /** * diff --git a/secp256k1-examples-java/build.gradle b/secp256k1-examples-java/build.gradle new file mode 100644 index 0000000..55d42c1 --- /dev/null +++ b/secp256k1-examples-java/build.gradle @@ -0,0 +1,34 @@ +plugins { + id 'java' + id 'application' +} + +tasks.withType(JavaCompile).configureEach { + //options.release = 22 +} + +ext.moduleName = 'org.bitcoinj.secp256k1.examples-java' + +dependencies { + implementation project(':secp256k1-api') + implementation project(':secp256k1-bouncy') + implementation project(':secp256k1-foreign') +} + +jar { + inputs.property("moduleName", moduleName) + manifest { + attributes 'Implementation-Title': 'Example secp256k1-jdk Apps', + 'Automatic-Module-Name': moduleName, + 'Implementation-Version': archiveVersion.get() + } +} + +application { +// mainClass = 'org.bitcoinj.secp256k1.examples.Ecdsa' + mainClass = 'org.bitcoinj.secp256k1.examples.Schnorr' +} + +run { + systemProperty "java.library.path", findProperty("javaPath") ?: "" +} diff --git a/src/main/java/org/consensusj/secp256k1/examples/Ecdsa.java b/secp256k1-examples-java/src/main/java/org/bitcoinj/secp256k1/examples/Ecdsa.java similarity index 87% rename from src/main/java/org/consensusj/secp256k1/examples/Ecdsa.java rename to secp256k1-examples-java/src/main/java/org/bitcoinj/secp256k1/examples/Ecdsa.java index 249e928..b7a8143 100644 --- a/src/main/java/org/consensusj/secp256k1/examples/Ecdsa.java +++ b/secp256k1-examples-java/src/main/java/org/bitcoinj/secp256k1/examples/Ecdsa.java @@ -1,20 +1,19 @@ -package org.consensusj.secp256k1.examples; +package org.bitcoinj.secp256k1.examples; -import org.consensusj.secp256k1.api.CompressedPubKeyData; -import org.consensusj.secp256k1.api.CompressedSignatureData; -import org.consensusj.secp256k1.api.P256k1PrivKey; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.api.SignatureData; -import org.consensusj.secp256k1.bouncy.BouncyPrivKey; -import org.consensusj.secp256k1.foreign.Secp256k1Foreign; +import org.bitcoinj.secp256k1.api.CompressedPubKeyData; +import org.bitcoinj.secp256k1.api.CompressedSignatureData; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.api.SignatureData; +import org.bitcoinj.secp256k1.foreign.Secp256k1Foreign; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h; -import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import java.util.HexFormat; -import static org.consensusj.secp256k1.secp256k1_h.SECP256K1_EC_COMPRESSED; +import static org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h.SECP256K1_EC_COMPRESSED; /** * Port of secp256k1 sample {@code ecdsa.c} to Java @@ -41,7 +40,7 @@ public static void main(String[] args) { P256k1PubKey pubkey = secp.ecPubKeyCreate(privKey); /* Serialize the pubkey in a compressed form(33 bytes). */ - CompressedPubKeyData compressed_pubkey = secp.ecPubKeySerialize(pubkey, SECP256K1_EC_COMPRESSED()); + CompressedPubKeyData compressed_pubkey = secp.ecPubKeySerialize(pubkey, secp256k1_h.SECP256K1_EC_COMPRESSED()); /* === Signing === */ diff --git a/src/main/java/org/consensusj/secp256k1/examples/Schnorr.java b/secp256k1-examples-java/src/main/java/org/bitcoinj/secp256k1/examples/Schnorr.java similarity index 87% rename from src/main/java/org/consensusj/secp256k1/examples/Schnorr.java rename to secp256k1-examples-java/src/main/java/org/bitcoinj/secp256k1/examples/Schnorr.java index 51c8f63..0d10d52 100644 --- a/src/main/java/org/consensusj/secp256k1/examples/Schnorr.java +++ b/secp256k1-examples-java/src/main/java/org/bitcoinj/secp256k1/examples/Schnorr.java @@ -1,11 +1,10 @@ -package org.consensusj.secp256k1.examples; - -import org.consensusj.secp256k1.api.P256K1KeyPair; -import org.consensusj.secp256k1.api.P256K1XOnlyPubKey; -import org.consensusj.secp256k1.api.P256k1PrivKey; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.bouncy.BouncyPrivKey; -import org.consensusj.secp256k1.foreign.Secp256k1Foreign; +package org.bitcoinj.secp256k1.examples; + +import org.bitcoinj.secp256k1.api.P256K1KeyPair; +import org.bitcoinj.secp256k1.api.P256K1XOnlyPubKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.bouncy.BouncyPrivKey; +import org.bitcoinj.secp256k1.foreign.Secp256k1Foreign; import java.math.BigInteger; import java.util.HexFormat; diff --git a/secp256k1-foreign/build.gradle b/secp256k1-foreign/build.gradle new file mode 100644 index 0000000..1d65945 --- /dev/null +++ b/secp256k1-foreign/build.gradle @@ -0,0 +1,22 @@ +plugins { + id 'java-library' +} + +tasks.withType(JavaCompile).configureEach { + //options.release = 22 +} + +ext.moduleName = 'org.bitcoinj.secp256k1.foreign' + +dependencies { + api project(':secp256k1-api') +} + +jar { + inputs.property("moduleName", moduleName) + manifest { + attributes 'Implementation-Title': 'Secp256k1 libsecp256k1 Foreign Function & Memory implementation', + 'Automatic-Module-Name': moduleName, + 'Implementation-Version': archiveVersion.get() + } +} diff --git a/src/main/java/org/consensusj/secp256k1/foreign/CompressedPubKeyPojo.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/CompressedPubKeyPojo.java similarity index 84% rename from src/main/java/org/consensusj/secp256k1/foreign/CompressedPubKeyPojo.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/CompressedPubKeyPojo.java index eddad71..53634b1 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/CompressedPubKeyPojo.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/CompressedPubKeyPojo.java @@ -1,6 +1,6 @@ -package org.consensusj.secp256k1.foreign; +package org.bitcoinj.secp256k1.foreign; -import org.consensusj.secp256k1.api.CompressedPubKeyData; +import org.bitcoinj.secp256k1.api.CompressedPubKeyData; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; diff --git a/src/main/java/org/consensusj/secp256k1/foreign/CompressedSignaturePojo.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/CompressedSignaturePojo.java similarity index 87% rename from src/main/java/org/consensusj/secp256k1/foreign/CompressedSignaturePojo.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/CompressedSignaturePojo.java index 5216caa..7a3710a 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/CompressedSignaturePojo.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/CompressedSignaturePojo.java @@ -1,6 +1,6 @@ -package org.consensusj.secp256k1.foreign; +package org.bitcoinj.secp256k1.foreign; -import org.consensusj.secp256k1.api.CompressedSignatureData; +import org.bitcoinj.secp256k1.api.CompressedSignatureData; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; diff --git a/src/main/java/org/consensusj/secp256k1/foreign/OpaqueKeyPair.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/OpaqueKeyPair.java similarity index 83% rename from src/main/java/org/consensusj/secp256k1/foreign/OpaqueKeyPair.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/OpaqueKeyPair.java index 23252fb..7fbd476 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/OpaqueKeyPair.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/OpaqueKeyPair.java @@ -1,10 +1,10 @@ -package org.consensusj.secp256k1.foreign; +package org.bitcoinj.secp256k1.foreign; -import org.consensusj.secp256k1.api.P256K1KeyPair; -import org.consensusj.secp256k1.api.P256k1PrivKey; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.secp256k1_h; -import org.consensusj.secp256k1.secp256k1_pubkey; +import org.bitcoinj.secp256k1.api.P256K1KeyPair; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_pubkey; import java.lang.foreign.MemorySegment; import java.security.spec.ECPoint; diff --git a/src/main/java/org/consensusj/secp256k1/foreign/PrivKeyPojo.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PrivKeyPojo.java similarity index 93% rename from src/main/java/org/consensusj/secp256k1/foreign/PrivKeyPojo.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PrivKeyPojo.java index d56d134..f186783 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/PrivKeyPojo.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PrivKeyPojo.java @@ -1,6 +1,6 @@ -package org.consensusj.secp256k1.foreign; +package org.bitcoinj.secp256k1.foreign; -import org.consensusj.secp256k1.api.P256k1PrivKey; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; diff --git a/src/main/java/org/consensusj/secp256k1/foreign/PrivKeySegment.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PrivKeySegment.java similarity index 85% rename from src/main/java/org/consensusj/secp256k1/foreign/PrivKeySegment.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PrivKeySegment.java index 2ba1219..fb5c652 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/PrivKeySegment.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PrivKeySegment.java @@ -1,6 +1,6 @@ -package org.consensusj.secp256k1.foreign; +package org.bitcoinj.secp256k1.foreign; -import org.consensusj.secp256k1.api.P256k1PrivKey; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/src/main/java/org/consensusj/secp256k1/foreign/PubKeyPojo.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PubKeyPojo.java similarity index 85% rename from src/main/java/org/consensusj/secp256k1/foreign/PubKeyPojo.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PubKeyPojo.java index 004ec18..6bcfe7f 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/PubKeyPojo.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PubKeyPojo.java @@ -1,6 +1,6 @@ -package org.consensusj.secp256k1.foreign; +package org.bitcoinj.secp256k1.foreign; -import org.consensusj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; import java.security.spec.ECPoint; diff --git a/src/main/java/org/consensusj/secp256k1/foreign/PubKeySegment.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PubKeySegment.java similarity index 81% rename from src/main/java/org/consensusj/secp256k1/foreign/PubKeySegment.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PubKeySegment.java index 4dcea93..26140fb 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/PubKeySegment.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/PubKeySegment.java @@ -1,6 +1,6 @@ -package org.consensusj.secp256k1.foreign; +package org.bitcoinj.secp256k1.foreign; -import org.consensusj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; import java.lang.foreign.MemorySegment; import java.security.spec.ECPoint; diff --git a/src/main/java/org/consensusj/secp256k1/foreign/Secp256k1Foreign.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/Secp256k1Foreign.java similarity index 93% rename from src/main/java/org/consensusj/secp256k1/foreign/Secp256k1Foreign.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/Secp256k1Foreign.java index 00e1f46..9251a48 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/Secp256k1Foreign.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/Secp256k1Foreign.java @@ -1,20 +1,19 @@ -package org.consensusj.secp256k1.foreign; - -import org.consensusj.secp256k1.api.P256K1KeyPair; -import org.consensusj.secp256k1.api.P256K1XOnlyPubKey; -import org.consensusj.secp256k1.api.Secp256k1; -import org.consensusj.secp256k1.api.CompressedPubKeyData; -import org.consensusj.secp256k1.api.CompressedSignatureData; -import org.consensusj.secp256k1.api.P256k1PrivKey; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.api.SignatureData; -import org.consensusj.secp256k1.secp256k1_ecdsa_signature; -import org.consensusj.secp256k1.secp256k1_h; -import org.consensusj.secp256k1.secp256k1_keypair; -import org.consensusj.secp256k1.secp256k1_pubkey; -import org.consensusj.secp256k1.secp256k1_xonly_pubkey; - -import java.lang.foreign.AddressLayout; +package org.bitcoinj.secp256k1.foreign; + +import org.bitcoinj.secp256k1.api.P256K1KeyPair; +import org.bitcoinj.secp256k1.api.P256K1XOnlyPubKey; +import org.bitcoinj.secp256k1.api.Secp256k1; +import org.bitcoinj.secp256k1.api.CompressedPubKeyData; +import org.bitcoinj.secp256k1.api.CompressedSignatureData; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.api.SignatureData; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_ecdsa_signature; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_keypair; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_pubkey; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_xonly_pubkey; + import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; @@ -23,11 +22,10 @@ import java.security.spec.ECPoint; import java.util.Optional; -import static java.lang.foreign.ValueLayout.ADDRESS; import static java.lang.foreign.ValueLayout.JAVA_BYTE; -import static org.consensusj.secp256k1.secp256k1_h.C_POINTER; -import static org.consensusj.secp256k1.secp256k1_h.SECP256K1_EC_UNCOMPRESSED; -import static org.consensusj.secp256k1.secp256k1_h.secp256k1_schnorrsig_sign32; +import static org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h.C_POINTER; +import static org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h.SECP256K1_EC_UNCOMPRESSED; +import static org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h.secp256k1_schnorrsig_sign32; /** * diff --git a/src/main/java/org/consensusj/secp256k1/foreign/SignaturePojo.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/SignaturePojo.java similarity index 88% rename from src/main/java/org/consensusj/secp256k1/foreign/SignaturePojo.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/SignaturePojo.java index 88bcda0..b36f426 100644 --- a/src/main/java/org/consensusj/secp256k1/foreign/SignaturePojo.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/SignaturePojo.java @@ -1,6 +1,6 @@ -package org.consensusj.secp256k1.foreign; +package org.bitcoinj.secp256k1.foreign; -import org.consensusj.secp256k1.api.SignatureData; +import org.bitcoinj.secp256k1.api.SignatureData; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; diff --git a/src/main/java/org/consensusj/secp256k1/RuntimeHelper.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/RuntimeHelper.java similarity index 99% rename from src/main/java/org/consensusj/secp256k1/RuntimeHelper.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/RuntimeHelper.java index e5e779a..6913aa0 100644 --- a/src/main/java/org/consensusj/secp256k1/RuntimeHelper.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/RuntimeHelper.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; // Generated by jextract import java.lang.foreign.Linker; diff --git a/src/main/java/org/consensusj/secp256k1/constants$0.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$0.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$0.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$0.java index 46d307e..b16fbdf 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$0.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$0.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$1.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$1.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/constants$1.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$1.java index e9d4fa1..688b55f 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$1.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$1.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$10.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$10.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$10.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$10.java index fdb5844..7be33c1 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$10.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$10.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$11.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$11.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$11.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$11.java index 51241c9..9209fb3 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$11.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$11.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$12.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$12.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$12.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$12.java index eab0f2a..fc93d88 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$12.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$12.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$13.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$13.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$13.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$13.java index 6e06f98..5e663b1 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$13.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$13.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$14.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$14.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$14.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$14.java index 9a2e0c1..ce229d5 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$14.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$14.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$2.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$2.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/constants$2.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$2.java index 9a9fabb..6e2b322 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$2.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$2.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$3.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$3.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$3.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$3.java index b63d21a..ee44703 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$3.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$3.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$4.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$4.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$4.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$4.java index a32418c..ed98145 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$4.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$4.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$5.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$5.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$5.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$5.java index 93ef366..f42d083 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$5.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$5.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$6.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$6.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/constants$6.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$6.java index c03e459..4def91e 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$6.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$6.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$7.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$7.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$7.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$7.java index 73e76fa..8accba5 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$7.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$7.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$8.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$8.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$8.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$8.java index a7ccd3a..7246fbe 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$8.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$8.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/constants$9.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$9.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/constants$9.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$9.java index 6dcb712..385445f 100644 --- a/src/main/java/org/consensusj/secp256k1/constants$9.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/constants$9.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_context.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context.java similarity index 90% rename from src/main/java/org/consensusj/secp256k1/secp256k1_context.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context.java index cdf34a1..949ec90 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_context.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_context_set_error_callback$fun.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context_set_error_callback$fun.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/secp256k1_context_set_error_callback$fun.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context_set_error_callback$fun.java index fa09abe..3d2ca76 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_context_set_error_callback$fun.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context_set_error_callback$fun.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_context_set_illegal_callback$fun.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context_set_illegal_callback$fun.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/secp256k1_context_set_illegal_callback$fun.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context_set_illegal_callback$fun.java index 663018c..8ef2d40 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_context_set_illegal_callback$fun.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_context_set_illegal_callback$fun.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_ecdsa_sign$noncefp.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_ecdsa_sign$noncefp.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/secp256k1_ecdsa_sign$noncefp.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_ecdsa_sign$noncefp.java index d1ce02b..b5407cb 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_ecdsa_sign$noncefp.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_ecdsa_sign$noncefp.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_ecdsa_signature.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_ecdsa_signature.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/secp256k1_ecdsa_signature.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_ecdsa_signature.java index 65f7f0e..a79a2c8 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_ecdsa_signature.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_ecdsa_signature.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_h.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_h.java similarity index 99% rename from src/main/java/org/consensusj/secp256k1/secp256k1_h.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_h.java index a5307ff..5541980 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_h.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_keypair.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_keypair.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/secp256k1_keypair.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_keypair.java index e5cb044..5c52cb7 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_keypair.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_keypair.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function.java index 30ffa8c..dd906b4 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_bip340.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_bip340.java similarity index 97% rename from src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_bip340.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_bip340.java index e23a1e0..8999651 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_bip340.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_bip340.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_default.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_default.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_default.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_default.java index 1ab154e..9aba527 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_default.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_default.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_hardened.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_hardened.java similarity index 97% rename from src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_hardened.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_hardened.java index 5d5824b..c49a0bb 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_hardened.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_hardened.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_rfc6979.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_rfc6979.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_rfc6979.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_rfc6979.java index e76ac6c..aee9e9e 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_nonce_function_rfc6979.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_nonce_function_rfc6979.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_pubkey.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_pubkey.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/secp256k1_pubkey.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_pubkey.java index 9765cfd..34b223b 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_pubkey.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_pubkey.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_schnorrsig_extraparams.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_schnorrsig_extraparams.java similarity index 98% rename from src/main/java/org/consensusj/secp256k1/secp256k1_schnorrsig_extraparams.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_schnorrsig_extraparams.java index a7a3667..28056df 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_schnorrsig_extraparams.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_schnorrsig_extraparams.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_scratch_space.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_scratch_space.java similarity index 90% rename from src/main/java/org/consensusj/secp256k1/secp256k1_scratch_space.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_scratch_space.java index 25bcfe6..7bd8033 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_scratch_space.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_scratch_space.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/src/main/java/org/consensusj/secp256k1/secp256k1_xonly_pubkey.java b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_xonly_pubkey.java similarity index 95% rename from src/main/java/org/consensusj/secp256k1/secp256k1_xonly_pubkey.java rename to secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_xonly_pubkey.java index 8e5e9b2..493d75a 100644 --- a/src/main/java/org/consensusj/secp256k1/secp256k1_xonly_pubkey.java +++ b/secp256k1-foreign/src/main/java/org/bitcoinj/secp256k1/foreign/jextract/secp256k1_xonly_pubkey.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.consensusj.secp256k1; +package org.bitcoinj.secp256k1.foreign.jextract; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; diff --git a/secp256k1-sandbox/build.gradle b/secp256k1-sandbox/build.gradle new file mode 100644 index 0000000..bb1d149 --- /dev/null +++ b/secp256k1-sandbox/build.gradle @@ -0,0 +1,24 @@ +plugins { + id 'java-library' +} + +tasks.withType(JavaCompile).configureEach { + //options.release = 9 +} + +ext.moduleName = 'org.bitcoinj.secp256k1.sandbox' + +dependencies { + api project(':secp256k1-api') + api project(':secp256k1-bouncy') + api project(':secp256k1-foreign') +} + +jar { + inputs.property("moduleName", moduleName) + manifest { + attributes 'Implementation-Title': 'Secp256k1 Sandbox', + 'Automatic-Module-Name': moduleName, + 'Implementation-Version': archiveVersion.get() + } +} diff --git a/src/main/java/org/consensusj/secp256k1/eggcc/EggPrivKey.java b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/EggPrivKey.java similarity index 92% rename from src/main/java/org/consensusj/secp256k1/eggcc/EggPrivKey.java rename to secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/EggPrivKey.java index 24b7c45..c5f55e6 100644 --- a/src/main/java/org/consensusj/secp256k1/eggcc/EggPrivKey.java +++ b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/EggPrivKey.java @@ -1,6 +1,7 @@ -package org.consensusj.secp256k1.eggcc; +package org.bitcoinj.secp256k1.eggcc; -import org.consensusj.secp256k1.api.P256k1PrivKey; + +import org.bitcoinj.secp256k1.api.P256k1PrivKey; import java.math.BigInteger; diff --git a/src/main/java/org/consensusj/secp256k1/eggcc/EggPubKey.java b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/EggPubKey.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/eggcc/EggPubKey.java rename to secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/EggPubKey.java index 32f1adb..70ecc04 100644 --- a/src/main/java/org/consensusj/secp256k1/eggcc/EggPubKey.java +++ b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/EggPubKey.java @@ -1,7 +1,7 @@ -package org.consensusj.secp256k1.eggcc; +package org.bitcoinj.secp256k1.eggcc; +import org.bitcoinj.secp256k1.api.P256k1PubKey; import org.bouncycastle.math.ec.ECFieldElement; -import org.consensusj.secp256k1.api.P256k1PubKey; import java.math.BigInteger; import java.security.spec.ECPoint; diff --git a/src/main/java/org/consensusj/secp256k1/eggcc/Element.java b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/Element.java similarity index 96% rename from src/main/java/org/consensusj/secp256k1/eggcc/Element.java rename to secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/Element.java index 9c3e120..8877e61 100644 --- a/src/main/java/org/consensusj/secp256k1/eggcc/Element.java +++ b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/Element.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.eggcc; +package org.bitcoinj.secp256k1.eggcc; import org.bouncycastle.math.ec.custom.sec.SecP256K1FieldElement; diff --git a/src/main/java/org/consensusj/secp256k1/eggcc/package-info.java b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/package-info.java similarity index 73% rename from src/main/java/org/consensusj/secp256k1/eggcc/package-info.java rename to secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/package-info.java index b954645..982a67b 100644 --- a/src/main/java/org/consensusj/secp256k1/eggcc/package-info.java +++ b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/eggcc/package-info.java @@ -1,4 +1,4 @@ /** * Egg-shaped curve cryptography. A simple, not-for-production-use elliptic curve implementation. */ -package org.consensusj.secp256k1.eggcc; \ No newline at end of file +package org.bitcoinj.secp256k1.eggcc; \ No newline at end of file diff --git a/src/main/java/org/consensusj/secp256k1/jca/Test.java b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/jca/Test.java similarity index 97% rename from src/main/java/org/consensusj/secp256k1/jca/Test.java rename to secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/jca/Test.java index 5e9b7fe..aff221c 100644 --- a/src/main/java/org/consensusj/secp256k1/jca/Test.java +++ b/secp256k1-sandbox/src/main/java/org/bitcoinj/secp256k1/jca/Test.java @@ -1,4 +1,4 @@ -package org.consensusj.secp256k1.jca; +package org.bitcoinj.secp256k1.jca; import java.math.BigInteger; import java.security.InvalidAlgorithmParameterException; diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..ecc233a --- /dev/null +++ b/settings.gradle @@ -0,0 +1,8 @@ +rootProject.name = 'secp256k1-jdk' + +include 'secp256k1-api' // API interface library +include 'secp256k1-bouncy' // Bouncy Castle implementation +include 'secp256k1-foreign' // Java Foreign Memory & Function ("Panama") implementation +include 'secp256k1-examples-java' // Java examples +include 'secp256k1-sandbox' // Sandbox (experimental code that may be removed) + diff --git a/src/test/java/org/consensusj/secp256k1/CurveTest.java b/src/test/java/org/consensusj/secp256k1/CurveTest.java index e7b2d29..3eff423 100644 --- a/src/test/java/org/consensusj/secp256k1/CurveTest.java +++ b/src/test/java/org/consensusj/secp256k1/CurveTest.java @@ -1,11 +1,13 @@ package org.consensusj.secp256k1; -import org.consensusj.secp256k1.api.P256k1PrivKey; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.api.Secp256k1; -import org.consensusj.secp256k1.bouncy.Bouncy256k1; -import org.consensusj.secp256k1.bouncy.BouncyPrivKey; -import org.consensusj.secp256k1.foreign.Secp256k1Foreign; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.api.Secp256k1; +import org.bitcoinj.secp256k1.bouncy.Bouncy256k1; +import org.bitcoinj.secp256k1.bouncy.BouncyPrivKey; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h; +import org.bitcoinj.secp256k1.foreign.jextract.secp256k1_pubkey; +import org.bitcoinj.secp256k1.foreign.Secp256k1Foreign; import org.junit.jupiter.api.Test; import java.lang.foreign.Arena; @@ -17,7 +19,7 @@ import java.util.Random; import static java.lang.foreign.ValueLayout.JAVA_BYTE; -import static org.consensusj.secp256k1.secp256k1_h.SECP256K1_EC_COMPRESSED; +import static org.bitcoinj.secp256k1.foreign.jextract.secp256k1_h.SECP256K1_EC_COMPRESSED; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/org/consensusj/secp256k1/api/PrivKeyDataTest.java b/src/test/java/org/consensusj/secp256k1/api/PrivKeyDataTest.java index 31bb140..e5d1827 100644 --- a/src/test/java/org/consensusj/secp256k1/api/PrivKeyDataTest.java +++ b/src/test/java/org/consensusj/secp256k1/api/PrivKeyDataTest.java @@ -1,7 +1,8 @@ package org.consensusj.secp256k1.api; -import org.consensusj.secp256k1.bouncy.BouncyPrivKey; -import org.consensusj.secp256k1.eggcc.EggPrivKey; +import org.bitcoinj.secp256k1.api.P256k1PrivKey; +import org.bitcoinj.secp256k1.bouncy.BouncyPrivKey; +import org.bitcoinj.secp256k1.eggcc.EggPrivKey; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/consensusj/secp256k1/bitcoinj/AddressTest.java b/src/test/java/org/consensusj/secp256k1/bitcoinj/AddressTest.java index e9bf1ba..9e10c42 100644 --- a/src/test/java/org/consensusj/secp256k1/bitcoinj/AddressTest.java +++ b/src/test/java/org/consensusj/secp256k1/bitcoinj/AddressTest.java @@ -5,15 +5,15 @@ import org.bitcoinj.base.Network; import org.bitcoinj.base.SegwitAddress; import org.bitcoinj.crypto.ECKey; -import org.consensusj.secp256k1.api.P256K1KeyPair; -import org.consensusj.secp256k1.api.P256K1XOnlyPubKey; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.api.Secp256k1; -import org.consensusj.secp256k1.bouncy.Bouncy256k1; -import org.consensusj.secp256k1.bouncy.BouncyPrivKey; -import org.consensusj.secp256k1.bouncy.BouncyPubKey; -import org.consensusj.secp256k1.foreign.PubKeyPojo; -import org.consensusj.secp256k1.foreign.Secp256k1Foreign; +import org.bitcoinj.secp256k1.api.P256K1KeyPair; +import org.bitcoinj.secp256k1.api.P256K1XOnlyPubKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.api.Secp256k1; +import org.bitcoinj.secp256k1.bouncy.Bouncy256k1; +import org.bitcoinj.secp256k1.bouncy.BouncyPrivKey; +import org.bitcoinj.secp256k1.bouncy.BouncyPubKey; +import org.bitcoinj.secp256k1.foreign.PubKeyPojo; +import org.bitcoinj.secp256k1.foreign.Secp256k1Foreign; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/consensusj/secp256k1/bouncy/Bouncy256k1Test.java b/src/test/java/org/consensusj/secp256k1/bouncy/Bouncy256k1Test.java index f8776ea..62a5bfe 100644 --- a/src/test/java/org/consensusj/secp256k1/bouncy/Bouncy256k1Test.java +++ b/src/test/java/org/consensusj/secp256k1/bouncy/Bouncy256k1Test.java @@ -1,13 +1,12 @@ package org.consensusj.secp256k1.bouncy; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.api.Secp256k1; -import org.consensusj.secp256k1.foreign.Secp256k1Foreign; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.bouncy.Bouncy256k1; +import org.bitcoinj.secp256k1.bouncy.BouncyPrivKey; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import java.math.BigInteger; -import java.security.spec.ECPoint; /** * diff --git a/src/test/java/org/consensusj/secp256k1/foreign/Secp256k1ForeignTest.java b/src/test/java/org/consensusj/secp256k1/foreign/Secp256k1ForeignTest.java index 7c982ca..c6e4fa9 100644 --- a/src/test/java/org/consensusj/secp256k1/foreign/Secp256k1ForeignTest.java +++ b/src/test/java/org/consensusj/secp256k1/foreign/Secp256k1ForeignTest.java @@ -1,9 +1,8 @@ package org.consensusj.secp256k1.foreign; -import org.consensusj.secp256k1.api.P256k1PrivKey; -import org.consensusj.secp256k1.api.P256k1PubKey; -import org.consensusj.secp256k1.api.Secp256k1; -import org.consensusj.secp256k1.bouncy.BouncyPrivKey; +import org.bitcoinj.secp256k1.api.P256k1PubKey; +import org.bitcoinj.secp256k1.bouncy.BouncyPrivKey; +import org.bitcoinj.secp256k1.foreign.Secp256k1Foreign; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test;