Merge branch 'review-fixes'

This commit is contained in:
Kgothatso Ngako
2026-09-04 02:56:23 +02:00
11 changed files with 406 additions and 13 deletions

View File

@@ -520,6 +520,25 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_sign(
* through NonceAgg as a pubnonce contribution, and a pubnonce's components
* are never the point at infinity); if it does, this function fails.
*
* WARNING: the derivation above is the whole of what the nonce depends on. It
* does NOT commit to the pubshares, to the untweaked threshold public key, or
* to which tweaks the cache accumulated -- only to the x-only encoding of the
* _tweaked_ threshold public key (this is BIP 445's det_nonce_hash, not a
* deviation). Two tweak caches can therefore agree on that x-only key and
* still disagree on the sign g*gacc that multiplies the secret share, because
* Q and -Q have the same x-coordinate: a cache initialized from the threshold
* public key and one initialized from its negation are the simplest example.
* Two calls that differ only in that way emit the SAME pubnonce and two
* partial signatures that differ only in the sign of the secret-share term,
* which is two equations in the nonce and the secret share -- the secret
* share falls out of the pair.
*
* The caller must therefore treat the tweak cache and the pubshares as fixed
* key material belonging to the group, established once at key generation,
* and never as per-session parameters accepted from a coordinator or any
* other peer. Given that, repeating a call reproduces a byte-identical result
* and is harmless, which is the point of a deterministic nonce.
*
* Returns: 0 if the arguments are invalid or signing fails, 1 otherwise
* Args: ctx: pointer to a context object
* Out: partial_sig: pointer to a partial_sig object