MD5 update any size?

Started by
0 comments, last by user0 12 years, 4 months ago
Im using c++ but asking the question in general. In my understanding hashes are updated via a specific chuck size. If i have a md5 implementation and call it first with a then b then c then finalize it would that be different than calling update with abc all at once then finalize?

I understand its a vague question that probably depends on the md5 implementation but in general let say im making a implementation my self would I have to make some kind of buffer to only update with a certain chunk size?

note: dont worry im not making a implementation just worried about the outcome and what I should be looking for im thinking of using crypto++ but not sure yet.

I said chunk from looking around I guess I could mean block.
Advertisement
Attempting to answer my own question I made this little php script.

It prints the same for both
so I guess my next thing todo is to make a c++ program that works like this
but still im not sure if the implementation has a buffer in it or not


$ctx = hash_init('md5');
hash_update($ctx, 'a');
hash_update($ctx, 'b');
hash_update($ctx, 'c');
echo hash_final($ctx);

echo '<br>';

$ctx = hash_init('md5');
hash_update($ctx, 'abc');
echo hash_final($ctx);

This topic is closed to new replies.

Advertisement