bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: possible bug in sha and crc32 digest classes


From: Albert Strasheim
Subject: Re: possible bug in sha and crc32 digest classes
Date: Tue, 31 Dec 2002 22:08:59 +0200
User-agent: Mutt/1.4i

Hello,

On Tue, 31 Dec 2002, Chad Yates wrote:

> While building a cppunit test suite for the digest classes I exposed some
> possible bugs.  I cannot get correct digests for CRC32 and the two SHA
> classes I'm testing (SHA1 & SHA256).  I used a freely available command line
> hashing program (fsum) to generate my expected hash values, and have
> verified that fsum generates a correct hash for the sha256 reference message
> of 'abc' as documented in the sha256 literature.  My other test cases for
> Checksum, CRC16, and MD5 test out ok, and I am only testing SHA1 and SHA256
> at this time.

<snipped>

I noticed a minor issue with MD5Digest. On any Unixish system you can do 
the following:

address@hidden:~> echo -n "" | md5sum
d41d8cd98f00b204e9800998ecf8427e  -

So the hash value of "nothing" is the value given above. I believe this 
agrees with the example given in the RFC.

I quickly fiddled with MD5Digest, but it doesn't seem as if this is the 
default value of the digest. Inserting "" doesn't seem to work either.

Don't know if anyone is going to get very excited about this (if at 
all; maybe I'm not using MD5Digest correctly), but it should probably 
be fixed.

Cheers,

Albert



reply via email to

[Prev in Thread] Current Thread [Next in Thread]