Skip to content

Commit 01d2c6f

Browse files
committed
Use secp256k1 0.7.0
Most significant change is that deprecated secp256k1_ec_privkey_<operation> methods have been removed, we now use secp256k1_ec_seckey_<operation>. Our own API does not change.
1 parent a07bc39 commit 01d2c6f

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ buildscript {
2323

2424
allprojects {
2525
group = "fr.acinq.secp256k1"
26-
version = "0.18.0"
26+
version = "0.19.0-SNAPSHOT"
2727

2828
repositories {
2929
google()

jni/c/headers/java/fr_acinq_secp256k1_Secp256k1CFunctions.h

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jni/c/src/fr_acinq_secp256k1_Secp256k1CFunctions.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,10 @@ JNIEXPORT jint JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1ec
316316

317317
/*
318318
* Class: fr_acinq_bitcoin_Secp256k1Bindings
319-
* Method: secp256k1_ec_privkey_negate
319+
* Method: secp256k1_ec_seckey_negate
320320
* Signature: (J[B)[B
321321
*/
322-
JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1ec_1privkey_1negate(JNIEnv *penv, jclass clazz, jlong jctx, jbyteArray jseckey)
322+
JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1ec_1seckey_1negate(JNIEnv *penv, jclass clazz, jlong jctx, jbyteArray jseckey)
323323
{
324324
secp256k1_context *ctx = (secp256k1_context *)jctx;
325325
jbyte *seckey;
@@ -376,10 +376,10 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
376376

377377
/*
378378
* Class: fr_acinq_bitcoin_Secp256k1Bindings
379-
* Method: secp256k1_ec_privkey_tweak_add
379+
* Method: secp256k1_ec_seckey_tweak_add
380380
* Signature: (J[B[B)[B
381381
*/
382-
JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1ec_1privkey_1tweak_1add(JNIEnv *penv, jclass clazz, jlong jctx, jbyteArray jseckey, jbyteArray jtweak)
382+
JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1ec_1seckey_1tweak_1add(JNIEnv *penv, jclass clazz, jlong jctx, jbyteArray jseckey, jbyteArray jtweak)
383383
{
384384
secp256k1_context *ctx = (secp256k1_context *)jctx;
385385
jbyte *seckey, *tweak;
@@ -448,10 +448,10 @@ JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256
448448

449449
/*
450450
* Class: fr_acinq_bitcoin_Secp256k1Bindings
451-
* Method: secp256k1_ec_privkey_tweak_mul
451+
* Method: secp256k1_ec_seckey_tweak_mul
452452
* Signature: (J[B[B)[B
453453
*/
454-
JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1ec_1privkey_1tweak_1mul(JNIEnv *penv, jclass clazz, jlong jctx, jbyteArray jseckey, jbyteArray jtweak)
454+
JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1ec_1seckey_1tweak_1mul(JNIEnv *penv, jclass clazz, jlong jctx, jbyteArray jseckey, jbyteArray jtweak)
455455
{
456456
secp256k1_context *ctx = (secp256k1_context *)jctx;
457457
jbyte *seckey, *tweak;

jni/src/main/java/fr/acinq/secp256k1/Secp256k1CFunctions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public class Secp256k1CFunctions {
6565

6666
public static native int secp256k1_ecdsa_signature_normalize(long ctx, byte[] sigin, byte[] sigout);
6767

68-
public static native byte[] secp256k1_ec_privkey_negate(long ctx, byte[] privkey);
68+
public static native byte[] secp256k1_ec_seckey_negate(long ctx, byte[] privkey);
6969

7070
public static native byte[] secp256k1_ec_pubkey_negate(long ctx, byte[] pubkey);
7171

72-
public static native byte[] secp256k1_ec_privkey_tweak_add(long ctx, byte[] seckey, byte[] tweak);
72+
public static native byte[] secp256k1_ec_seckey_tweak_add(long ctx, byte[] seckey, byte[] tweak);
7373

7474
public static native byte[] secp256k1_ec_pubkey_tweak_add(long ctx, byte[] pubkey, byte[] tweak);
7575

76-
public static native byte[] secp256k1_ec_privkey_tweak_mul(long ctx, byte[] seckey, byte[] tweak);
76+
public static native byte[] secp256k1_ec_seckey_tweak_mul(long ctx, byte[] seckey, byte[] tweak);
7777

7878
public static native byte[] secp256k1_ec_pubkey_tweak_mul(long ctx, byte[] pubkey, byte[] tweak);
7979

jni/src/main/kotlin/fr/acinq/secp256k1/NativeSecp256k1.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public object NativeSecp256k1 : Secp256k1 {
4545
}
4646

4747
override fun privKeyNegate(privkey: ByteArray): ByteArray {
48-
return Secp256k1CFunctions.secp256k1_ec_privkey_negate(Secp256k1Context.getContext(), privkey)
48+
return Secp256k1CFunctions.secp256k1_ec_seckey_negate(Secp256k1Context.getContext(), privkey)
4949
}
5050

5151
override fun privKeyTweakAdd(privkey: ByteArray, tweak: ByteArray): ByteArray {
52-
return Secp256k1CFunctions.secp256k1_ec_privkey_tweak_add(Secp256k1Context.getContext(), privkey, tweak)
52+
return Secp256k1CFunctions.secp256k1_ec_seckey_tweak_add(Secp256k1Context.getContext(), privkey, tweak)
5353
}
5454

5555
override fun privKeyTweakMul(privkey: ByteArray, tweak: ByteArray): ByteArray {
56-
return Secp256k1CFunctions.secp256k1_ec_privkey_tweak_mul(Secp256k1Context.getContext(), privkey, tweak)
56+
return Secp256k1CFunctions.secp256k1_ec_seckey_tweak_mul(Secp256k1Context.getContext(), privkey, tweak)
5757
}
5858

5959
override fun pubKeyNegate(pubkey: ByteArray): ByteArray {

native/secp256k1

src/nativeMain/kotlin/fr/acinq/secp256k1/Secp256k1Native.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public object Secp256k1Native : Secp256k1 {
175175
val multiplied = privkey.copyOf()
176176
val natMul = toNat(multiplied)
177177
val natTweak = toNat(tweak)
178-
secp256k1_ec_privkey_tweak_mul(ctx, natMul, natTweak).requireSuccess("secp256k1_ec_privkey_tweak_mul() failed")
178+
secp256k1_ec_seckey_tweak_mul(ctx, natMul, natTweak).requireSuccess("secp256k1_ec_seckey_tweak_mul() failed")
179179
return multiplied
180180
}
181181
}

0 commit comments

Comments
 (0)