Changeset View
Changeset View
Standalone View
Standalone View
src/pubkey.cpp
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | if (overflow) { | ||||
/* Overwrite the result again with a correctly-parsed but invalid | /* Overwrite the result again with a correctly-parsed but invalid | ||||
signature if parsing failed. */ | signature if parsing failed. */ | ||||
memset(tmpsig, 0, 64); | memset(tmpsig, 0, 64); | ||||
secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig); | secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig); | ||||
} | } | ||||
return 1; | return 1; | ||||
} | } | ||||
bool CPubKey::Verify(const uint256 &hash, | bool CPubKey::VerifyECDSA(const uint256 &hash, | ||||
const std::vector<uint8_t> &vchSig) const { | const std::vector<uint8_t> &vchSig) const { | ||||
if (!IsValid()) { | if (!IsValid()) { | ||||
return false; | return false; | ||||
} | } | ||||
secp256k1_pubkey pubkey; | secp256k1_pubkey pubkey; | ||||
secp256k1_ecdsa_signature sig; | secp256k1_ecdsa_signature sig; | ||||
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, | if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, | ||||
&(*this)[0], size())) { | &(*this)[0], size())) { | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |