Skip to content

Commit 6755569

Browse files
committed
trivial: Replace CPubKey::operator[] with CPubKey::vch where possible
1 parent 7146672 commit 6755569

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pubkey.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ bool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchS
171171
return false;
172172
secp256k1_pubkey pubkey;
173173
secp256k1_ecdsa_signature sig;
174-
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
174+
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
175175
return false;
176176
}
177177
if (!ecdsa_signature_parse_der_lax(secp256k1_context_verify, &sig, vchSig.data(), vchSig.size())) {
@@ -207,14 +207,14 @@ bool CPubKey::IsFullyValid() const {
207207
if (!IsValid())
208208
return false;
209209
secp256k1_pubkey pubkey;
210-
return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size());
210+
return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size());
211211
}
212212

213213
bool CPubKey::Decompress() {
214214
if (!IsValid())
215215
return false;
216216
secp256k1_pubkey pubkey;
217-
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
217+
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
218218
return false;
219219
}
220220
unsigned char pub[PUBLIC_KEY_SIZE];
@@ -232,7 +232,7 @@ bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChi
232232
BIP32Hash(cc, nChild, *begin(), begin()+1, out);
233233
memcpy(ccChild.begin(), out+32, 32);
234234
secp256k1_pubkey pubkey;
235-
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
235+
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
236236
return false;
237237
}
238238
if (!secp256k1_ec_pubkey_tweak_add(secp256k1_context_verify, &pubkey, out)) {

0 commit comments

Comments
 (0)