Skip to content

Commit 623f3cb

Browse files
committed
fixup! robot-dreams comments
1 parent f497863 commit 623f3cb

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

doc/musig-spec.mediawiki

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,16 @@ Input:
7878
* The public keys ''pk<sub>1..u</sub>'': ''u'' 32-byte arrays
7979
8080
The algorithm ''KeyAgg(pk<sub>1..u</sub>)'' is defined as:
81+
* Let ''Q = KeyAggInternal(pk<sub>1..u</sub>)''; fail if that fails.
82+
* Return ''bytes(Q)''.
83+
84+
The algorithm ''KeyAggInternal(pk<sub>1..u</sub>)'' is defined as:
8185
* For ''i = 1 .. u'':
8286
** Let ''a<sub>i</sub> = KeyAggCoeff(pk<sub>1..u</sub>, pk<sub>i</sub>)''.
8387
** Let ''P<sub>i</sub> = point(pk<sub>i</sub>)''; fail if that fails.
8488
* Let ''Q = a<sub>1</sub>⋅P<sub>1</sub> + a<sub>2</sub>⋅P<sub>1</sub> + ... + a<sub>u</sub>⋅P<sub>u</sub>''
8589
* Fail if ''is_infinite(Q)''.
86-
* Return ''bytes(Q)''.
90+
* Return ''Q''.
8791
8892
The algorithm ''HashKeys(pk<sub>1..u</sub>)'' is defined as:
8993
* Return ''hash<sub>KeyAgg list</sub>(pk<sub>1</sub> || pk<sub>2</sub> || ... || pk<sub>u</sub>)''
@@ -147,7 +151,7 @@ Input:
147151
148152
The algorithm ''Sign(secnonce, sk, aggnonce, pk<sub>1..u</sub>, m)'' is defined as:
149153
* Let ''R<sub>1</sub> = pointc(aggnonce[0:33]), R<sub>2</sub> = pointc(aggnonce[33:66])''; fail if that fails
150-
* Let ''Q = point(KeyAgg(pk<sub>1..u</sub>))''; fail if that fails
154+
* Let ''Q = KeyAggInternal(pk<sub>1..u</sub>)''; fail if that fails
151155
* Let ''b = int(hash<sub>MuSig/noncecoef</sub>(aggnonce || bytes(Q) || m)) mod n''
152156
* Let ''R = R<sub>1</sub> + b⋅R<sub>2</sub>''
153157
* Fail if ''is_infinite(R)''
@@ -162,7 +166,7 @@ The algorithm ''Sign(secnonce, sk, aggnonce, pk<sub>1..u</sub>, m)'' is defined
162166
* Let ''mu = KeyAggCoeff(pk<sub>1..u</sub>, bytes(P))''
163167
* Let ''s = (k<sub>1</sub> + b⋅k<sub>2</sub> + e⋅mu⋅d) mod n''
164168
* Let ''psig = bytes(s)''
165-
* Let ''pubnonce = cbytes(k'<sub>1</sub>⋅G) || cbytes(k'<sub>1</sub>⋅G)''
169+
* Let ''pubnonce = cbytes(k'<sub>1</sub>⋅G) || cbytes(k'<sub>2</sub>⋅G)''
166170
* If ''PartialSigVerifyInternal(psig, pubnonce, aggnonce, pk<sub>1..u</sub>, bytes(P), m)'' (see below) returns failure, abort<ref>Verifying the signature before leaving the signer prevents random or attacker provoked computation errors. This prevents publishing invalid signatures which may leak information about the secret key. It is recommended, but can be omitted if the computation cost is prohibitive.</ref>.
167171
* Return partial signature ''psig
168172
@@ -178,7 +182,7 @@ Input:
178182
179183
The algorithm ''PartialSigVerify(psig, pubnonce<sub>1..u</sub>, pk<sub>1..u</sub>, m, i)'' is defined as:
180184
* Let ''aggnonce = NonceAgg(pubnonce<sub>1..u</sub>)''; fail if that fails
181-
* Ren ''PartialSigVerifyInternal(psig, pubnonce<sub>i</sub>, aggnonce, pk<sub>1..u</sub>, pk<sub>i</sub>, m)''
185+
* Run ''PartialSigVerifyInternal(psig, pubnonce<sub>i</sub>, aggnonce, pk<sub>1..u</sub>, pk<sub>i</sub>, m)''
182186
* Return success iff no failure occurred before reaching this point.
183187
184188
===== PartialSigVerifyInternal =====
@@ -195,7 +199,7 @@ Input:
195199
The algorithm ''PartialSigVerifyInternal(psig, pubnonce, aggnonce, pk<sub>1..u</sub>, pk<sup>*</sup>, m)'' is defined as:
196200
* Let ''s = int(psig)''; fail if ''s &ge; n''
197201
* Let ''R<sub>1</sub> = pointc(aggnonce[0:33]), R<sub>2</sub> = pointc(aggnonce[33:66])''; fail if that fails
198-
* Let ''Q = point(KeyAgg(pk<sub>1..u</sub>))''; fail if that fails
202+
* Let ''Q = KeyAggInternal(pk<sub>1..u</sub>)''; fail if that fails
199203
* Let ''b = int(hash<sub>MuSig/noncecoef</sub>(aggnonce || bytes(Q) || m)) mod n''
200204
* Let ''R = R<sub>1</sub> + b⋅R<sub>2</sub>''
201205
* Let ''R<sup>*</sup><sub>1</sub> = pointc(pubnonce[0:33]), R<sup>*</sup><sub>2</sub> = pointc(pubnonce[33:66])''

0 commit comments

Comments
 (0)