/[mcrypt]/module-skipjack/lib/mcrypt_modules.h
ViewVC logotype

Diff of /module-skipjack/lib/mcrypt_modules.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by nmav, Sat Sep 16 01:18:19 2000 UTC revision 1.2 by nmav, Sat Oct 7 18:27:38 2000 UTC
# Line 1  Line 1 
1  #define rotl(x,n)   (((x) << ((word32)(n))) | ((x) >> (32 - (word32)(n))))  #define rotl32(x,n)   (((x) << ((word32)(n))) | ((x) >> (32 - (word32)(n))))
2  #define rotr(x,n)   (((x) >> ((word32)(n))) | ((x) << (32 - (word32)(n))))  #define rotr32(x,n)   (((x) >> ((word32)(n))) | ((x) << (32 - (word32)(n))))
3  #define rotl16(x,n)   (((x) << ((word16)(n))) | ((x) >> (16 - (word16)(n))))  #define rotl16(x,n)   (((x) << ((word16)(n))) | ((x) >> (16 - (word16)(n))))
4  #define rotr16(x,n)   (((x) >> ((word16)(n))) | ((x) << (16 - (word16)(n))))  #define rotr16(x,n)   (((x) >> ((word16)(n))) | ((x) << (16 - (word16)(n))))
 #define byteswap(x)     ((rotl(x, 8) & 0x00ff00ff) | (rotr(x, 8) & 0xff00ff00))  
 #define byteswap_16(x)  ((rotl16(x, 8) & 0x00ff) | (rotr16(x, 8) & 0xff00))  
5    
 #define Bzero(x, y) memset(x, 0, y)  
6    /* Use hardware rotations.. when available */
7    #ifdef swap32
8    # define byteswap32(x) swap32(x)
9    #else
10    # ifdef swap_32
11    #  define byteswap32(x) swap_32(x)
12    # else
13    #  ifdef bswap_32
14    #   define byteswap32(x) bswap_32(x)
15    #  else
16    #   define byteswap32(x)        ((rotl32(x, 8) & 0x00ff00ff) | (rotr32(x, 8) & 0xff00ff00))
17    #  endif
18    # endif
19    #endif
20    
21    #ifdef swap16
22    # define byteswap16(x) swap16(x)
23    #else
24    # ifdef swap_16
25    #  define byteswap16(x) swap_16(x)
26    # else
27    #  ifdef bswap_16
28    #   define byteswap16(x) bswap_16(x)
29    #  else
30    #   define byteswap16(x)        ((rotl16(x, 8) & 0x00ff) | (rotr16(x, 8) & 0xff00))
31    #  endif
32    # endif
33    #endif
34    
35    
36    #define Bzero(x, y) memset(x, 0, y)

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26