diff --git a/doc/musig-spec.mediawiki b/doc/musig-spec.mediawiki index 0022868f..ef7224d2 100644 --- a/doc/musig-spec.mediawiki +++ b/doc/musig-spec.mediawiki @@ -214,13 +214,13 @@ Input: * Let ''pk2 = GetSecondKey(pk1..u)'' * For ''i = 1 .. u'': ** Let ''Pi = point(pki)''; fail if that fails. -** Let ''ai = KeyAggCoeff'(pk1..u, pki, pk2)''. +** Let ''ai = KeyAggCoeffInternal(pk1..u, pki, pk2)''. * Let ''Q0 = a1⋅P1 + a2⋅P1 + ... + au⋅Pu'' * Fail if ''is_infinite(Q0)''. * Let ''tacc0 = 0'' * Let ''gacc0 = 1'' * For ''i = 1 .. v'': -** Let ''(Qi, gacci, tacci) = Tweak(Qi-1, gacci-1, tweaki, tacci-1, is_xonly_ti)''; fail if that fails +** Let ''(Qi, gacci, tacci) = ApplyTweak(Qi-1, gacci-1, tacci-1, tweaki, is_xonly_ti)''; fail if that fails * Return ''(Qv, gaccv, taccv)''. '''''HashKeys(pk1..u)''''': @@ -234,15 +234,15 @@ Input: '''''KeyAggCoeff(pk1..u, pk')''''': * Let ''pk2 = GetSecondKey(pk1..u)'': -* Return ''KeyAggCoeff'(pk1..u, pk', pk2)'' +* Return ''KeyAggCoeffInternal(pk1..u, pk', pk2)'' -'''''KeyAggCoeff'(pk1..u, pk', pk2)''''': +'''''KeyAggCoeffInternal(pk1..u, pk', pk2)''''': * Let ''L = HashKeys(pk1..u)'' * If ''pk' = pk2'': ** Return 1 * Return ''int(hashKeyAgg coefficient(L || pk')) mod n''The key aggregation coefficient is computed by hashing the public key instead of its index, which requires one more invocation of the SHA-256 compression function. However, it results in significantly simpler implementations because signers do not need to translate between public key indices before and after sorting. -'''''Tweak(Qi-1, gacci-1, tweaki, tacci-1, is_xonly_ti)''''': +'''''ApplyTweak(Qi-1, gacci-1, tacci-1, tweaki, is_xonly_ti)''''': * If ''is_xonly_ti'' and ''not has_even_y(Qi-1)'': ** Let ''gi-1 = -1 mod n'' * Else: let ''gi-1 = 1'' @@ -333,7 +333,7 @@ Input: * Let ''a = GetSessionKeyAggCoeff(session_ctx, P)''; fail if that fails * Let ''gp = 1'' if ''has_even_y(P)'', otherwise let ''gp = -1 mod n'' * Let ''gv = 1'' if ''has_even_y(Q)'', otherwise let ''gv = -1 mod n'' -*
Let ''d = gv⋅gaccv⋅gp⋅d' '' (See [[negation-of-the-secret-key-when-signing|Negation Of The Secret Key When Signing]]) +* Let ''d = gv⋅gaccv⋅gp⋅d' mod n'' (See [[negation-of-the-secret-key-when-signing|Negation Of The Secret Key When Signing]]) * Let ''s = (k1 + b⋅k2 + e⋅a⋅d) mod n'' * Let ''psig = bytes(s)'' * Let ''pubnonce = cbytes(k'1⋅G) || cbytes(k'2⋅G)'' @@ -402,10 +402,10 @@ Input: * ''P'': a point * The tweak ''t'': an integer with ''0 ≤ t < n '' -'''''OrdinaryTweak(P, t)''''': +'''''ApplyOrdinaryTweak(P, t)''''': * Return ''P + t⋅G'' -'''''XonlyTweak(P, t)''''': +'''''ApplyXonlyTweak(P, t)''''': * Return ''with_even_y(P) + t⋅G'' === Negation Of The Secret Key When Signing ===