Changeset View
Changeset View
Standalone View
Standalone View
src/pubkey.cpp
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | bool CPubKey::VerifySchnorr(const uint256 &hash, | ||||
} | } | ||||
secp256k1_pubkey pubkey; | secp256k1_pubkey pubkey; | ||||
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, | if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, | ||||
&(*this)[0], size())) { | &(*this)[0], size())) { | ||||
return false; | return false; | ||||
} | } | ||||
return secp256k1_schnorr_verify(secp256k1_context_verify, &vchSig[0], | return secp256k1_schnorr_verify(secp256k1_context_verify, vchSig.data(), | ||||
hash.begin(), &pubkey); | hash.begin(), &pubkey); | ||||
} | } | ||||
bool CPubKey::RecoverCompact(const uint256 &hash, | bool CPubKey::RecoverCompact(const uint256 &hash, | ||||
const std::vector<uint8_t> &vchSig) { | const std::vector<uint8_t> &vchSig) { | ||||
if (vchSig.size() != COMPACT_SIGNATURE_SIZE) { | if (vchSig.size() != COMPACT_SIGNATURE_SIZE) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |