D:/opendownloadmanager/ODM-1.x/FDMCustomized/FDMCustomized_lib/libdes/des_locl.h File Reference

#include <stdio.h>
#include "libdes/des.h"
#include <string.h>

Go to the source code of this file.

Defines

#define bcopy(b1, b2, len)   memcpy(b2, b1, (size_t)(len))
#define bzero(b, len)   memset(b, 0, (size_t)(len))
#define bcmp(b1, b2, len)   memcmp(b1, b2, (size_t)(len))
#define index(s1, char)   strchr(s1,char)
#define const
#define ITERATIONS   16
#define HALF_ITERATIONS   8
#define MAXWRITE   (1024*16)
#define BSIZE   (MAXWRITE+4)
#define c2l(c, l)
#define c2ln(c, l1, l2, n)
#define l2c(l, c)
#define HDRSIZE   4
#define n2l(c, l)
#define l2n(l, c)
#define l2cn(l1, l2, c, n)
#define D_ENCRYPT(L, R, S)
#define PERM_OP(a, b, t, n, m)
#define IP(l, r, t)
#define FP(l, r, t)


Define Documentation

#define bcmp ( b1,
b2,
len   )     memcmp(b1, b2, (size_t)(len))

Definition at line 18 of file des_locl.h.

#define bcopy ( b1,
b2,
len   )     memcpy(b2, b1, (size_t)(len))

Definition at line 16 of file des_locl.h.

#define BSIZE   (MAXWRITE+4)

Definition at line 38 of file des_locl.h.

#define bzero ( b,
len   )     memset(b, 0, (size_t)(len))

Definition at line 17 of file des_locl.h.

#define c2l ( c,
l   ) 

Value:

(l =((unsigned long)(*((c)++)))    , \
                         l|=((unsigned long)(*((c)++)))<< 8, \
                         l|=((unsigned long)(*((c)++)))<<16, \
                         l|=((unsigned long)(*((c)++)))<<24)

Definition at line 40 of file des_locl.h.

Referenced by des_3ecb_encrypt(), des_ecb_encrypt(), des_pcbc_encrypt(), and des_set_key().

#define c2ln ( c,
l1,
l2,
n   ) 

Value:

{ \
                        c+=n; \
                        l1=l2=0; \
                        switch (n) { \
                        case 8: l2 =((unsigned long)(*(--(c))))<<24; \
                        case 7: l2|=((unsigned long)(*(--(c))))<<16; \
                        case 6: l2|=((unsigned long)(*(--(c))))<< 8; \
                        case 5: l2|=((unsigned long)(*(--(c))));     \
                        case 4: l1 =((unsigned long)(*(--(c))))<<24; \
                        case 3: l1|=((unsigned long)(*(--(c))))<<16; \
                        case 2: l1|=((unsigned long)(*(--(c))))<< 8; \
                        case 1: l1|=((unsigned long)(*(--(c))));     \
                                } \
                        }

Definition at line 45 of file des_locl.h.

Referenced by des_pcbc_encrypt().

#define const

Definition at line 22 of file des_locl.h.

#define D_ENCRYPT ( L,
R,
 ) 

Value:

u=(R^s[S  ]); \
        t=R^s[S+1]; \
        t=((t>>4)+(t<<28)); \
        L^=     des_SPtrans[1][(t    )&0x3f]| \
                des_SPtrans[3][(t>> 8)&0x3f]| \
                des_SPtrans[5][(t>>16)&0x3f]| \
                des_SPtrans[7][(t>>24)&0x3f]| \
                des_SPtrans[0][(u    )&0x3f]| \
                des_SPtrans[2][(u>> 8)&0x3f]| \
                des_SPtrans[4][(u>>16)&0x3f]| \
                des_SPtrans[6][(u>>24)&0x3f];

Definition at line 121 of file des_locl.h.

Referenced by des_encrypt().

#define FP ( l,
r,
 ) 

Value:

PERM_OP(l,r,t, 1,0x55555555L); \
        PERM_OP(r,l,t, 8,0x00ff00ffL); \
        PERM_OP(l,r,t, 2,0x33333333L); \
        PERM_OP(r,l,t,16,0x0000ffffL); \
        PERM_OP(l,r,t, 4,0x0f0f0f0fL);

Definition at line 148 of file des_locl.h.

Referenced by des_encrypt().

#define HALF_ITERATIONS   8

Definition at line 35 of file des_locl.h.

#define HDRSIZE   4

Definition at line 65 of file des_locl.h.

#define index ( s1,
char   )     strchr(s1,char)

#define IP ( l,
r,
 ) 

Value:

PERM_OP(r,l,t, 4,0x0f0f0f0fL); \
        PERM_OP(l,r,t,16,0x0000ffffL); \
        PERM_OP(r,l,t, 2,0x33333333L); \
        PERM_OP(l,r,t, 8,0x00ff00ffL); \
        PERM_OP(r,l,t, 1,0x55555555L);

Definition at line 141 of file des_locl.h.

Referenced by des_encrypt().

#define ITERATIONS   16

Definition at line 34 of file des_locl.h.

Referenced by des_set_key().

#define l2c ( l,
c   ) 

Value:

(*((c)++)=(unsigned char)(((l)    )&0xff), \
                         *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
                         *((c)++)=(unsigned char)(((l)>>16)&0xff), \
                         *((c)++)=(unsigned char)(((l)>>24)&0xff))

Definition at line 60 of file des_locl.h.

Referenced by des_3ecb_encrypt(), des_ecb_encrypt(), and des_pcbc_encrypt().

#define l2cn ( l1,
l2,
c,
n   ) 

Value:

{ \
                        c+=n; \
                        switch (n) { \
                        case 8: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
                        case 7: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
                        case 6: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
                        case 5: *(--(c))=(unsigned char)(((l2)    )&0xff); \
                        case 4: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
                        case 3: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
                        case 2: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
                        case 1: *(--(c))=(unsigned char)(((l1)    )&0xff); \
                                } \
                        }

Definition at line 77 of file des_locl.h.

Referenced by des_pcbc_encrypt().

#define l2n ( l,
c   ) 

Value:

(*((c)++)=(unsigned char)(((l)>>24)&0xff), \
                         *((c)++)=(unsigned char)(((l)>>16)&0xff), \
                         *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
                         *((c)++)=(unsigned char)(((l)    )&0xff))

Definition at line 72 of file des_locl.h.

#define MAXWRITE   (1024*16)

Definition at line 37 of file des_locl.h.

#define n2l ( c,
l   ) 

Value:

(l =((unsigned long)(*((c)++)))<<24, \
                         l|=((unsigned long)(*((c)++)))<<16, \
                         l|=((unsigned long)(*((c)++)))<< 8, \
                         l|=((unsigned long)(*((c)++))))

Definition at line 67 of file des_locl.h.

#define PERM_OP ( a,
b,
t,
n,
 ) 

Value:

((t)=((((a)>>(n))^(b))&(m)),\
        (b)^=(t),\
        (a)^=((t)<<(n)))

Definition at line 137 of file des_locl.h.

Referenced by des_set_key().


Generated on Sun May 25 00:19:50 2008 by  doxygen 1.5.6