[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Difference between a+b and bit32.band(a+b)
- From: waspoza <waspoza@...>
- Date: Fri, 9 Sep 2011 15:57:56 +0200
On Fri, Sep 9, 2011 at 3:45 PM, Luiz Henrique de Figueiredo
>> > In digestblock function there is a line: H = band(H + a).
>> I'm not sure about this, but I've heard of people doing similar things
>> taking overflow into account correctly, etc.
> That's what the comment says:
> -- Add (mod 2^32) this chunk's hash to result so far:
Yes, but on http://en.wikipedia.org/wiki/SHA-2 pseudocode says:
Add this chunk's hash to result so far:
h0 := h0 + a
So in pseudocode this line is no different from other additions. And
in lua code there is a difference. Why?