And the fix from md5-x86_64 implementation author - Marc Bevand with explanation "Well my assembler code doesn't really care whether the displacement are interpreted as 32-bit signed or unsigned values because in the end the result is truncated to 32-bit. So in order to fix it replace each hex value with a 32-bit signed value (eg. 0xd76aa478 with -680876936)." http://rt.openssl.org/Ticket/Display.html?id=2094 Index: crypto/md5/asm/md5-x86_64.pl =================================================================== RCS file: /usr/local/src/openssl/CVSROOT/openssl/crypto/md5/asm/md5-x86_64.pl,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -p -r1.2.2.1 -r1.2.2.2 --- openssl/crypto/md5/asm/md5-x86_64.pl 11 Nov 2007 13:34:06 -0000 1.2.2.1 +++ openssl/crypto/md5/asm/md5-x86_64.pl 13 Nov 2009 14:14:46 -0000 1.2.2.2 @@ -19,6 +19,7 @@ my $code; sub round1_step { my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_; + $T_i = unpack("l",pack("l", hex($T_i))); # convert to 32-bit signed decimal $code .= " mov 0*4(%rsi), %r10d /* (NEXT STEP) X[0] */\n" if ($pos == -1); $code .= " mov %edx, %r11d /* (NEXT STEP) z' = %edx */\n" if ($pos == -1); $code .= <