? ext/hash/run-tests.php
Index: ext/hash/config.m4
===================================================================
RCS file: /repository/php-src/ext/hash/config.m4,v
retrieving revision 1.10.2.3
diff -u -p -d -r1.10.2.3 config.m4
--- ext/hash/config.m4	2 Dec 2005 02:18:54 -0000	1.10.2.3
+++ ext/hash/config.m4	26 Jan 2006 16:55:43 -0000
@@ -7,6 +7,8 @@ PHP_ARG_ENABLE(hash, whether to enable h
 if test "$PHP_HASH" != "no"; then
   AC_DEFINE(HAVE_HASH_EXT,1,[Have HASH Extension])
 
+  PHP_C_BIGENDIAN
+
   AC_CHECK_SIZEOF(short, 2)
   AC_CHECK_SIZEOF(int, 4)
   AC_CHECK_SIZEOF(long, 4)
Index: ext/hash/hash_tiger.c
===================================================================
RCS file: /repository/php-src/ext/hash/hash_tiger.c,v
retrieving revision 1.4.2.3
diff -u -p -d -r1.4.2.3 hash_tiger.c
--- ext/hash/hash_tiger.c	1 Jan 2006 12:50:07 -0000	1.4.2.3
+++ ext/hash/hash_tiger.c	26 Jan 2006 16:55:43 -0000
@@ -88,6 +88,24 @@
 	} \
 	feedforward
 
+#define split_ex(str) \
+	x0=str[0]; x1=str[1]; x2=str[2]; x3=str[3]; \
+	x4=str[4]; x5=str[5]; x6=str[6]; x7=str[7];
+#ifdef WORDS_BIGENDIAN
+#	define split(str) \
+	{ \
+		int i; \
+		php_hash_uint64 tmp[8]; \
+		 \
+		for (i = 0; i < 64; ++i) { \
+			((unsigned char *) tmp)[i^7] = ((unsigned char *) str)[i]; \
+		} \
+		split_ex(tmp); \
+	}
+#else
+#	define split split_ex
+#endif
+
 #define tiger_compress(passes, str, state) \
 { \
 	register php_hash_uint64 a, b, c, tmpa, x0, x1, x2, x3, x4, x5, x6, x7; \
@@ -98,8 +116,7 @@
 	b = state[1]; \
 	c = state[2]; \
 	\
-	x0=str[0]; x1=str[1]; x2=str[2]; x3=str[3]; \
-	x4=str[4]; x5=str[5]; x6=str[6]; x7=str[7]; \
+	split(str); \
 	\
 	compress(passes); \
 	\
@@ -113,12 +130,18 @@ static inline void TigerFinalize(PHP_TIG
 {
 	context->passed += (php_hash_uint64) context->length << 3;
 	
+#ifndef WORDS_BIGENDIAN
 	context->buffer[context->length++] = 0x1;
-	if (context->length % 8) {
+	if (context->length % 8)
+#endif
+	{
 		memset(&context->buffer[context->length], 0, 8-context->length%8);
 		context->length += 8-context->length%8;
 	}
-    
+#ifdef WORDS_BIGENDIAN
+	context->buffer[context->length-1] = 0x1;
+#endif
+	
 	if (context->length > 56) {
 		memset(&context->buffer[context->length], 0, 64 - context->length);
 		tiger_compress(context->passes, ((php_hash_uint64 *) context->buffer), context->state);
Index: ext/hash/php_hash_types.h
===================================================================
RCS file: /repository/php-src/ext/hash/php_hash_types.h,v
retrieving revision 1.2.2.3
diff -u -p -d -r1.2.2.3 php_hash_types.h
--- ext/hash/php_hash_types.h	1 Jan 2006 12:50:07 -0000	1.2.2.3
+++ ext/hash/php_hash_types.h	26 Jan 2006 16:55:44 -0000
@@ -23,6 +23,8 @@
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
+#else
+#include "php_config.h"
 #endif
 
 #ifndef PHP_WIN32
