MCPcopy Create free account
hub / github.com/ElementsProject/elements / CreateSig

Method CreateSig

src/script/sign.cpp:580–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578 DummySignatureCreator(char r_len, char s_len) : m_r_len(r_len), m_s_len(s_len) {}
579 const BaseSignatureChecker& Checker() const override { return DUMMY_CHECKER; }
580 bool CreateSig(const SigningProvider& provider, std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion, unsigned int flags) const override
581 {
582 // Create a dummy signature that is a valid DER-encoding
583 vchSig.assign(m_r_len + m_s_len + 7, '\000');
584 vchSig[0] = 0x30;
585 vchSig[1] = m_r_len + m_s_len + 4;
586 vchSig[2] = 0x02;
587 vchSig[3] = m_r_len;
588 vchSig[4] = 0x01;
589 vchSig[4 + m_r_len] = 0x02;
590 vchSig[5 + m_r_len] = m_s_len;
591 vchSig[6 + m_r_len] = 0x01;
592 vchSig[6 + m_r_len + m_s_len] = SIGHASH_ALL;
593 return true;
594 }
595 bool CreateSchnorrSig(const SigningProvider& provider, std::vector<unsigned char>& sig, const XOnlyPubKey& pubkey, const uint256* leaf_hash, const uint256* tweak, SigVersion sigversion) const override
596 {
597 sig.assign(64, '\000');

Callers

nothing calls this directly

Calls 1

assignMethod · 0.45

Tested by

no test coverage detected