Fix comments on secp256k1_frost_partial_sig_agg

This commit is contained in:
kngako 2024-08-07 03:09:20 +02:00
parent 86d7d9835f
commit 5c4186770f
3 changed files with 18 additions and 7 deletions

View File

@ -357,11 +357,11 @@ JNIEXPORT jint JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1fr
/* /*
* Class: fr_acinq_secp256k1_Secp256k1CFunctions * Class: fr_acinq_secp256k1_Secp256k1CFunctions
* Method: secp256k1_frost_partial_sig_aggregate * Method: secp256k1_frost_partial_sig_agg
* Signature: (J[B[[B)[B * Signature: (J[B[[BI)[B
*/ */
JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1frost_1partial_1sig_1aggregate JNIEXPORT jbyteArray JNICALL Java_fr_acinq_secp256k1_Secp256k1CFunctions_secp256k1_1frost_1partial_1sig_1agg
(JNIEnv *, jclass, jlong, jbyteArray, jobjectArray); (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -383,6 +383,16 @@ public class Secp256k1CFunctions {
*/ */
public static native int secp256k1_frost_partial_sig_verify(long ctx, byte[] partialSig, byte[] publicNonce, byte[] publicShare, byte[] session, byte[] tweakCache); public static native int secp256k1_frost_partial_sig_verify(long ctx, byte[] partialSig, byte[] publicNonce, byte[] publicShare, byte[] session, byte[] tweakCache);
public static native byte[] secp256k1_frost_partial_sig_aggregate(long ctx, byte[] session, byte[][] partialSignatures); /**
* Aggregates partial signatures
*
* @param ctx pointer to a context object (not secp256k1_context_static)
* @param session pointer to the session that was created with frost_nonce_process
* @param partialSignatures array of pointers to partial signatures to aggregate
* @param n_sigs number of elements in the partial_sigs array. Must be greater than 0.
*
* @return sig64: complete (but possibly invalid) Schnorr signature
*/
public static native byte[] secp256k1_frost_partial_sig_agg(long ctx, byte[] session, byte[][] partialSignatures, int n_sigs);
} }

View File

@ -305,10 +305,11 @@ public object NativeSecp256k1 : Secp256k1 {
} }
override fun frostPartialSignatureAggregate(session: ByteArray, partialSignatures: Array<ByteArray>): ByteArray { override fun frostPartialSignatureAggregate(session: ByteArray, partialSignatures: Array<ByteArray>): ByteArray {
return Secp256k1CFunctions.secp256k1_frost_partial_sig_aggregate( return Secp256k1CFunctions.secp256k1_frost_partial_sig_agg(
Secp256k1Context.getContext(), Secp256k1Context.getContext(),
session, session,
partialSignatures partialSignatures,
partialSignatures.size
) )
} }