From 0f7f0692ca1e60231cd7ba65aa3606c8da33afca Mon Sep 17 00:00:00 2001 From: Fabian Jahr Date: Thu, 16 Oct 2025 00:37:22 +0200 Subject: [PATCH] musig: Move MUSIG_CHAINCODE to musig.cpp This is the only place where it is used. --- src/musig.cpp | 7 +++++++ src/musig.h | 9 --------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/musig.cpp b/src/musig.cpp index 686ec5e869a..706874be2cf 100644 --- a/src/musig.cpp +++ b/src/musig.cpp @@ -7,6 +7,13 @@ #include +//! MuSig2 chaincode as defined by BIP 328 +using namespace util::hex_literals; +constexpr uint256 MUSIG_CHAINCODE{ + // Use immediate lambda to work around GCC-14 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117966 + []() consteval { return uint256{"868087ca02a6f974c4598924c36b57762d32cb45717167e300622c7167e38965"_hex_u8}; }(), +}; + static bool GetMuSig2KeyAggCache(const std::vector& pubkeys, secp256k1_musig_keyagg_cache& keyagg_cache) { // Parse the pubkeys diff --git a/src/musig.h b/src/musig.h index 10234568087..f518ae81ba2 100644 --- a/src/musig.h +++ b/src/musig.h @@ -14,15 +14,6 @@ struct secp256k1_musig_keyagg_cache; class MuSig2SecNonceImpl; struct secp256k1_musig_secnonce; -//! MuSig2 chaincode as defined by BIP 328 -using namespace util::hex_literals; -constexpr uint256 MUSIG_CHAINCODE{ - // Use immediate lambda to work around GCC-14 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117966 - []() consteval { return uint256{"868087ca02a6f974c4598924c36b57762d32cb45717167e300622c7167e38965"_hex_u8}; }(), -}; - - - constexpr size_t MUSIG2_PUBNONCE_SIZE{66}; //! Compute the full aggregate pubkey from the given participant pubkeys in their current order.