MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / md5_update

Function md5_update

Source/Utils/md5.cpp:182–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void md5_update( md5_context *ctx, uint8 *input, uint32 length )
183{
184 uint32 left, fill;
185
186 if (!length) return;
187
188 left = ctx->total[0] & 0x3F;
189 fill = 64 - left;
190
191 ctx->total[0] += length;
192 ctx->total[0] &= 0xFFFFFFFF;
193
194 if (ctx->total[0] < length)
195 ctx->total[1]++;
196
197 if (left && length >= fill)
198 {
199 memcpy( (void *)(ctx->buffer + left),
200 (void *)input, fill );
201 md5_process( ctx, ctx->buffer );
202 length -= fill;
203 input += fill;
204 left = 0;
205 }
206
207 while (length >= 64)
208 {
209 md5_process( ctx, input );
210 length -= 64;
211 input += 64;
212 }
213
214 if (length)
215 {
216 memcpy( (void *)(ctx->buffer + left),
217 (void *)input, length );
218 }
219}
220
221static uint8 md5_padding[64] =
222{

Callers 2

FileMD5Method · 0.85
md5_finishFunction · 0.85

Calls 1

md5_processFunction · 0.85

Tested by

no test coverage detected