cvsuser 05/04/05 02:38:41
Modified: runtime/parrot/library/Digest MD5.imc
t/library md5.t
Log:
md5.patch - a working version?
* hopefully fixed 64-bit issues
Courtesy of Nick Glencross <[EMAIL PROTECTED]>
--
disabled 64 bit warning
enabled testing on 64-bit arch
skip all tests on bigendian arch
Revision Changes Path
1.5 +13 -16 parrot/runtime/parrot/library/Digest/MD5.imc
Index: MD5.imc
===================================================================
RCS file: /cvs/public/parrot/runtime/parrot/library/Digest/MD5.imc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MD5.imc 2 Apr 2005 10:14:17 -0000 1.4
+++ MD5.imc 5 Apr 2005 09:38:39 -0000 1.5
@@ -60,16 +60,16 @@
.local pmc endian
endian = new Integer
endian = 0
-
- $P0 = _config()
-
- $I0 = $P0["intsize"]
- if $I0 == 4 goto is_4byte_word
- printerr "This doesn't seem to be a 32 bit processor: "
- printerr "Please verify the MD5 checksum\n"
+ $P0 = _config()
-is_4byte_word:
+# $I0 = $P0["intvalsize"]
+# if $I0 == 4 goto is_4byte_word
+#
+# printerr "This doesn't seem to be a 32 bit processor: "
+# printerr "Please verify the MD5 checksum\n"
+#
+#is_4byte_word:
$I0 = $P0["bigendian"]
unless $I0 goto is_little_endian
@@ -123,11 +123,10 @@
# A parrot rol instruction might be good (as it can often be JIT'd)
.macro rol (x,n, out)
- .out = .x << .n
+ .out = .x << .n
$I1000 = 32 - .n
$I1000 = .x >>> $I1000
- $I1000 = $I1000 & 0xffffffff
- .out |= $I1000
+ .out |= $I1000
.endm
.macro FF (b,c,d)
@@ -156,8 +155,10 @@
$I99 = .k + idx
tmp = buffer[$I99]
.a += tmp
+ .a &= 0xffffffff
.rol (.a, .s, tmp)
- .a = .b + tmp
+ .a = .b + tmp
+ .a &= 0xffffffff
.endm
.macro OP1 (aa,bb,cc,dd, kk, ss, TT)
@@ -425,10 +426,6 @@
context[2] = C
context[3] = D
- # $S0 = _md5_format_vals (A,B,C,D)
- # print $S0
- # print "\n"
-
.end
###########################################################################
1.4 +6 -5 parrot/t/library/md5.t
Index: md5.t
===================================================================
RCS file: /cvs/public/parrot/t/library/md5.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- md5.t 31 Mar 2005 12:20:42 -0000 1.3
+++ md5.t 5 Apr 2005 09:38:41 -0000 1.4
@@ -19,9 +19,9 @@
SKIP: {
-if ($bigendian || $intsize != 4)
+if ($bigendian)
{
- skip('MD5 only known to work on small endian 32 bit processors', 4)
+ skip('MD5 only known to work on little endian bit processors', 6)
}
@@ -335,7 +335,6 @@
840e4dec51660b1f52473e0b0b9545f5
OUT
-}
=bash
@@ -357,7 +356,7 @@
$S0 = "Hello World!"
$I0 = 0
-
+
loop:
print $S0
print "\n"
@@ -593,7 +592,7 @@
$S0 = "Hello World!"
$I0 = 0
-
+
loop:
print $S0
print "\n"
@@ -810,3 +809,5 @@
8408bf5f0144309374e66278bec290b2
982e0fde28cd2f62ef8db2d8dfd0f0d7
OUT
+
+}