Go to the documentation of this file.
62 #define idea_mul(r,a,b,ul) \
63 ul=(unsigned long)a*b; \
66 r=(ul&0xffff)-(ul>>16); \
86 #define n2ln(c,l1,l2,n) { \
90 case 8: l2 =((unsigned long)(*(--(c)))) ; \
91 case 7: l2|=((unsigned long)(*(--(c))))<< 8; \
92 case 6: l2|=((unsigned long)(*(--(c))))<<16; \
93 case 5: l2|=((unsigned long)(*(--(c))))<<24; \
94 case 4: l1 =((unsigned long)(*(--(c)))) ; \
95 case 3: l1|=((unsigned long)(*(--(c))))<< 8; \
96 case 2: l1|=((unsigned long)(*(--(c))))<<16; \
97 case 1: l1|=((unsigned long)(*(--(c))))<<24; \
102 #define l2nn(l1,l2,c,n) { \
105 case 8: *(--(c))=(unsigned char)(((l2) )&0xff); \
106 case 7: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
107 case 6: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
108 case 5: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
109 case 4: *(--(c))=(unsigned char)(((l1) )&0xff); \
110 case 3: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
111 case 2: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
112 case 1: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
117 #define n2l(c,l) (l =((unsigned long)(*((c)++)))<<24L, \
118 l|=((unsigned long)(*((c)++)))<<16L, \
119 l|=((unsigned long)(*((c)++)))<< 8L, \
120 l|=((unsigned long)(*((c)++))))
123 #define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
124 *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
125 *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
126 *((c)++)=(unsigned char)(((l) )&0xff))
129 #define s2n(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
130 *((c)++)=(unsigned char)(((l)>> 8L)&0xff))
133 #define n2s(c,l) (l =((IDEA_INT)(*((c)++)))<< 8L, \
134 l|=((IDEA_INT)(*((c)++))) )
138 #define c2ln(c,l1,l2,n) { \
142 case 8: l2 =((unsigned long)(*(--(c))))<<24; \
143 case 7: l2|=((unsigned long)(*(--(c))))<<16; \
144 case 6: l2|=((unsigned long)(*(--(c))))<< 8; \
145 case 5: l2|=((unsigned long)(*(--(c)))); \
146 case 4: l1 =((unsigned long)(*(--(c))))<<24; \
147 case 3: l1|=((unsigned long)(*(--(c))))<<16; \
148 case 2: l1|=((unsigned long)(*(--(c))))<< 8; \
149 case 1: l1|=((unsigned long)(*(--(c)))); \
154 #define l2cn(l1,l2,c,n) { \
157 case 8: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
158 case 7: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
159 case 6: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
160 case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
161 case 4: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
162 case 3: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
163 case 2: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
164 case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
169 #define c2s(c,l) (l =((unsigned long)(*((c)++))) , \
170 l|=((unsigned long)(*((c)++)))<< 8L)
173 #define s2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
174 *((c)++)=(unsigned char)(((l)>> 8L)&0xff))
177 #define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
178 l|=((unsigned long)(*((c)++)))<< 8L, \
179 l|=((unsigned long)(*((c)++)))<<16L, \
180 l|=((unsigned long)(*((c)++)))<<24L)
183 #define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
184 *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
185 *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
186 *((c)++)=(unsigned char)(((l)>>24L)&0xff))
189 #define E_IDEA(num) \
191 idea_mul(x1,x1,*p,ul); p++; \
195 idea_mul(x4,x4,*p,ul); p++; \
197 idea_mul(t0,t0,*p,ul); p++; \
198 t1=(t0+(x2^x4))&0xffff; \
199 idea_mul(t1,t1,*p,ul); p++; \