History log of /external/toybox/toys/lsb/md5sum.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
29e5e24c6d7ea08fc84895eb48de3a5f2250a547 20-Nov-2014 Rob Landley <rob@landley.net> Make md5sum and sha1sum work on big endian systems.
/external/toybox/toys/lsb/md5sum.c
e1fa787be8d0d66c9860c86dcb80fd6e096f74e0 27-Sep-2014 Rob Landley <rob@landley.net> Separate more commands so single.sh can build them standalone.
/external/toybox/toys/lsb/md5sum.c
2682551a4b192d566383afcdd57081fd222656ed 07-Jun-2014 Rob Landley <rob@landley.net> Make md5sum/sha1sum -b flag be "brief" output (just the hash).

(It's not like systems implementing -b binary and -t text still matter.)
/external/toybox/toys/lsb/md5sum.c
afe951b19c0f8313731e28a5f347304d82e7f7af 16-May-2014 Daniel Verkamp <daniel@drv.nu> Here's a quick cleanup of md5sum. Executive summary: smaller and faster.

On my machine, for a 2.2 GB file of random bytes, the timings with
warm cache are:
toybox before: 11.4 seconds
toybox after: 8.3 seconds
GNU md5sum: 3.9 seconds
openssl dgst -md5: 3.5 seconds

This is clearly better than before (3x openssl), but still slow (2x openssl).

I suspect there is more low-hanging fruit to be had by eliminating the
memcpy in hash_update (maybe not too much - hash_update accounts for
about 4% of total runtime versus 92% for md5_transform according to
perf - but this would also help sha1sum).

make bloatcheck on x86_64 gcc 4.8.2 -Os:
name old new delta
-----------------------------------------------------------------------
md5rot 0 64 64
md5_transform 365 223 -142
-----------------------------------------------------------------------
-78 total

Rationale for the changes:

Move definition of 'rol' up so it can be used in md5_transform. This
is purely cosmetic; it expands to exactly the same code.

Put rotation counts in a lookup table instead of calculating them on
the fly. This is mostly a wash size-wise, +5 bytes total, but
worthwhile for readability and speed.

Instead of accessing the state array using a rotating index (the
variable formerly known as 'a'), access the state with constant
offsets and rotate the contents of the array instead. This is the big
win - it eliminates all the crazy memory addressing math inside the
loop.
/external/toybox/toys/lsb/md5sum.c
7aa651a6a4496d848f86de9b1e6b3a003256a01f 14-Nov-2012 Rob Landley <rob@landley.net> Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.

The actual code should be the same afterward, this is just cosmetic refactoring.
/external/toybox/toys/lsb/md5sum.c
e5138f409785757aa7d77d558b4bf0d9f01a6176 04-Nov-2012 Rob Landley <rob@landley.net> Make sha1sum and md5sum default to y.
/external/toybox/toys/lsb/md5sum.c
ab1bdc6e5f51c5a6a5f1cadbbfb286233a265375 23-Oct-2012 Rob Landley <rob@landley.net> Add md5sum in lsb, combine sha1sum (mostly shared infrastructure). Downside: current infrastructure can't give them different help text. Hmmm...
/external/toybox/toys/lsb/md5sum.c