File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ fn main() {
19
19
let mut pubkeys_ref: Vec < & PublicKey > = pubkeys. iter ( ) . collect ( ) ;
20
20
let pubkeys_ref = pubkeys_ref. as_mut_slice ( ) ;
21
21
22
- secp. musig_sort_pubkeys ( pubkeys_ref) ;
22
+ secp. sort_pubkeys ( pubkeys_ref) ;
23
23
24
24
let mut musig_key_agg_cache = KeyAggCache :: new ( & secp, pubkeys_ref) ;
25
25
Original file line number Diff line number Diff line change @@ -1620,6 +1620,8 @@ impl<'de> serde::Deserialize<'de> for XOnlyPublicKey {
1620
1620
impl < C : Verification > Secp256k1 < C > {
1621
1621
/// Sort public keys using lexicographic (of compressed serialization) order.
1622
1622
///
1623
+ /// This is the canonical way to sort public keys for use with Musig2.
1624
+ ///
1623
1625
/// Example:
1624
1626
///
1625
1627
/// ```rust
@@ -1636,10 +1638,10 @@ impl<C: Verification> Secp256k1<C> {
1636
1638
/// # let mut pubkeys_ref: Vec<&PublicKey> = pubkeys.iter().collect();
1637
1639
/// # let pubkeys_ref = pubkeys_ref.as_mut_slice();
1638
1640
/// #
1639
- /// # secp.musig_sort_pubkeys (pubkeys_ref);
1641
+ /// # secp.sort_pubkeys (pubkeys_ref);
1640
1642
/// # }
1641
1643
/// ```
1642
- pub fn musig_sort_pubkeys ( & self , pubkeys : & mut [ & PublicKey ] ) {
1644
+ pub fn sort_pubkeys ( & self , pubkeys : & mut [ & PublicKey ] ) {
1643
1645
let cx = self . ctx ( ) . as_ptr ( ) ;
1644
1646
unsafe {
1645
1647
let mut pubkeys_ref = core:: slice:: from_raw_parts (
Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ impl KeyAggCache {
281
281
/// ensures the same resulting `agg_pk` for the same multiset of pubkeys.
282
282
/// This is useful to do before aggregating pubkeys, such that the order of pubkeys
283
283
/// does not affect the combined public key.
284
+ /// To do this, call [`Secp256k1::sort_pubkeys`].
284
285
///
285
286
/// # Returns
286
287
///
You can’t perform that action at this time.
0 commit comments