| 204 | } |
| 205 | |
| 206 | bool XOnlyPubKey::VerifySchnorr(const Span<const unsigned char> msg, Span<const unsigned char> sigbytes) const |
| 207 | { |
| 208 | assert(sigbytes.size() == 64); |
| 209 | secp256k1_xonly_pubkey pubkey; |
| 210 | if (!secp256k1_xonly_pubkey_parse(secp256k1_context_verify, &pubkey, m_keydata.data())) return false; |
| 211 | return secp256k1_schnorrsig_verify(secp256k1_context_verify, sigbytes.data(), msg.data(), msg.size(), &pubkey); |
| 212 | } |
| 213 | |
| 214 | // ELEMENTS: this is preserved from an old version of the Taproot code for use in OP_TWEAKVERIFY |
| 215 | bool XOnlyPubKey::CheckPayToContract(const XOnlyPubKey& base, const uint256& hash, bool parity) const |