Re: [PATCH] Add a birdview-on-the-source-code section to the user manual
- From
Karl Hasselström <kha@treskal.com>
- Date
- May 10, 2007, 20:01 UTC
- Message-ID
- <20070510200155.GB10353@diana.vm.bytemark.co.uk>
- In-Reply-To
- <Pine.LNX.4.64.0705100015120.4167@racer.site>
On 2007-05-10 00:23:50 +0200, Johannes Schindelin wrote:
Show 6 quoted lines
> I was not aware originally, that no arithmetic is involved in SHA-1 > computation. > > If you store large integers, it makes tons of sense to follow the > endianness, especially if you do _both_ boolean and integer > operations on them.
Actually, if you take a look at
http://en.wikipedia.org/wiki/Sha1#SHA-1_algorithm
you'll see that in addition to an unholy mess of bitwise operations, it does do some additions, on 32-bit big-endian words according to the article.
But thinking of them as addition gives you the wrong mental picture; they're simply one of many ways for a standard processor to mix bits efficiently as far as SHA-1 is concerned. The algorithm is specified as yielding a 160-bit binary blob, and can and should be thought of as a black NSA-certified box with "warranty void if this seal is broken" stickers. (Unless you're the one implementing it, of course. But then you know what you're doing.)
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle