@@ -211,6 +211,7 @@ SECP256K1_API int secp256k1_frost_share_parse(
211
211
* n_participants: the total number of participants
212
212
* ids33: array of 33-byte participant IDs
213
213
*/
214
+ /* TODO: rename this */
214
215
SECP256K1_API int secp256k1_frost_shares_gen (
215
216
const secp256k1_context * ctx ,
216
217
secp256k1_frost_share * shares ,
@@ -252,14 +253,13 @@ SECP256K1_API int secp256k1_frost_shares_gen(
252
253
SECP256K1_API int secp256k1_frost_share_agg (
253
254
const secp256k1_context * ctx ,
254
255
secp256k1_frost_share * agg_share ,
255
- secp256k1_xonly_pubkey * agg_pk ,
256
256
const secp256k1_frost_share * const * shares ,
257
257
const secp256k1_pubkey * const * vss_commitments ,
258
258
const unsigned char * const * pok64s ,
259
259
size_t n_shares ,
260
260
size_t threshold ,
261
261
const unsigned char * id33
262
- ) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 ) SECP256K1_ARG_NONNULL (6 ) SECP256K1_ARG_NONNULL ( 9 );
262
+ ) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 ) SECP256K1_ARG_NONNULL (8 );
263
263
264
264
/** Verifies a share received during a key generation session
265
265
*
@@ -306,37 +306,18 @@ SECP256K1_API int secp256k1_frost_compute_pubshare(
306
306
size_t n_participants
307
307
) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 );
308
308
309
- /** Obtain the aggregate public key from a FROST x-only aggregate public key.
310
- *
311
- * This is only useful if you need the non-xonly public key, in particular for
312
- * ordinary (non-xonly) tweaking or batch-verifying multiple key aggregations
313
- * (not implemented).
314
- *
315
- * Returns: 0 if the arguments are invalid, 1 otherwise
316
- * Args: ctx: pointer to a context object
317
- * Out: ec_agg_pk: the FROST-aggregated public key.
318
- * In: xonly_agg_pk: the aggregated x-only public key that is the output of
319
- * `secp256k1_frost_share_agg`
320
- */
321
- SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_pubkey_get (
309
+ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_pubkey_gen (
322
310
const secp256k1_context * ctx ,
323
- secp256k1_pubkey * ec_agg_pk ,
324
- const secp256k1_xonly_pubkey * xonly_agg_pk
325
- ) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 );
311
+ secp256k1_frost_tweak_cache * cache ,
312
+ const secp256k1_pubkey * const * pubshares ,
313
+ size_t n_pubshares ,
314
+ const unsigned char * const * ids33
315
+ ) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (5 );
326
316
327
- /** Initializes a tweak cache used for applying tweaks to a FROST key
328
- *
329
- * Returns: 0 if the arguments are invalid, 1 otherwise
330
- * Args: ctx: pointer to a context object
331
- * Out: tweak_cache: pointer to a frost_tweak_cache struct that is required
332
- * for key tweaking
333
- * In: agg_pk: the aggregated x-only public key that is the output of
334
- * `secp256k1_frost_share_agg`
335
- */
336
- SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_pubkey_tweak (
317
+ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_pubkey_get (
337
318
const secp256k1_context * ctx ,
338
- secp256k1_frost_tweak_cache * tweak_cache ,
339
- const secp256k1_xonly_pubkey * agg_pk
319
+ secp256k1_pubkey * pk ,
320
+ const secp256k1_frost_tweak_cache * cache
340
321
) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 );
341
322
342
323
/** Apply ordinary "EC" tweaking to a public key in a given tweak_cache by
@@ -490,22 +471,21 @@ SECP256K1_API int secp256k1_frost_nonce_gen(
490
471
* n_pubnonces: number of elements in the pubnonces array. Must be
491
472
* greater than 0.
492
473
* msg32: the 32-byte message to sign
493
- * agg_pk: the FROST-aggregated public key
494
474
* myd_id33: the 33-byte ID of the participant who will use the
495
475
* session for signing
496
476
* ids33: array of the 33-byte participant IDs of the signers
497
- * tweak_cache: pointer to frost_tweak_cache struct (can be NULL)
477
+ * tweak_cache: pointer to frost_tweak_cache struct
498
478
* adaptor: optional pointer to an adaptor point encoded as a
499
479
* public key if this signing session is part of an
500
480
* adaptor signature protocol (can be NULL)
501
481
*/
482
+ /* TODO(@jesseposner): const unsigned char * const *ids33 */
502
483
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_nonce_process (
503
484
const secp256k1_context * ctx ,
504
485
secp256k1_frost_session * session ,
505
486
const secp256k1_frost_pubnonce * const * pubnonces ,
506
487
size_t n_pubnonces ,
507
488
const unsigned char * msg32 ,
508
- const secp256k1_xonly_pubkey * agg_pk ,
509
489
const unsigned char * my_id33 ,
510
490
const unsigned char * const * ids33 ,
511
491
const secp256k1_frost_tweak_cache * tweak_cache ,
@@ -529,7 +509,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_nonce_process(
529
509
* In: agg_share: the aggregated share
530
510
* session: pointer to the session that was created with
531
511
* frost_nonce_process
532
- * tweak_cache: pointer to frost_tweak_cache struct (can be NULL)
512
+ * tweak_cache: pointer to frost_tweak_cache struct
533
513
*/
534
514
SECP256K1_API int secp256k1_frost_partial_sign (
535
515
const secp256k1_context * ctx ,
@@ -538,7 +518,7 @@ SECP256K1_API int secp256k1_frost_partial_sign(
538
518
const secp256k1_frost_share * agg_share ,
539
519
const secp256k1_frost_session * session ,
540
520
const secp256k1_frost_tweak_cache * tweak_cache
541
- ) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 );
521
+ ) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 ) SECP256K1_ARG_NONNULL ( 6 ) ;
542
522
543
523
/** Verifies an individual signer's partial signature
544
524
*
@@ -565,7 +545,7 @@ SECP256K1_API int secp256k1_frost_partial_sign(
565
545
* `secp256k1_frost_compute_pubshare`
566
546
* session: pointer to the session that was created with
567
547
* `frost_nonce_process`
568
- * tweak_cache: pointer to frost_tweak_cache struct (can be NULL)
548
+ * tweak_cache: pointer to frost_tweak_cache struct
569
549
*/
570
550
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_partial_sig_verify (
571
551
const secp256k1_context * ctx ,
@@ -574,7 +554,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_partial_sig_verif
574
554
const secp256k1_pubkey * pubshare ,
575
555
const secp256k1_frost_session * session ,
576
556
const secp256k1_frost_tweak_cache * tweak_cache
577
- ) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 );
557
+ ) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 ) SECP256K1_ARG_NONNULL ( 6 ) ;
578
558
579
559
/** Aggregates partial signatures
580
560
*
0 commit comments