18 |
*/ |
*/ |
19 |
|
|
20 |
#include "tiger.h" |
#include "tiger.h" |
21 |
|
#include <caml/config.h> |
|
/* Big endian: */ |
|
|
#if !(defined(__alpha)||defined(__i386__)||defined(__vax__)) |
|
|
#define BIG_ENDIAN |
|
|
#endif |
|
22 |
|
|
23 |
/* The following macro denotes that an optimization */ |
/* The following macro denotes that an optimization */ |
24 |
/* for Alpha is required. It is used only for */ |
/* for Alpha is required. It is used only for */ |
189 |
|
|
190 |
for(i=length; i>=64; i-=64) |
for(i=length; i>=64; i-=64) |
191 |
{ |
{ |
192 |
#ifdef BIG_ENDIAN |
#ifdef ARCH_BIG_ENDIAN |
193 |
for(j=0; j<64; j++) |
for(j=0; j<64; j++) |
194 |
temp[j^7] = ((byte*)str)[j]; |
temp[j^7] = ((byte*)str)[j]; |
195 |
tiger_compress(((word64*)temp), res); |
tiger_compress(((word64*)temp), res); |
199 |
str += 8; |
str += 8; |
200 |
} |
} |
201 |
|
|
202 |
#ifdef BIG_ENDIAN |
#ifdef ARCH_BIG_ENDIAN |
203 |
for(j=0; j<i; j++) |
for(j=0; j<i; j++) |
204 |
temp[j^7] = ((byte*)str)[j]; |
temp[j^7] = ((byte*)str)[j]; |
205 |
|
|
749 |
|
|
750 |
void swap_digest(unsigned char *digest) |
void swap_digest(unsigned char *digest) |
751 |
{ |
{ |
752 |
#ifdef BIG_ENDIAN |
#ifdef ARCH_BIG_ENDIAN |
753 |
{ |
{ |
754 |
int i,j; |
int i,j; |
755 |
for(i=0; i<3; i++){ |
for(i=0; i<3; i++){ |