MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / Sign

Method Sign

src/key.cpp:169–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, uint32_t test_case) const {
170 if (!fValid)
171 return false;
172 vchSig.resize(72);
173 size_t nSigLen = 72;
174 unsigned char extra_entropy[32] = {0};
175 WriteLE32(extra_entropy, test_case);
176 secp256k1_ecdsa_signature sig;
177 int ret = secp256k1_ecdsa_sign(secp256k1_context_sign, &sig, hash.begin(), begin(), secp256k1_nonce_function_rfc6979, test_case ? extra_entropy : NULL);
178 assert(ret);
179 secp256k1_ecdsa_signature_serialize_der(secp256k1_context_sign, (unsigned char*)&vchSig[0], &nSigLen, &sig);
180 vchSig.resize(nSigLen);
181 return true;
182}
183
184bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
185 if (pubkey.IsCompressed() != fCompressed) {

Callers 6

CreateSigMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
TestBuilderClass · 0.80
BOOST_FOREACHFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_FOREACHFunction · 0.80

Calls 5

WriteLE32Function · 0.85
secp256k1_ecdsa_signFunction · 0.85
resizeMethod · 0.80
beginMethod · 0.45

Tested by 4

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_FOREACHFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_FOREACHFunction · 0.64