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

Method CSignatureCache

src/script/sigcache.cpp:39–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38public:
39 CSignatureCache()
40 {
41 uint256 nonce = GetRandHash();
42 // We want the nonce to be 64 bytes long to force the hasher to process
43 // this chunk, which makes later hash computations more efficient. We
44 // just write our 32-byte entropy, and then pad with 'E' for ECDSA and
45 // 'S' for Schnorr (followed by 0 bytes).
46 static constexpr unsigned char PADDING_ECDSA[32] = {'E'};
47 static constexpr unsigned char PADDING_SCHNORR[32] = {'S'};
48 static constexpr unsigned char PADDING_RANGE_PROOF[32] = {'r'};
49 static constexpr unsigned char PADDING_SURJECTION_PROOF[32] = {'s'};
50 m_salted_hasher_ecdsa.Write(nonce.begin(), 32);
51 m_salted_hasher_ecdsa.Write(PADDING_ECDSA, 32);
52 m_salted_hasher_schnorr.Write(nonce.begin(), 32);
53 m_salted_hasher_schnorr.Write(PADDING_SCHNORR, 32);
54 m_salted_hasher_range_proof.Write(nonce.begin(), 32);
55 m_salted_hasher_range_proof.Write(PADDING_RANGE_PROOF, 32);
56 m_salted_hasher_surjection_proof.Write(nonce.begin(), 32);
57 m_salted_hasher_surjection_proof.Write(PADDING_SURJECTION_PROOF, 32);
58 }
59
60 void
61 ComputeEntryECDSA(uint256& entry, const uint256 &hash, const std::vector<unsigned char>& vchSig, const CPubKey& pubkey) const

Callers

nothing calls this directly

Calls 3

GetRandHashFunction · 0.85
WriteMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected