Lines Matching +full:a +full:- +full:8
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
7 .file "twofish-x86_64-asm.S"
12 #include <asm/asm-offsets.h>
16 #define c_offset 8
25 #define w 4096 /* 8 whitening keys (word) */
26 #define k 4128 /* key 1-32 ( word ) */
28 /* define a few register aliases to allow macro substitution */
61 * a input register containing a (rotated 16)
65 * operations on a and b are interleaved to increase performance
67 #define encrypt_round(a,b,c,d,round)\
70 movzx a ## B, %edi;\
75 movzx a ## H, %edi;\
76 ror $16, a ## D;\
80 movzx a ## B, %edi;\
85 movzx a ## H, %edi;\
96 * a input register containing a(rotated 16)
100 * operations on a and b are interleaved to increase performance
101 * during the round a and b are prepared for the output whitening
103 #define encrypt_last_round(a,b,c,d,round)\
108 movzx a ## B, %edi;\
113 movzx a ## H, %edi;\
114 ror $16, a ## D;\
118 movzx a ## B, %edi;\
120 xor a, %r10;\
123 movzx a ## H, %edi;\
134 * a input register containing a
138 * operations on a and b are interleaved to increase performance
140 #define decrypt_round(a,b,c,d,round)\
141 movzx a ## B, %edi;\
145 movzx a ## H, %edi;\
146 ror $16, a ## D;\
151 movzx a ## B, %edi;\
155 movzx a ## H, %edi;\
156 ror $15, a ## D;\
169 * a input register containing a
173 * operations on a and b are interleaved to increase performance
174 * during the round a and b are prepared for the output whitening
176 #define decrypt_last_round(a,b,c,d,round)\
177 movzx a ## B, %edi;\
184 movzx a ## H, %edi;\
187 xor a, %r10;\
188 ror $16, a ## D;\
192 movzx a ## B, %edi;\
196 movzx a ## H, %edi;\
212 /* ctx address is moved to free one non-rex register
213 as target for the 8bit high operations */
217 movq 8(R3), R3
228 encrypt_round(R2,R3,R0,R1,8);
229 encrypt_round(R0,R1,R2,R3,2*8);
230 encrypt_round(R2,R3,R0,R1,3*8);
231 encrypt_round(R0,R1,R2,R3,4*8);
232 encrypt_round(R2,R3,R0,R1,5*8);
233 encrypt_round(R0,R1,R2,R3,6*8);
234 encrypt_round(R2,R3,R0,R1,7*8);
235 encrypt_round(R0,R1,R2,R3,8*8);
236 encrypt_round(R2,R3,R0,R1,9*8);
237 encrypt_round(R0,R1,R2,R3,10*8);
238 encrypt_round(R2,R3,R0,R1,11*8);
239 encrypt_round(R0,R1,R2,R3,12*8);
240 encrypt_round(R2,R3,R0,R1,13*8);
241 encrypt_round(R0,R1,R2,R3,14*8);
242 encrypt_last_round(R2,R3,R0,R1,15*8);
252 movq R1, 8(%rsi)
265 /* ctx address is moved to free one non-rex register
266 as target for the 8bit high operations */
270 movq 8(R3), R3
280 decrypt_round(R0,R1,R2,R3,15*8);
281 decrypt_round(R2,R3,R0,R1,14*8);
282 decrypt_round(R0,R1,R2,R3,13*8);
283 decrypt_round(R2,R3,R0,R1,12*8);
284 decrypt_round(R0,R1,R2,R3,11*8);
285 decrypt_round(R2,R3,R0,R1,10*8);
286 decrypt_round(R0,R1,R2,R3,9*8);
287 decrypt_round(R2,R3,R0,R1,8*8);
288 decrypt_round(R0,R1,R2,R3,7*8);
289 decrypt_round(R2,R3,R0,R1,6*8);
290 decrypt_round(R0,R1,R2,R3,5*8);
291 decrypt_round(R2,R3,R0,R1,4*8);
292 decrypt_round(R0,R1,R2,R3,3*8);
293 decrypt_round(R2,R3,R0,R1,2*8);
294 decrypt_round(R0,R1,R2,R3,1*8);
304 movq R1, 8(%rsi)