MCPcopy Create free account
hub / github.com/LUX-Core/lux / SignECDSA

Method SignECDSA

src/key.cpp:183–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183bool CKey::SignECDSA(const uint256& hash, std::vector<uint8_t>& vchSig, uint32_t test_case) const {
184 if (!fValid)
185 return false;
186 vchSig.resize(CPubKey::SIGNATURE_SIZE);
187 size_t nSigLen = CPubKey::SIGNATURE_SIZE;
188 unsigned char extra_entropy[32] = {0};
189 WriteLE32(extra_entropy, test_case);
190 secp256k1_ecdsa_signature sig;
191 int ret = secp256k1_ecdsa_sign(secp256k1_context_sign, &sig, hash.begin(), begin(), secp256k1_nonce_function_rfc6979, test_case ? extra_entropy : nullptr);
192 assert(ret);
193 secp256k1_ecdsa_signature_serialize_der(secp256k1_context_sign, (unsigned char*)vchSig.data(), &nSigLen, &sig);
194 vchSig.resize(nSigLen);
195 return true;
196}
197
198 bool CKey::SignSchnorr(const uint256 &hash, std::vector<uint8_t> &vchSig, uint32_t test_case) const
199{

Callers 3

SignMethod · 0.80
CreateSigMethod · 0.80
SignBlockMethod · 0.80

Calls 7

WriteLE32Function · 0.85
secp256k1_ecdsa_signFunction · 0.85
beginFunction · 0.85
resizeMethod · 0.45
beginMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected