Add compact2der() method

This commit is contained in:
sstone
2020-07-02 21:39:33 +02:00
parent 244673b04c
commit 08d1692932
7 changed files with 73 additions and 0 deletions

View File

@@ -64,4 +64,6 @@ public class Secp256k1CFunctions {
public static native byte[] secp256k1_ecdh(long ctx, byte[] seckey, byte[] pubkey);
public static native byte[] secp256k1_ecdsa_recover(long ctx, byte[] sig, byte[] msg32, int recid);
public static native byte[] secp256k1_compact_to_der(long ctx, byte[] sig);
}

View File

@@ -83,4 +83,8 @@ public object NativeSecp256k1 : Secp256k1 {
override fun ecdsaRecover(sig: ByteArray, message: ByteArray, recid: Int): ByteArray {
return Secp256k1CFunctions.secp256k1_ecdsa_recover(Secp256k1Context.getContext(), sig, message, recid)
}
override fun compact2der(sig: ByteArray): ByteArray {
return Secp256k1CFunctions.secp256k1_compact_to_der(Secp256k1Context.getContext(), sig)
}
}