|
8 | 8 | EC_UNCOMPRESSED = lib.SECP256K1_EC_UNCOMPRESSED |
9 | 9 |
|
10 | 10 | HAS_RECOVERABLE = hasattr(lib, 'secp256k1_ecdsa_sign_recoverable') |
11 | | -#HAS_SCHNORR = hasattr(lib, 'secp256k1_schnorrsig_sign') |
12 | | -HAS_SCHNORR = hasattr(lib, 'secp256k1_schnorrsig_sign_custom') # forgot why it's called custom |
| 11 | +HAS_SCHNORR = hasattr(lib, 'secp256k1_schnorrsig_sign') |
13 | 12 | HAS_ECDH = hasattr(lib, 'secp256k1_ecdh') |
14 | 13 | HAS_EXTRAKEYS = hasattr(lib, 'secp256k1_keypair_create') |
15 | 14 |
|
@@ -232,17 +231,13 @@ def ecdsa_verify(self, msg, raw_sig, raw=False, digest=hashlib.sha256): |
232 | 231 | return bool(verified) |
233 | 232 |
|
234 | 233 | def schnorr_verify(self, msg, schnorr_sig, bip340tag, raw=False): |
235 | | - print("schnorr_verify 0") |
236 | 234 | assert self.public_key, "No public key defined" |
237 | 235 | if not HAS_SCHNORR: |
238 | 236 | raise Exception("secp256k1_schnorr not enabled") |
239 | | - print("schnorr_verify 1") |
240 | 237 | msg_to_sign = _bip340_tag(msg, raw, bip340tag) |
241 | | - print("schnorr_verify 2") |
242 | 238 | verified = lib.secp256k1_schnorrsig_verify( |
243 | 239 | secp256k1_ctx, schnorr_sig, msg_to_sign, len(msg_to_sign), |
244 | 240 | self.xonly_pubkey) |
245 | | - print("schnorr_verify 3") |
246 | 241 | return bool(verified) |
247 | 242 |
|
248 | 243 | def ecdh(self, scalar, hashfn=ffi.NULL, hasharg=ffi.NULL): |
@@ -366,7 +361,7 @@ def schnorr_sign(self, msg, bip340tag, raw=False): |
366 | 361 | sig64 = ffi.new('char [64]') |
367 | 362 |
|
368 | 363 | # FIXME: It's recommended to provide aux_rand32... |
369 | | - signed = lib.secp256k1_schnorrsig_sign_custom( |
| 364 | + signed = lib.secp256k1_schnorrsig_sign( |
370 | 365 | secp256k1_ctx, sig64, msg_to_sign, len(msg_to_sign), |
371 | 366 | self.keypair, ffi.NULL) |
372 | 367 | assert signed == 1 |
|
0 commit comments