1
0
mirror of https://github.com/git/git.git synced 2024-09-28 19:42:15 +02:00
git/block-sha1
Linus Torvalds 7b5075fcfb block-sha1: re-use the temporary array as we calculate the SHA1
The mozilla-SHA1 code did this 80-word array for the 80 iterations.  But
the SHA1 state is really just 512 bits, and you can actually keep it in
a kind of "circular queue" of just 16 words instead.

This requires us to do the xor updates as we go along (rather than as a
pre-phase), but that's really what we want to do anyway.

This gets me really close to the OpenSSL performance on my Nehalem.
Look ma, all C code (ok, there's the rol/ror hack, but that one doesn't
strictly even matter on my Nehalem, it's just a local optimization).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-06 13:56:45 -07:00
..
sha1.c block-sha1: re-use the temporary array as we calculate the SHA1 2009-08-06 13:56:45 -07:00
sha1.h