1 /* 2 portability.h 3 4 This should handle differences in archetectures and stuff and 5 provide 32 bit unsigned values portably and stuff 6 7 */ 8 9 #ifndef PORTABILITY 10 #define PORTABILITY 11 12 typedef unsigned int uint32; 13 14 /*used in twofish3.c*/ 15 #define byte(x,n) ((u1byte)((x) >> (8 * n))) 16 #define rotl(x,n) (((x) << ((int)(n))) | ((x) >> (32 - (int)(n)))) 17 #define rotr(x,n) (((x) >> ((int)(n))) | ((x) << (32 - (int)(n)))) 18 19 20 #ifndef u1byte 21 typedef unsigned char u1byte; /* an 8 bit unsigned character type */ 22 typedef unsigned short u2byte; /* a 16 bit unsigned integer type */ 23 typedef uint32 u4byte; /* a 32 bit unsigned integer type */ 24 typedef char s1byte; /* an 8 bit signed character type */ 25 typedef short s2byte; /* a 16 bit signed integer type */ 26 typedef long s4byte; /* a 32 bit signed integer type */ 27 #endif 28 29 30 31 32 #endif 33