[wpdev-commits] wolfpack/twofish platform.h,1.3,1.4
Brought to you by:
rip,
thiagocorrea
|
From: <dar...@us...> - 2003-09-30 15:07:01
|
Update of /cvsroot/wpdev/wolfpack/twofish In directory sc8-pr-cvs1:/tmp/cvs-serv14446/twofish Modified Files: platform.h Log Message: Encryption Fixes for Linux and some Python Fixes / Additions. Index: platform.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/twofish/platform.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** platform.h 24 Jun 2003 18:30:45 -0000 1.3 --- platform.h 30 Sep 2003 15:06:30 -0000 1.4 *************** *** 21,39 **** /* use intrinsic rotate if possible */ ! #define ROL(x,n) (((x) << ((n) & 0x1F)) | ((x) >> (32-((n) & 0x1F)))) ! #define ROR(x,n) (((x) >> ((n) & 0x1F)) | ((x) << (32-((n) & 0x1F)))) ! ! #if (0) && defined(__BORLANDC__) && (__BORLANDC__ >= 0x462) ! #error "!!!This does not work for some reason!!!" ! #include <stdlib.h> /* get prototype for _lrotl() , _lrotr() */ ! #pragma inline __lrotl__ ! #pragma inline __lrotr__ ! #undef ROL /* get rid of inefficient definitions */ ! #undef ROR ! #define ROL(x,n) __lrotl__(x,n) /* use compiler intrinsic rotations */ ! #define ROR(x,n) __lrotr__(x,n) ! #endif ! #ifdef _MSC_VER #include <stdlib.h> /* get prototypes for rotation functions */ #undef ROL --- 21,28 ---- /* use intrinsic rotate if possible */ ! #define ROL( x, y ) ( ( (x) << (y) ) | ( (x) >> ( 32 - (y) ) ) ) ! #define ROR( x, y ) ( ( (x) >> (y) ) | ( (x) << ( 32 - (y) ) ) ) ! #if defined(_MSC_VER) #include <stdlib.h> /* get prototypes for rotation functions */ #undef ROL *************** *** 44,60 **** #endif ! #ifndef _M_IX86 ! #ifdef __BORLANDC__ ! #define _M_IX86 300 /* make sure this is defined for Intel CPUs */ ! #endif ! #endif ! ! #ifdef _M_IX86 ! #define LittleEndian 1 /* e.g., 1 for Pentium, 0 for 68K */ ! #define ALIGN32 0 /* need dword alignment? (no for Pentium) */ ! #else /* non-Intel platforms */ ! #define LittleEndian 0 /* (assume big endian */ ! #define ALIGN32 1 /* (assume need alignment for non-Intel) */ ! #endif #if LittleEndian --- 33,39 ---- #endif ! // Change this to compile on a BigEndian machine ! #define LittleEndian 1 ! #define ALIGN32 1 #if LittleEndian |