Re: Implementing SHA-1, weird problem when running against test data

From: Brian Gladman (fake@nowhere.org)
Date: 04/21/03


From: "Brian Gladman" <fake@nowhere.org>
Date: Mon, 21 Apr 2003 20:16:31 +0100


"Ken Very Big Liar" <kellydeanbeard@hotmail.com> wrote in message
news:qf88avgjes2v25tmg7ucnbrlonbpck02ss@4ax.com...
> I don't do any crypto stuff in my daily job, but I became interested in
the
> different hashing algorithms and am working on SHA-1. I am comparing my
results
> against the NIST FIPS 180-2 document and am having a weird result with the
test
> data "abc".

IIRC the count is a 64-bit number in big-endian form so that for 32-bit
numbers
with the hash of "abc" - count 24 - w[14] = 0x00000000 and w[15] =
0x00000018.

So it looks like you have entered two 32-bit count values in the buffer in
the wrong order.

    Brian Gladman



Relevant Pages