MCPcopy Create free account
hub / github.com/TASEmulators/fceux / md5_update

Function md5_update

fceux-server/md5.cpp:187–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 3

LoadConfigFileFunction · 0.70
mainFunction · 0.70
md5_finishFunction · 0.70

Calls 1

md5_processFunction · 0.70

Tested by

no test coverage detected