Re: [PATCH] Add a birdview-on-the-source-code section to the user manual
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 9, 2007, 16:25 UTC
- Message-ID
- <Pine.LNX.4.64.0705091822590.4167@racer.site>
- In-Reply-To
- <Pine.LNX.4.64.0705091210570.18541@iabervon.org>
Hi,
On Wed, 9 May 2007, Daniel Barkalow wrote:
Show 20 quoted lines
> On Wed, 9 May 2007, Johannes Schindelin wrote: > > > > To be honest, I wouldn't even be *thinking* about the endianity of SHA-1 > > > octet representation (you don't usually really deal with the hash as > > > with a number, so expecting to have it in native endianity is not very > > > natural; you just deal with it as with a data blob) and the > > > "(big-endian)" would only confuse me and get me thinking about "huh, do > > > they swap the bytes, or wait, they don't, ...?!". > > > > > > But that's maybe just me. > > > > But then, maybe it is just me? I got it completely wrong the first time, > > fully expecting the calculations to be carried out in host endianness for > > performance reasons. > > I think the Mozilla implementation carries out calculations in host > endianness, and transfers data from the input to the internal state and > >from the internal state to the final hash with shifts and masks. > > Which calculations are you seeing that involve byte order?
None. I only suspected them to be carried out in byte order. From what I know, there are some shifts involved, which might or might not be helped by 32-bit arithmetic.
I did not really look into it.
>From my prior debugging experiences on Intel, though, I automatically
looked for the least significant bytes at the beginning of those "sha1" variables, and came up empty.
Ciao, Dscho