MCPcopy Create free account
hub / github.com/assaultcube/AC / hash_finish

Function hash_finish

source/src/crypto.cpp:154–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152 }
153
154 void hash_finish(hashval &val, incremental_buffer *b)
155 {
156 ASSERT(b && b->len >= 0 && b->len < 64);
157 memset(b->u + b->len, 0, 64 - b->len);
158 b->u[b->len] = 0x01;
159 if(b->len >= 56)
160 {
161 compress(b->c, val.chunks);
162 memset(b->u, 0, 64);
163 b->len = 0;
164 }
165 b->c[7] = lilswap(chunk(b->total << 3));
166 compress(b->c, val.chunks);
167 lilswap(val.chunks, 3);
168 delete b;
169 }
170
171 void hash(const uchar *str, int length, hashval &val)
172 {

Callers 2

hashFunction · 0.85
tigerhash_finishFunction · 0.85

Calls 2

compressFunction · 0.85
lilswapFunction · 0.85

Tested by

no test coverage detected