@ -171,6 +171,7 @@ bool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchS
return false ;
secp256k1_pubkey pubkey ;
secp256k1_ecdsa_signature sig ;
assert ( secp256k1_context_verify & & " secp256k1_context_verify must be initialized to use CPubKey. " ) ;
if ( ! secp256k1_ec_pubkey_parse ( secp256k1_context_verify , & pubkey , vch , size ( ) ) ) {
return false ;
}
@ -190,6 +191,7 @@ bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector<unsigned cha
bool fComp = ( ( vchSig [ 0 ] - 27 ) & 4 ) ! = 0 ;
secp256k1_pubkey pubkey ;
secp256k1_ecdsa_recoverable_signature sig ;
assert ( secp256k1_context_verify & & " secp256k1_context_verify must be initialized to use CPubKey. " ) ;
if ( ! secp256k1_ecdsa_recoverable_signature_parse_compact ( secp256k1_context_verify , & sig , & vchSig [ 1 ] , recid ) ) {
return false ;
}
@ -207,6 +209,7 @@ bool CPubKey::IsFullyValid() const {
if ( ! IsValid ( ) )
return false ;
secp256k1_pubkey pubkey ;
assert ( secp256k1_context_verify & & " secp256k1_context_verify must be initialized to use CPubKey. " ) ;
return secp256k1_ec_pubkey_parse ( secp256k1_context_verify , & pubkey , vch , size ( ) ) ;
}
@ -214,6 +217,7 @@ bool CPubKey::Decompress() {
if ( ! IsValid ( ) )
return false ;
secp256k1_pubkey pubkey ;
assert ( secp256k1_context_verify & & " secp256k1_context_verify must be initialized to use CPubKey. " ) ;
if ( ! secp256k1_ec_pubkey_parse ( secp256k1_context_verify , & pubkey , vch , size ( ) ) ) {
return false ;
}
@ -232,6 +236,7 @@ bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChi
BIP32Hash ( cc , nChild , * begin ( ) , begin ( ) + 1 , out ) ;
memcpy ( ccChild . begin ( ) , out + 32 , 32 ) ;
secp256k1_pubkey pubkey ;
assert ( secp256k1_context_verify & & " secp256k1_context_verify must be initialized to use CPubKey. " ) ;
if ( ! secp256k1_ec_pubkey_parse ( secp256k1_context_verify , & pubkey , vch , size ( ) ) ) {
return false ;
}
@ -273,6 +278,7 @@ bool CExtPubKey::Derive(CExtPubKey &out, unsigned int _nChild) const {
/* static */ bool CPubKey : : CheckLowS ( const std : : vector < unsigned char > & vchSig ) {
secp256k1_ecdsa_signature sig ;
assert ( secp256k1_context_verify & & " secp256k1_context_verify must be initialized to use CPubKey. " ) ;
if ( ! ecdsa_signature_parse_der_lax ( secp256k1_context_verify , & sig , vchSig . data ( ) , vchSig . size ( ) ) ) {
return false ;
}