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

Method Finalize

src/crypto/sha1.cpp:180–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180void CSHA1::Finalize(unsigned char hash[OUTPUT_SIZE])
181{
182 static const unsigned char pad[64] = {0x80};
183 unsigned char sizedesc[8];
184 WriteBE64(sizedesc, bytes << 3);
185 Write(pad, 1 + ((119 - (bytes % 64)) % 64));
186 Write(sizedesc, 8);
187 WriteBE32(hash, s[0]);
188 WriteBE32(hash + 4, s[1]);
189 WriteBE32(hash + 8, s[2]);
190 WriteBE32(hash + 12, s[3]);
191 WriteBE32(hash + 16, s[4]);
192}
193
194CSHA1& CSHA1::Reset()
195{

Callers 15

CHKDF_HMAC_SHA256_L32Method · 0.45
Expand32Method · 0.45
IsMineInnerFunction · 0.45
GetIDMethod · 0.45
BytesToKeySHA512AESMethod · 0.45
GetBlindingKeyMethod · 0.45
operator()Method · 0.45
RecurseImportDataFunction · 0.45
listunspentFunction · 0.45
MakeScriptsMethod · 0.45
InferScriptFunction · 0.45
EvalScriptFunction · 0.45

Calls 2

WriteBE64Function · 0.70
WriteBE32Function · 0.70

Tested by 15

BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36
MerkleComputationFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36
TestBuilderMethod · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
TestVectorFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
TestSHA3_256Function · 0.36
FUZZ_TARGETFunction · 0.36