Lines Matching +full:left +full:- +full:right
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * des3_ede-asm_64.S - x86-64 assembly implementation of 3DES cipher
10 .file "des3_ede-asm_64.S"
68 * 1-way 3DES
92 #define initial_permutation(left, right) \ argument
93 do_permutation(left##d, right##d, 4, 0x0f0f0f0f); \
94 do_permutation(left##d, right##d, 16, 0x0000ffff); \
95 do_permutation(right##d, left##d, 2, 0x33333333); \
96 do_permutation(right##d, left##d, 8, 0x00ff00ff); \
98 movl left##d, RW0d; \
99 roll $1, right##d; \
100 xorl right##d, RW0d; \
102 xorl RW0d, left##d; \
103 xorl RW0d, right##d; \
104 roll $1, left##d; \
105 expand_to_64bits(right, RT3); \
106 expand_to_64bits(left, RT3);
108 #define final_permutation(left, right) \ argument
109 compress_to_64bits(right); \
110 compress_to_64bits(left); \
111 movl right##d, RW0d; \
112 rorl $1, left##d; \
113 xorl left##d, RW0d; \
115 xorl RW0d, right##d; \
116 xorl RW0d, left##d; \
117 rorl $1, right##d; \
118 do_permutation(right##d, left##d, 8, 0x00ff00ff); \
119 do_permutation(right##d, left##d, 2, 0x33333333); \
120 do_permutation(left##d, right##d, 16, 0x0000ffff); \
121 do_permutation(left##d, right##d, 4, 0x0f0f0f0f);
153 #define read_block(io, left, right) \ argument
154 movl (io), left##d; \
155 movl 4(io), right##d; \
156 bswapl left##d; \
157 bswapl right##d;
159 #define write_block(io, left, right) \ argument
160 bswapl left##d; \
161 bswapl right##d; \
162 movl left##d, (io); \
163 movl right##d, 4(io);
250 * 3-way 3DES
265 #define initial_permutation3(left, right) \ argument
266 do_permutation(left##0d, right##0d, 4, 0x0f0f0f0f); \
267 do_permutation(left##0d, right##0d, 16, 0x0000ffff); \
268 do_permutation(left##1d, right##1d, 4, 0x0f0f0f0f); \
269 do_permutation(left##1d, right##1d, 16, 0x0000ffff); \
270 do_permutation(left##2d, right##2d, 4, 0x0f0f0f0f); \
271 do_permutation(left##2d, right##2d, 16, 0x0000ffff); \
273 do_permutation(right##0d, left##0d, 2, 0x33333333); \
274 do_permutation(right##0d, left##0d, 8, 0x00ff00ff); \
275 do_permutation(right##1d, left##1d, 2, 0x33333333); \
276 do_permutation(right##1d, left##1d, 8, 0x00ff00ff); \
277 do_permutation(right##2d, left##2d, 2, 0x33333333); \
278 do_permutation(right##2d, left##2d, 8, 0x00ff00ff); \
282 movl left##0d, RW0d; \
283 roll $1, right##0d; \
284 xorl right##0d, RW0d; \
286 xorl RW0d, left##0d; \
287 xorl RW0d, right##0d; \
288 roll $1, left##0d; \
289 expand_to_64bits(right##0, RT3); \
290 expand_to_64bits(left##0, RT3); \
291 movl left##1d, RW1d; \
292 roll $1, right##1d; \
293 xorl right##1d, RW1d; \
295 xorl RW1d, left##1d; \
296 xorl RW1d, right##1d; \
297 roll $1, left##1d; \
298 expand_to_64bits(right##1, RT3); \
299 expand_to_64bits(left##1, RT3); \
300 movl left##2d, RW2d; \
301 roll $1, right##2d; \
302 xorl right##2d, RW2d; \
304 xorl RW2d, left##2d; \
305 xorl RW2d, right##2d; \
306 roll $1, left##2d; \
307 expand_to_64bits(right##2, RT3); \
308 expand_to_64bits(left##2, RT3);
310 #define final_permutation3(left, right) \ argument
311 compress_to_64bits(right##0); \
312 compress_to_64bits(left##0); \
313 movl right##0d, RW0d; \
314 rorl $1, left##0d; \
315 xorl left##0d, RW0d; \
317 xorl RW0d, right##0d; \
318 xorl RW0d, left##0d; \
319 rorl $1, right##0d; \
320 compress_to_64bits(right##1); \
321 compress_to_64bits(left##1); \
322 movl right##1d, RW1d; \
323 rorl $1, left##1d; \
324 xorl left##1d, RW1d; \
326 xorl RW1d, right##1d; \
327 xorl RW1d, left##1d; \
328 rorl $1, right##1d; \
329 compress_to_64bits(right##2); \
330 compress_to_64bits(left##2); \
331 movl right##2d, RW2d; \
332 rorl $1, left##2d; \
333 xorl left##2d, RW2d; \
335 xorl RW2d, right##2d; \
336 xorl RW2d, left##2d; \
337 rorl $1, right##2d; \
339 do_permutation(right##0d, left##0d, 8, 0x00ff00ff); \
340 do_permutation(right##0d, left##0d, 2, 0x33333333); \
341 do_permutation(right##1d, left##1d, 8, 0x00ff00ff); \
342 do_permutation(right##1d, left##1d, 2, 0x33333333); \
343 do_permutation(right##2d, left##2d, 8, 0x00ff00ff); \
344 do_permutation(right##2d, left##2d, 2, 0x33333333); \
346 do_permutation(left##0d, right##0d, 16, 0x0000ffff); \
347 do_permutation(left##0d, right##0d, 4, 0x0f0f0f0f); \
348 do_permutation(left##1d, right##1d, 16, 0x0000ffff); \
349 do_permutation(left##1d, right##1d, 4, 0x0f0f0f0f); \
350 do_permutation(left##2d, right##2d, 16, 0x0000ffff); \
351 do_permutation(left##2d, right##2d, 4, 0x0f0f0f0f);