MCPcopy Create free account
hub / github.com/albertobsd/keyhunt / Finalize

Method Finalize

hash/sha512.cpp:233–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void CSHA512::Finalize(unsigned char hash[64]) {
234
235 size_t rest;
236 size_t i;
237
238 rest = buffSize;
239
240 // End code
241 buf[buffSize++] = 0x80;
242
243 if (buffSize > 112) {
244 memset(buf+buffSize,0,128-buffSize);
245 _sha512::Transform(s, buf);
246 buffSize = 0;
247 }
248 memset(buf+buffSize,0,112-buffSize);
249
250 // Write length (128bit big-endian)
251 WRITEBE64(buf + 112, count >> 54);
252 WRITEBE64(buf + 120, ((count << 7) | rest) << 3);
253 _sha512::Transform(s, buf);
254
255 for (i = 0; i < 8; i++)
256 WRITEBE64(hash + 8 * i, s[i]);
257
258}
259
260
261/* padding */

Callers 4

hmac_sha512_doneFunction · 0.45
pbkdf2_hmac_sha512Function · 0.45
hmac_sha512Function · 0.45
sha512Function · 0.45

Calls 1

TransformFunction · 0.70

Tested by

no test coverage detected