mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
test: update BIP340 test vectors and implementation (variable-length messages)
See https://github.com/bitcoin/bips/pull/1446, commit 200f9b26fe0a2f235a2af8b30c4be9f12f6bc9cb
This commit is contained in:
@@ -242,10 +242,9 @@ def verify_schnorr(key, sig, msg):
|
||||
|
||||
- key is a 32-byte xonly pubkey (computed using compute_xonly_pubkey).
|
||||
- sig is a 64-byte Schnorr signature
|
||||
- msg is a 32-byte message
|
||||
- msg is a variable-length message
|
||||
"""
|
||||
assert len(key) == 32
|
||||
assert len(msg) == 32
|
||||
assert len(sig) == 64
|
||||
|
||||
P = secp256k1.GE.from_bytes_xonly(key)
|
||||
@@ -272,7 +271,6 @@ def sign_schnorr(key, msg, aux=None, flip_p=False, flip_r=False):
|
||||
aux = bytes(32)
|
||||
|
||||
assert len(key) == 32
|
||||
assert len(msg) == 32
|
||||
assert len(aux) == 32
|
||||
|
||||
sec = int.from_bytes(key, 'big')
|
||||
|
||||
Reference in New Issue
Block a user