Re: [Zsync-users] Considering to generate .zsync files in MirrorBrain
Status: Beta
Brought to you by:
cph
From: Colin P. <cp...@mo...> - 2010-03-28 11:23:59
|
Peter Pöml wrote: > Hi Colin, > > Am 22.03.2010 um 20:47 schrieb Colin Phipps: >> I just wrote a unit test for librcksum/md4.c, using one of the test >> vectors from RFC1320 , and it seems fine - it agrees with the RFC and >> openssl(1). > > Thank you for the test program. I checked it and the result I got was indeed fine. > > Now, the next thing I suspected was that Python was handing over the data to OpenSSL wrongly. However, when searching the Internet, I found a usage example on http://barryp.org/software/py-md4/ that immediately raised my suspicion that it I used the Python hashlib module in the wrong way. In fact, I incorrectly passed a string to the MD4 context upon its creation that changed the hash in effect. > > I used hashlib.new('md4', string='md4') where I should have used hashlib.new('md4'). I stupidly assumed that the second argument was required and effectively chose the algorithm. > > I'm really sorry for having wasted your time! I'm grateful for your help. No problem :-). Since I had managed to get the MD4 wrong once myself, it was worth adding a unit test for. -- Colin Phipps <cp...@mo...> |