@@ -138,7 +138,7 @@ CPrivKey CKey::GetPrivKey() const {
138
138
size_t privkeylen;
139
139
privkey.resize (279 );
140
140
privkeylen = 279 ;
141
- ret = ec_privkey_export_der (secp256k1_context_sign, (unsigned char *)& privkey[ 0 ] , &privkeylen, begin (), fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
141
+ ret = ec_privkey_export_der (secp256k1_context_sign, (unsigned char *) privkey. data () , &privkeylen, begin (), fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
142
142
assert (ret);
143
143
privkey.resize (privkeylen);
144
144
return privkey;
@@ -167,7 +167,7 @@ bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, uint32_
167
167
secp256k1_ecdsa_signature sig;
168
168
int ret = secp256k1_ecdsa_sign (secp256k1_context_sign, &sig, hash.begin (), begin (), secp256k1_nonce_function_rfc6979, test_case ? extra_entropy : NULL );
169
169
assert (ret);
170
- secp256k1_ecdsa_signature_serialize_der (secp256k1_context_sign, (unsigned char *)& vchSig[ 0 ] , &nSigLen, &sig);
170
+ secp256k1_ecdsa_signature_serialize_der (secp256k1_context_sign, (unsigned char *)vchSig. data () , &nSigLen, &sig);
171
171
vchSig.resize (nSigLen);
172
172
return true ;
173
173
}
@@ -202,7 +202,7 @@ bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig)
202
202
}
203
203
204
204
bool CKey::Load (CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck =false ) {
205
- if (!ec_privkey_import_der (secp256k1_context_sign, (unsigned char *)begin (), & privkey[ 0 ] , privkey.size ()))
205
+ if (!ec_privkey_import_der (secp256k1_context_sign, (unsigned char *)begin (), privkey. data () , privkey.size ()))
206
206
return false ;
207
207
fCompressed = vchPubKey.IsCompressed ();
208
208
fValid = true ;
@@ -245,8 +245,8 @@ void CExtKey::SetMaster(const unsigned char *seed, unsigned int nSeedLen) {
245
245
static const unsigned char hashkey[] = {' B' ,' i' ,' t' ,' c' ,' o' ,' i' ,' n' ,' ' ,' s' ,' e' ,' e' ,' d' };
246
246
std::vector<unsigned char , secure_allocator<unsigned char >> vout (64 );
247
247
CHMAC_SHA512 (hashkey, sizeof (hashkey)).Write (seed, nSeedLen).Finalize (vout.data ());
248
- key.Set (& vout[ 0 ], & vout[ 32 ] , true );
249
- memcpy (chaincode.begin (), & vout[ 32 ] , 32 );
248
+ key.Set (vout. data (), vout. data () + 32 , true );
249
+ memcpy (chaincode.begin (), vout. data () + 32 , 32 );
250
250
nDepth = 0 ;
251
251
nChild = 0 ;
252
252
memset (vchFingerprint, 0 , sizeof (vchFingerprint));
0 commit comments