Skip to content

Commit

Permalink
Add unaggregated nonces to sig_agg test vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasnick committed Jun 9, 2022
1 parent 8f392c9 commit 7e19ef1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bip-musig2/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,22 @@ def test_sig_agg_vectors():
'0F5BE837F3AB7E7FEFF1FAA44D673C2017206AE836D2C7893CDE4ACB7D55EDEB',
'0FD453223E444FCA91FB5310990AE8A0C5DAA14D2A4C8944E1C0BC80C30DF682',
])

# These nonces only needed if the tested API only takes the individual
# nonces and not the aggregate nonce.
pnonce = fromhex_all([
'0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798' +
'0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798',
'0327EE3C4078B3EE8888C86980C9349B033360C041108412B076D64A199D732247' +
'0211A8415F0F7044FF94296CD3006D1E0BE7209F1549CF8F96D03C60ACA36DE69C',
'032D459FC804D89AE5B0352A92B4EAADB5AB2F8F5479C072D9BE4C9887A23CA9E4' +
'0238A68BF96C2904BBF409527F3D8E1EE2D6A1F6A0F3E68016B3BB575EF22BA2DD',
'03202ED19F8FF57B795DA93D3DF40DC25EB4BBF5B0CCCD31E71CA2409A8C5575D6' +
'02B73DFC004F0890B1F3BBF99A42746F02F1B6CB18D16AAD2F8703E779B4688ECA',
'020663C56E861775F206E0268F5DD517143B6F55374A5C499DB44AD30E342AB81C' +
'03F33D3F53D7528B3ADA8523C25C86FE4479FC3540CCED28D1D1BE351CF139AE64',
])

aggnonce = fromhex_all([
'024FA51009A56F0D6DF737131CE1FBBD833797AF3B4FE6BF0D68F4D49F68B0947E' +
'0248FB3BB9191F0CFF13806A3A2F1429C23012654FCE4E41F7EC9169EAA6056B21',
Expand All @@ -684,6 +700,8 @@ def test_sig_agg_vectors():
'026491FBCFD47148043A0F7310E62EF898C10F2D0376EE6B232EAAD36F3C2E29E' +
'303020CB17D168908E2904DE2EB571CD232CA805A6981D0F86CDBBD2F12BD91F6D0',
])
for i, nonce in enumerate(aggnonce):
assert(nonce == nonce_agg([pnonce[0], pnonce[i+1]]))

msg = bytes.fromhex('599C67EA410D005B9DA90817CF03ED3B1C868E4DA4EDF00A5880B0082C237869')

Expand Down

0 comments on commit 7e19ef1

Please sign in to comment.