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

Function md5_update

src/utils/md5.cpp:164–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164void md5_update( struct md5_context *ctx, uint8 *input, uint32 length )
165{
166 uint32 left, fill;
167
168 if( ! length ) return;
169
170 left = ( ctx->total[0] >> 3 ) & 0x3F;
171 fill = 64 - left;
172
173 ctx->total[0] += length << 3;
174 ctx->total[1] += length >> 29;
175
176 ctx->total[0] &= 0xFFFFFFFF;
177 ctx->total[1] += ctx->total[0] < ( length << 3 );
178
179 if( left && length >= fill )
180 {
181 memcpy( (void *) (ctx->buffer + left), (void *) input, fill );
182 md5_process( ctx, ctx->buffer );
183 length -= fill;
184 input += fill;
185 left = 0;
186 }
187
188 while( length >= 64 )
189 {
190 md5_process( ctx, input );
191 length -= 64;
192 input += 64;
193 }
194
195 if( length )
196 {
197 memcpy( (void *) (ctx->buffer + left), (void *) input, length );
198 }
199}
200
201static uint8 md5_padding[64] =
202{

Callers 8

md5_finishFunction · 0.70
SubLoadFunction · 0.50
UNIFLoadFunction · 0.50
iNESLoadFunction · 0.50
FCEUD_NetworkConnectFunction · 0.50
FCEUD_NetworkConnectFunction · 0.50
FCEUD_NetworkConnectFunction · 0.50
FCEUD_NetworkConnectFunction · 0.50

Calls 1

md5_processFunction · 0.70

Tested by

no test coverage detected