Changeset View
Changeset View
Standalone View
Standalone View
src/pubkey.cpp
Show First 20 Lines • Show All 285 Lines • ▼ Show 20 Lines | |||||
bool CExtPubKey::Derive(CExtPubKey &out, unsigned int _nChild) const { | bool CExtPubKey::Derive(CExtPubKey &out, unsigned int _nChild) const { | ||||
out.nDepth = nDepth + 1; | out.nDepth = nDepth + 1; | ||||
CKeyID id = pubkey.GetID(); | CKeyID id = pubkey.GetID(); | ||||
memcpy(&out.vchFingerprint[0], &id, 4); | memcpy(&out.vchFingerprint[0], &id, 4); | ||||
out.nChild = _nChild; | out.nChild = _nChild; | ||||
return pubkey.Derive(out.pubkey, out.chaincode, _nChild, chaincode); | return pubkey.Derive(out.pubkey, out.chaincode, _nChild, chaincode); | ||||
} | } | ||||
/* static */ bool CPubKey::CheckLowS(const std::vector<uint8_t> &vchSig) { | bool CPubKey::CheckLowS( | ||||
const boost::sliced_range<const std::vector<uint8_t>> &vchSig) { | |||||
secp256k1_ecdsa_signature sig; | secp256k1_ecdsa_signature sig; | ||||
if (!ecdsa_signature_parse_der_lax(secp256k1_context_verify, &sig, | if (!ecdsa_signature_parse_der_lax(secp256k1_context_verify, &sig, | ||||
&vchSig[0], vchSig.size())) { | &vchSig[0], vchSig.size())) { | ||||
return false; | return false; | ||||
} | } | ||||
return (!secp256k1_ecdsa_signature_normalize(secp256k1_context_verify, | return (!secp256k1_ecdsa_signature_normalize(secp256k1_context_verify, | ||||
nullptr, &sig)); | nullptr, &sig)); | ||||
} | } | ||||
Show All 21 Lines |