Attachment "64.patch" to
ticket [446997ffff]
added by
dgp
2002-02-21 07:10:52.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/sha1/ChangeLog,v
retrieving revision 1.6
diff -u -r1.6 ChangeLog
--- ChangeLog 20 Feb 2002 18:35:00 -0000 1.6
+++ ChangeLog 21 Feb 2002 00:09:23 -0000
@@ -1,3 +1,8 @@
+2002-02-20 Don Porter <[email protected]>
+
+ * sha1.tcl (sha1): Force 32-bit register arithmetic so that
+ the right answers are computed even on 64-bit platforms. [446997]
+
2002-02-20 Donal K. Fellows <[email protected]>
* sha1.tcl (initK,sha1): Force 32-bit interpretation of constants
Index: sha1.tcl
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/sha1/sha1.tcl,v
retrieving revision 1.6
diff -u -r1.6 sha1.tcl
--- sha1.tcl 20 Feb 2002 18:35:00 -0000 1.6
+++ sha1.tcl 21 Feb 2002 00:09:23 -0000
@@ -261,11 +261,11 @@
set A $TEMP
}
- incr H0 $A
- incr H1 $B
- incr H2 $C
- incr H3 $D
- incr H4 $E
+ set H0 [expr {($H0 + $A) & 0xffffffff}]
+ set H1 [expr {($H1 + $B) & 0xffffffff}]
+ set H2 [expr {($H2 + $C) & 0xffffffff}]
+ set H3 [expr {($H3 + $D) & 0xffffffff}]
+ set H4 [expr {($H4 + $E) & 0xffffffff}]
}
return [format %0.8x%0.8x%0.8x%0.8x%0.8x $H0 $H1 $H2 $H3 $H4]