diff options
Diffstat (limited to 'src/lib/libcrypto/idea/idea_lcl.h')
-rw-r--r-- | src/lib/libcrypto/idea/idea_lcl.h | 67 |
1 files changed, 1 insertions, 66 deletions
diff --git a/src/lib/libcrypto/idea/idea_lcl.h b/src/lib/libcrypto/idea/idea_lcl.h index cc58b360ad..e46c960875 100644 --- a/src/lib/libcrypto/idea/idea_lcl.h +++ b/src/lib/libcrypto/idea/idea_lcl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: idea_lcl.h,v 1.2 2014/06/12 15:49:29 deraadt Exp $ */ | 1 | /* $OpenBSD: idea_lcl.h,v 1.3 2015/02/07 13:19:15 doug Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -69,18 +69,6 @@ if (ul != 0) \ | |||
69 | else \ | 69 | else \ |
70 | r=(-(int)a-b+1); /* assuming a or b is 0 and in range */ | 70 | r=(-(int)a-b+1); /* assuming a or b is 0 and in range */ |
71 | 71 | ||
72 | #ifdef undef | ||
73 | #define idea_mul(r,a,b,ul,sl) \ | ||
74 | if (a == 0) r=(0x10001-b)&0xffff; \ | ||
75 | else if (b == 0) r=(0x10001-a)&0xffff; \ | ||
76 | else { \ | ||
77 | ul=(unsigned long)a*b; \ | ||
78 | sl=(ul&0xffff)-(ul>>16); \ | ||
79 | if (sl <= 0) sl+=0x10001; \ | ||
80 | r=sl; \ | ||
81 | } | ||
82 | #endif | ||
83 | |||
84 | /* 7/12/95 - Many thanks to Rhys Weatherley <rweather@us.oracle.com> | 72 | /* 7/12/95 - Many thanks to Rhys Weatherley <rweather@us.oracle.com> |
85 | * for pointing out that I was assuming little endian | 73 | * for pointing out that I was assuming little endian |
86 | * byte order for all quantities what idea | 74 | * byte order for all quantities what idea |
@@ -142,59 +130,6 @@ else { \ | |||
142 | #define n2s(c,l) (l =((IDEA_INT)(*((c)++)))<< 8L, \ | 130 | #define n2s(c,l) (l =((IDEA_INT)(*((c)++)))<< 8L, \ |
143 | l|=((IDEA_INT)(*((c)++))) ) | 131 | l|=((IDEA_INT)(*((c)++))) ) |
144 | 132 | ||
145 | #ifdef undef | ||
146 | /* NOTE - c is not incremented as per c2l */ | ||
147 | #define c2ln(c,l1,l2,n) { \ | ||
148 | c+=n; \ | ||
149 | l1=l2=0; \ | ||
150 | switch (n) { \ | ||
151 | case 8: l2 =((unsigned long)(*(--(c))))<<24; \ | ||
152 | case 7: l2|=((unsigned long)(*(--(c))))<<16; \ | ||
153 | case 6: l2|=((unsigned long)(*(--(c))))<< 8; \ | ||
154 | case 5: l2|=((unsigned long)(*(--(c)))); \ | ||
155 | case 4: l1 =((unsigned long)(*(--(c))))<<24; \ | ||
156 | case 3: l1|=((unsigned long)(*(--(c))))<<16; \ | ||
157 | case 2: l1|=((unsigned long)(*(--(c))))<< 8; \ | ||
158 | case 1: l1|=((unsigned long)(*(--(c)))); \ | ||
159 | } \ | ||
160 | } | ||
161 | |||
162 | /* NOTE - c is not incremented as per l2c */ | ||
163 | #define l2cn(l1,l2,c,n) { \ | ||
164 | c+=n; \ | ||
165 | switch (n) { \ | ||
166 | case 8: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \ | ||
167 | case 7: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \ | ||
168 | case 6: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \ | ||
169 | case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \ | ||
170 | case 4: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \ | ||
171 | case 3: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \ | ||
172 | case 2: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \ | ||
173 | case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \ | ||
174 | } \ | ||
175 | } | ||
176 | |||
177 | #undef c2s | ||
178 | #define c2s(c,l) (l =((unsigned long)(*((c)++))) , \ | ||
179 | l|=((unsigned long)(*((c)++)))<< 8L) | ||
180 | |||
181 | #undef s2c | ||
182 | #define s2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \ | ||
183 | *((c)++)=(unsigned char)(((l)>> 8L)&0xff)) | ||
184 | |||
185 | #undef c2l | ||
186 | #define c2l(c,l) (l =((unsigned long)(*((c)++))) , \ | ||
187 | l|=((unsigned long)(*((c)++)))<< 8L, \ | ||
188 | l|=((unsigned long)(*((c)++)))<<16L, \ | ||
189 | l|=((unsigned long)(*((c)++)))<<24L) | ||
190 | |||
191 | #undef l2c | ||
192 | #define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \ | ||
193 | *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \ | ||
194 | *((c)++)=(unsigned char)(((l)>>16L)&0xff), \ | ||
195 | *((c)++)=(unsigned char)(((l)>>24L)&0xff)) | ||
196 | #endif | ||
197 | |||
198 | #define E_IDEA(num) \ | 133 | #define E_IDEA(num) \ |
199 | x1&=0xffff; \ | 134 | x1&=0xffff; \ |
200 | idea_mul(x1,x1,*p,ul); p++; \ | 135 | idea_mul(x1,x1,*p,ul); p++; \ |