@@ -298,10 +298,14 @@ class Musig2TestsCommon {
298298
299299 // Once they have each other's public nonce, they can produce partial signatures.
300300 val publicNonces = listOf (aliceNonce.second, bobNonce.second)
301+
301302 val aliceSig = Musig2 .signTaprootInput(alicePrivKey, spendingTx, 0 , listOf (tx.txOut[0 ]), listOf (alicePubKey, bobPubKey), aliceNonce.first, publicNonces, scriptTree = null ).right
302303 assertNotNull(aliceSig)
304+ assertTrue(Musig2 .verifyTaprootSignature(aliceSig, aliceNonce.second, alicePubKey, spendingTx, 0 , listOf (tx.txOut[0 ]), listOf (alicePubKey, bobPubKey), publicNonces, scriptTree = null ))
305+
303306 val bobSig = Musig2 .signTaprootInput(bobPrivKey, spendingTx, 0 , listOf (tx.txOut[0 ]), listOf (alicePubKey, bobPubKey), bobNonce.first, publicNonces, scriptTree = null ).right
304307 assertNotNull(bobSig)
308+ assertTrue(Musig2 .verifyTaprootSignature(bobSig, bobNonce.second, bobPubKey, spendingTx, 0 , listOf (tx.txOut[0 ]), listOf (alicePubKey, bobPubKey), publicNonces, scriptTree = null ))
305309
306310 // Once they have each other's partial signature, they can aggregate them into a valid signature.
307311 val aggregateSig = Musig2 .aggregateTaprootSignatures(listOf (aliceSig, bobSig), spendingTx, 0 , listOf (tx.txOut[0 ]), listOf (alicePubKey, bobPubKey), publicNonces, scriptTree = null ).right
@@ -355,8 +359,11 @@ class Musig2TestsCommon {
355359 val publicNonces = listOf (userNonce.second, serverNonce.second)
356360 val userSig = Musig2 .signTaprootInput(userPrivateKey, tx, 0 , swapInTx.txOut, listOf (userPublicKey, serverPublicKey), userNonce.first, publicNonces, scriptTree).right
357361 assertNotNull(userSig)
362+ assertTrue(Musig2 .verifyTaprootSignature(userSig, userNonce.second, userPublicKey, tx, 0 , swapInTx.txOut, listOf (userPublicKey, serverPublicKey), publicNonces, scriptTree))
363+
358364 val serverSig = Musig2 .signTaprootInput(serverPrivateKey, tx, 0 , swapInTx.txOut, listOf (userPublicKey, serverPublicKey), serverNonce.first, publicNonces, scriptTree).right
359365 assertNotNull(serverSig)
366+ assertTrue(Musig2 .verifyTaprootSignature(serverSig, serverNonce.second, serverPublicKey, tx, 0 , swapInTx.txOut, listOf (userPublicKey, serverPublicKey), publicNonces, scriptTree))
360367
361368 // Once they have each other's partial signature, they can aggregate them into a valid signature.
362369 val aggregateSig = Musig2 .aggregateTaprootSignatures(listOf (userSig, serverSig), tx, 0 , swapInTx.txOut, listOf (userPublicKey, serverPublicKey), publicNonces, scriptTree).right
0 commit comments