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

Method Finalize

src/crypto/sha512.cpp:185–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185void CSHA512::Finalize(unsigned char hash[OUTPUT_SIZE])
186{
187 static const unsigned char pad[128] = {0x80};
188 unsigned char sizedesc[16] = {0x00};
189 WriteBE64(sizedesc + 8, bytes << 3);
190 Write(pad, 1 + ((239 - (bytes % 128)) % 128));
191 Write(sizedesc, 16);
192 WriteBE64(hash, s[0]);
193 WriteBE64(hash + 8, s[1]);
194 WriteBE64(hash + 16, s[2]);
195 WriteBE64(hash + 24, s[3]);
196 WriteBE64(hash + 32, s[4]);
197 WriteBE64(hash + 40, s[5]);
198 WriteBE64(hash + 48, s[6]);
199 WriteBE64(hash + 56, s[7]);
200}
201
202CSHA512& CSHA512::Reset()
203{

Callers

nothing calls this directly

Calls 1

WriteBE64Function · 0.70

Tested by

no test coverage detected