@@ -211,6 +211,7 @@ SECP256K1_API int secp256k1_frost_share_parse(
211211 * n_participants: the total number of participants
212212 * ids33: array of 33-byte participant IDs
213213 */
214+ /* TODO: rename this */
214215SECP256K1_API int secp256k1_frost_shares_gen (
215216 const secp256k1_context * ctx ,
216217 secp256k1_frost_share * shares ,
@@ -252,14 +253,13 @@ SECP256K1_API int secp256k1_frost_shares_gen(
252253SECP256K1_API int secp256k1_frost_share_agg (
253254 const secp256k1_context * ctx ,
254255 secp256k1_frost_share * agg_share ,
255- secp256k1_xonly_pubkey * agg_pk ,
256256 const secp256k1_frost_share * const * shares ,
257257 const secp256k1_pubkey * const * vss_commitments ,
258258 const unsigned char * const * pok64s ,
259259 size_t n_shares ,
260260 size_t threshold ,
261261 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 );
263263
264264/** Verifies a share received during a key generation session
265265 *
@@ -306,37 +306,18 @@ SECP256K1_API int secp256k1_frost_compute_pubshare(
306306 size_t n_participants
307307) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 );
308308
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 (
322310 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 );
326316
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 (
337318 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
340321) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 );
341322
342323/** 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(
490471 * n_pubnonces: number of elements in the pubnonces array. Must be
491472 * greater than 0.
492473 * msg32: the 32-byte message to sign
493- * agg_pk: the FROST-aggregated public key
494474 * myd_id33: the 33-byte ID of the participant who will use the
495475 * session for signing
496476 * 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
498478 * adaptor: optional pointer to an adaptor point encoded as a
499479 * public key if this signing session is part of an
500480 * adaptor signature protocol (can be NULL)
501481 */
482+ /* TODO(@jesseposner): const unsigned char * const *ids33 */
502483SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_nonce_process (
503484 const secp256k1_context * ctx ,
504485 secp256k1_frost_session * session ,
505486 const secp256k1_frost_pubnonce * const * pubnonces ,
506487 size_t n_pubnonces ,
507488 const unsigned char * msg32 ,
508- const secp256k1_xonly_pubkey * agg_pk ,
509489 const unsigned char * my_id33 ,
510490 const unsigned char * const * ids33 ,
511491 const secp256k1_frost_tweak_cache * tweak_cache ,
@@ -529,7 +509,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_nonce_process(
529509 * In: agg_share: the aggregated share
530510 * session: pointer to the session that was created with
531511 * frost_nonce_process
532- * tweak_cache: pointer to frost_tweak_cache struct (can be NULL)
512+ * tweak_cache: pointer to frost_tweak_cache struct
533513 */
534514SECP256K1_API int secp256k1_frost_partial_sign (
535515 const secp256k1_context * ctx ,
@@ -538,7 +518,7 @@ SECP256K1_API int secp256k1_frost_partial_sign(
538518 const secp256k1_frost_share * agg_share ,
539519 const secp256k1_frost_session * session ,
540520 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 ) ;
542522
543523/** Verifies an individual signer's partial signature
544524 *
@@ -565,7 +545,7 @@ SECP256K1_API int secp256k1_frost_partial_sign(
565545 * `secp256k1_frost_compute_pubshare`
566546 * session: pointer to the session that was created with
567547 * `frost_nonce_process`
568- * tweak_cache: pointer to frost_tweak_cache struct (can be NULL)
548+ * tweak_cache: pointer to frost_tweak_cache struct
569549 */
570550SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_partial_sig_verify (
571551 const secp256k1_context * ctx ,
@@ -574,7 +554,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_partial_sig_verif
574554 const secp256k1_pubkey * pubshare ,
575555 const secp256k1_frost_session * session ,
576556 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 ) ;
578558
579559/** Aggregates partial signatures
580560 *
0 commit comments