Angus Robertson - Magenta Systems Ltd wrote:
 
> I've got opt-md5 working in the ICS FTP client (and shortly the FTP
> server), but opt-md4 and opt-sha1 are not generating the expected
> results. 

Just a little test with MD4, Count 0 gave me the expected result:  

MD4Init(Md4Ctx);
Md4Update(Md4Ctx, 'testThis is a test.', 19);
Md4Final(Md4Ctx, MD4Digest);

//* Fold the 128 bit result to 64 bits */
for I := 0 to  7 do
   MD4Digest[I] :=  MD4Digest[I] xor MD4Digest[I + 8];

for I := 0 to 7 do
   S := S + IntToHex(MD4Digest[I], 2) + ' '; 


However I wonder how you translate the stuff below?

     /*
      * copy the resulting 64 bits to the result buffer in little endian
      * fashion (analogous to the way MD4Final() and MD5Final() do).
      */
     for (i = 0, j = 0; j < 8; i++, j += 4)
     {
             result[j]   = (unsigned char)(sha.digest[i] & 0xff);
             result[j+1] = (unsigned char)((sha.digest[i] >> 8) & 0xff);
             result[j+2] = (unsigned char)((sha.digest[i] >> 16) & 0xff);
             result[j+3] = (unsigned char)((sha.digest[i] >> 24) & 0xff);
     }



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to