Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: third_party/boringssl/mac-x86/crypto/aes/aesni-x86.S

Issue 377783004: Add BoringSSL GYP files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final Python fix. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #if defined(__i386__)
2 .file "src/crypto/aes/asm/aesni-x86.S"
3 .text
4 .globl _aesni_encrypt
5 .align 4
6 _aesni_encrypt:
7 L_aesni_encrypt_begin:
8 movl 4(%esp),%eax
9 movl 12(%esp),%edx
10 movups (%eax),%xmm2
11 movl 240(%edx),%ecx
12 movl 8(%esp),%eax
13 movups (%edx),%xmm0
14 movups 16(%edx),%xmm1
15 leal 32(%edx),%edx
16 xorps %xmm0,%xmm2
17 L000enc1_loop_1:
18 .byte 102,15,56,220,209
19 decl %ecx
20 movups (%edx),%xmm1
21 leal 16(%edx),%edx
22 jnz L000enc1_loop_1
23 .byte 102,15,56,221,209
24 movups %xmm2,(%eax)
25 ret
26 .globl _aesni_decrypt
27 .align 4
28 _aesni_decrypt:
29 L_aesni_decrypt_begin:
30 movl 4(%esp),%eax
31 movl 12(%esp),%edx
32 movups (%eax),%xmm2
33 movl 240(%edx),%ecx
34 movl 8(%esp),%eax
35 movups (%edx),%xmm0
36 movups 16(%edx),%xmm1
37 leal 32(%edx),%edx
38 xorps %xmm0,%xmm2
39 L001dec1_loop_2:
40 .byte 102,15,56,222,209
41 decl %ecx
42 movups (%edx),%xmm1
43 leal 16(%edx),%edx
44 jnz L001dec1_loop_2
45 .byte 102,15,56,223,209
46 movups %xmm2,(%eax)
47 ret
48 .align 4
49 __aesni_encrypt2:
50 movups (%edx),%xmm0
51 shll $4,%ecx
52 movups 16(%edx),%xmm1
53 xorps %xmm0,%xmm2
54 pxor %xmm0,%xmm3
55 movups 32(%edx),%xmm0
56 leal 32(%edx,%ecx,1),%edx
57 negl %ecx
58 addl $16,%ecx
59 L002enc2_loop:
60 .byte 102,15,56,220,209
61 .byte 102,15,56,220,217
62 movups (%edx,%ecx,1),%xmm1
63 addl $32,%ecx
64 .byte 102,15,56,220,208
65 .byte 102,15,56,220,216
66 movups -16(%edx,%ecx,1),%xmm0
67 jnz L002enc2_loop
68 .byte 102,15,56,220,209
69 .byte 102,15,56,220,217
70 .byte 102,15,56,221,208
71 .byte 102,15,56,221,216
72 ret
73 .align 4
74 __aesni_decrypt2:
75 movups (%edx),%xmm0
76 shll $4,%ecx
77 movups 16(%edx),%xmm1
78 xorps %xmm0,%xmm2
79 pxor %xmm0,%xmm3
80 movups 32(%edx),%xmm0
81 leal 32(%edx,%ecx,1),%edx
82 negl %ecx
83 addl $16,%ecx
84 L003dec2_loop:
85 .byte 102,15,56,222,209
86 .byte 102,15,56,222,217
87 movups (%edx,%ecx,1),%xmm1
88 addl $32,%ecx
89 .byte 102,15,56,222,208
90 .byte 102,15,56,222,216
91 movups -16(%edx,%ecx,1),%xmm0
92 jnz L003dec2_loop
93 .byte 102,15,56,222,209
94 .byte 102,15,56,222,217
95 .byte 102,15,56,223,208
96 .byte 102,15,56,223,216
97 ret
98 .align 4
99 __aesni_encrypt3:
100 movups (%edx),%xmm0
101 shll $4,%ecx
102 movups 16(%edx),%xmm1
103 xorps %xmm0,%xmm2
104 pxor %xmm0,%xmm3
105 pxor %xmm0,%xmm4
106 movups 32(%edx),%xmm0
107 leal 32(%edx,%ecx,1),%edx
108 negl %ecx
109 addl $16,%ecx
110 L004enc3_loop:
111 .byte 102,15,56,220,209
112 .byte 102,15,56,220,217
113 .byte 102,15,56,220,225
114 movups (%edx,%ecx,1),%xmm1
115 addl $32,%ecx
116 .byte 102,15,56,220,208
117 .byte 102,15,56,220,216
118 .byte 102,15,56,220,224
119 movups -16(%edx,%ecx,1),%xmm0
120 jnz L004enc3_loop
121 .byte 102,15,56,220,209
122 .byte 102,15,56,220,217
123 .byte 102,15,56,220,225
124 .byte 102,15,56,221,208
125 .byte 102,15,56,221,216
126 .byte 102,15,56,221,224
127 ret
128 .align 4
129 __aesni_decrypt3:
130 movups (%edx),%xmm0
131 shll $4,%ecx
132 movups 16(%edx),%xmm1
133 xorps %xmm0,%xmm2
134 pxor %xmm0,%xmm3
135 pxor %xmm0,%xmm4
136 movups 32(%edx),%xmm0
137 leal 32(%edx,%ecx,1),%edx
138 negl %ecx
139 addl $16,%ecx
140 L005dec3_loop:
141 .byte 102,15,56,222,209
142 .byte 102,15,56,222,217
143 .byte 102,15,56,222,225
144 movups (%edx,%ecx,1),%xmm1
145 addl $32,%ecx
146 .byte 102,15,56,222,208
147 .byte 102,15,56,222,216
148 .byte 102,15,56,222,224
149 movups -16(%edx,%ecx,1),%xmm0
150 jnz L005dec3_loop
151 .byte 102,15,56,222,209
152 .byte 102,15,56,222,217
153 .byte 102,15,56,222,225
154 .byte 102,15,56,223,208
155 .byte 102,15,56,223,216
156 .byte 102,15,56,223,224
157 ret
158 .align 4
159 __aesni_encrypt4:
160 movups (%edx),%xmm0
161 movups 16(%edx),%xmm1
162 shll $4,%ecx
163 xorps %xmm0,%xmm2
164 pxor %xmm0,%xmm3
165 pxor %xmm0,%xmm4
166 pxor %xmm0,%xmm5
167 movups 32(%edx),%xmm0
168 leal 32(%edx,%ecx,1),%edx
169 negl %ecx
170 .byte 15,31,64,0
171 addl $16,%ecx
172 L006enc4_loop:
173 .byte 102,15,56,220,209
174 .byte 102,15,56,220,217
175 .byte 102,15,56,220,225
176 .byte 102,15,56,220,233
177 movups (%edx,%ecx,1),%xmm1
178 addl $32,%ecx
179 .byte 102,15,56,220,208
180 .byte 102,15,56,220,216
181 .byte 102,15,56,220,224
182 .byte 102,15,56,220,232
183 movups -16(%edx,%ecx,1),%xmm0
184 jnz L006enc4_loop
185 .byte 102,15,56,220,209
186 .byte 102,15,56,220,217
187 .byte 102,15,56,220,225
188 .byte 102,15,56,220,233
189 .byte 102,15,56,221,208
190 .byte 102,15,56,221,216
191 .byte 102,15,56,221,224
192 .byte 102,15,56,221,232
193 ret
194 .align 4
195 __aesni_decrypt4:
196 movups (%edx),%xmm0
197 movups 16(%edx),%xmm1
198 shll $4,%ecx
199 xorps %xmm0,%xmm2
200 pxor %xmm0,%xmm3
201 pxor %xmm0,%xmm4
202 pxor %xmm0,%xmm5
203 movups 32(%edx),%xmm0
204 leal 32(%edx,%ecx,1),%edx
205 negl %ecx
206 .byte 15,31,64,0
207 addl $16,%ecx
208 L007dec4_loop:
209 .byte 102,15,56,222,209
210 .byte 102,15,56,222,217
211 .byte 102,15,56,222,225
212 .byte 102,15,56,222,233
213 movups (%edx,%ecx,1),%xmm1
214 addl $32,%ecx
215 .byte 102,15,56,222,208
216 .byte 102,15,56,222,216
217 .byte 102,15,56,222,224
218 .byte 102,15,56,222,232
219 movups -16(%edx,%ecx,1),%xmm0
220 jnz L007dec4_loop
221 .byte 102,15,56,222,209
222 .byte 102,15,56,222,217
223 .byte 102,15,56,222,225
224 .byte 102,15,56,222,233
225 .byte 102,15,56,223,208
226 .byte 102,15,56,223,216
227 .byte 102,15,56,223,224
228 .byte 102,15,56,223,232
229 ret
230 .align 4
231 __aesni_encrypt6:
232 movups (%edx),%xmm0
233 shll $4,%ecx
234 movups 16(%edx),%xmm1
235 xorps %xmm0,%xmm2
236 pxor %xmm0,%xmm3
237 pxor %xmm0,%xmm4
238 .byte 102,15,56,220,209
239 pxor %xmm0,%xmm5
240 pxor %xmm0,%xmm6
241 .byte 102,15,56,220,217
242 leal 32(%edx,%ecx,1),%edx
243 negl %ecx
244 .byte 102,15,56,220,225
245 pxor %xmm0,%xmm7
246 addl $16,%ecx
247 .byte 102,15,56,220,233
248 .byte 102,15,56,220,241
249 .byte 102,15,56,220,249
250 movups -16(%edx,%ecx,1),%xmm0
251 jmp L_aesni_encrypt6_enter
252 .align 4,0x90
253 L008enc6_loop:
254 .byte 102,15,56,220,209
255 .byte 102,15,56,220,217
256 .byte 102,15,56,220,225
257 .byte 102,15,56,220,233
258 .byte 102,15,56,220,241
259 .byte 102,15,56,220,249
260 L_aesni_encrypt6_enter:
261 movups (%edx,%ecx,1),%xmm1
262 addl $32,%ecx
263 .byte 102,15,56,220,208
264 .byte 102,15,56,220,216
265 .byte 102,15,56,220,224
266 .byte 102,15,56,220,232
267 .byte 102,15,56,220,240
268 .byte 102,15,56,220,248
269 movups -16(%edx,%ecx,1),%xmm0
270 jnz L008enc6_loop
271 .byte 102,15,56,220,209
272 .byte 102,15,56,220,217
273 .byte 102,15,56,220,225
274 .byte 102,15,56,220,233
275 .byte 102,15,56,220,241
276 .byte 102,15,56,220,249
277 .byte 102,15,56,221,208
278 .byte 102,15,56,221,216
279 .byte 102,15,56,221,224
280 .byte 102,15,56,221,232
281 .byte 102,15,56,221,240
282 .byte 102,15,56,221,248
283 ret
284 .align 4
285 __aesni_decrypt6:
286 movups (%edx),%xmm0
287 shll $4,%ecx
288 movups 16(%edx),%xmm1
289 xorps %xmm0,%xmm2
290 pxor %xmm0,%xmm3
291 pxor %xmm0,%xmm4
292 .byte 102,15,56,222,209
293 pxor %xmm0,%xmm5
294 pxor %xmm0,%xmm6
295 .byte 102,15,56,222,217
296 leal 32(%edx,%ecx,1),%edx
297 negl %ecx
298 .byte 102,15,56,222,225
299 pxor %xmm0,%xmm7
300 addl $16,%ecx
301 .byte 102,15,56,222,233
302 .byte 102,15,56,222,241
303 .byte 102,15,56,222,249
304 movups -16(%edx,%ecx,1),%xmm0
305 jmp L_aesni_decrypt6_enter
306 .align 4,0x90
307 L009dec6_loop:
308 .byte 102,15,56,222,209
309 .byte 102,15,56,222,217
310 .byte 102,15,56,222,225
311 .byte 102,15,56,222,233
312 .byte 102,15,56,222,241
313 .byte 102,15,56,222,249
314 L_aesni_decrypt6_enter:
315 movups (%edx,%ecx,1),%xmm1
316 addl $32,%ecx
317 .byte 102,15,56,222,208
318 .byte 102,15,56,222,216
319 .byte 102,15,56,222,224
320 .byte 102,15,56,222,232
321 .byte 102,15,56,222,240
322 .byte 102,15,56,222,248
323 movups -16(%edx,%ecx,1),%xmm0
324 jnz L009dec6_loop
325 .byte 102,15,56,222,209
326 .byte 102,15,56,222,217
327 .byte 102,15,56,222,225
328 .byte 102,15,56,222,233
329 .byte 102,15,56,222,241
330 .byte 102,15,56,222,249
331 .byte 102,15,56,223,208
332 .byte 102,15,56,223,216
333 .byte 102,15,56,223,224
334 .byte 102,15,56,223,232
335 .byte 102,15,56,223,240
336 .byte 102,15,56,223,248
337 ret
338 .globl _aesni_ecb_encrypt
339 .align 4
340 _aesni_ecb_encrypt:
341 L_aesni_ecb_encrypt_begin:
342 pushl %ebp
343 pushl %ebx
344 pushl %esi
345 pushl %edi
346 movl 20(%esp),%esi
347 movl 24(%esp),%edi
348 movl 28(%esp),%eax
349 movl 32(%esp),%edx
350 movl 36(%esp),%ebx
351 andl $-16,%eax
352 jz L010ecb_ret
353 movl 240(%edx),%ecx
354 testl %ebx,%ebx
355 jz L011ecb_decrypt
356 movl %edx,%ebp
357 movl %ecx,%ebx
358 cmpl $96,%eax
359 jb L012ecb_enc_tail
360 movdqu (%esi),%xmm2
361 movdqu 16(%esi),%xmm3
362 movdqu 32(%esi),%xmm4
363 movdqu 48(%esi),%xmm5
364 movdqu 64(%esi),%xmm6
365 movdqu 80(%esi),%xmm7
366 leal 96(%esi),%esi
367 subl $96,%eax
368 jmp L013ecb_enc_loop6_enter
369 .align 4,0x90
370 L014ecb_enc_loop6:
371 movups %xmm2,(%edi)
372 movdqu (%esi),%xmm2
373 movups %xmm3,16(%edi)
374 movdqu 16(%esi),%xmm3
375 movups %xmm4,32(%edi)
376 movdqu 32(%esi),%xmm4
377 movups %xmm5,48(%edi)
378 movdqu 48(%esi),%xmm5
379 movups %xmm6,64(%edi)
380 movdqu 64(%esi),%xmm6
381 movups %xmm7,80(%edi)
382 leal 96(%edi),%edi
383 movdqu 80(%esi),%xmm7
384 leal 96(%esi),%esi
385 L013ecb_enc_loop6_enter:
386 call __aesni_encrypt6
387 movl %ebp,%edx
388 movl %ebx,%ecx
389 subl $96,%eax
390 jnc L014ecb_enc_loop6
391 movups %xmm2,(%edi)
392 movups %xmm3,16(%edi)
393 movups %xmm4,32(%edi)
394 movups %xmm5,48(%edi)
395 movups %xmm6,64(%edi)
396 movups %xmm7,80(%edi)
397 leal 96(%edi),%edi
398 addl $96,%eax
399 jz L010ecb_ret
400 L012ecb_enc_tail:
401 movups (%esi),%xmm2
402 cmpl $32,%eax
403 jb L015ecb_enc_one
404 movups 16(%esi),%xmm3
405 je L016ecb_enc_two
406 movups 32(%esi),%xmm4
407 cmpl $64,%eax
408 jb L017ecb_enc_three
409 movups 48(%esi),%xmm5
410 je L018ecb_enc_four
411 movups 64(%esi),%xmm6
412 xorps %xmm7,%xmm7
413 call __aesni_encrypt6
414 movups %xmm2,(%edi)
415 movups %xmm3,16(%edi)
416 movups %xmm4,32(%edi)
417 movups %xmm5,48(%edi)
418 movups %xmm6,64(%edi)
419 jmp L010ecb_ret
420 .align 4,0x90
421 L015ecb_enc_one:
422 movups (%edx),%xmm0
423 movups 16(%edx),%xmm1
424 leal 32(%edx),%edx
425 xorps %xmm0,%xmm2
426 L019enc1_loop_3:
427 .byte 102,15,56,220,209
428 decl %ecx
429 movups (%edx),%xmm1
430 leal 16(%edx),%edx
431 jnz L019enc1_loop_3
432 .byte 102,15,56,221,209
433 movups %xmm2,(%edi)
434 jmp L010ecb_ret
435 .align 4,0x90
436 L016ecb_enc_two:
437 call __aesni_encrypt2
438 movups %xmm2,(%edi)
439 movups %xmm3,16(%edi)
440 jmp L010ecb_ret
441 .align 4,0x90
442 L017ecb_enc_three:
443 call __aesni_encrypt3
444 movups %xmm2,(%edi)
445 movups %xmm3,16(%edi)
446 movups %xmm4,32(%edi)
447 jmp L010ecb_ret
448 .align 4,0x90
449 L018ecb_enc_four:
450 call __aesni_encrypt4
451 movups %xmm2,(%edi)
452 movups %xmm3,16(%edi)
453 movups %xmm4,32(%edi)
454 movups %xmm5,48(%edi)
455 jmp L010ecb_ret
456 .align 4,0x90
457 L011ecb_decrypt:
458 movl %edx,%ebp
459 movl %ecx,%ebx
460 cmpl $96,%eax
461 jb L020ecb_dec_tail
462 movdqu (%esi),%xmm2
463 movdqu 16(%esi),%xmm3
464 movdqu 32(%esi),%xmm4
465 movdqu 48(%esi),%xmm5
466 movdqu 64(%esi),%xmm6
467 movdqu 80(%esi),%xmm7
468 leal 96(%esi),%esi
469 subl $96,%eax
470 jmp L021ecb_dec_loop6_enter
471 .align 4,0x90
472 L022ecb_dec_loop6:
473 movups %xmm2,(%edi)
474 movdqu (%esi),%xmm2
475 movups %xmm3,16(%edi)
476 movdqu 16(%esi),%xmm3
477 movups %xmm4,32(%edi)
478 movdqu 32(%esi),%xmm4
479 movups %xmm5,48(%edi)
480 movdqu 48(%esi),%xmm5
481 movups %xmm6,64(%edi)
482 movdqu 64(%esi),%xmm6
483 movups %xmm7,80(%edi)
484 leal 96(%edi),%edi
485 movdqu 80(%esi),%xmm7
486 leal 96(%esi),%esi
487 L021ecb_dec_loop6_enter:
488 call __aesni_decrypt6
489 movl %ebp,%edx
490 movl %ebx,%ecx
491 subl $96,%eax
492 jnc L022ecb_dec_loop6
493 movups %xmm2,(%edi)
494 movups %xmm3,16(%edi)
495 movups %xmm4,32(%edi)
496 movups %xmm5,48(%edi)
497 movups %xmm6,64(%edi)
498 movups %xmm7,80(%edi)
499 leal 96(%edi),%edi
500 addl $96,%eax
501 jz L010ecb_ret
502 L020ecb_dec_tail:
503 movups (%esi),%xmm2
504 cmpl $32,%eax
505 jb L023ecb_dec_one
506 movups 16(%esi),%xmm3
507 je L024ecb_dec_two
508 movups 32(%esi),%xmm4
509 cmpl $64,%eax
510 jb L025ecb_dec_three
511 movups 48(%esi),%xmm5
512 je L026ecb_dec_four
513 movups 64(%esi),%xmm6
514 xorps %xmm7,%xmm7
515 call __aesni_decrypt6
516 movups %xmm2,(%edi)
517 movups %xmm3,16(%edi)
518 movups %xmm4,32(%edi)
519 movups %xmm5,48(%edi)
520 movups %xmm6,64(%edi)
521 jmp L010ecb_ret
522 .align 4,0x90
523 L023ecb_dec_one:
524 movups (%edx),%xmm0
525 movups 16(%edx),%xmm1
526 leal 32(%edx),%edx
527 xorps %xmm0,%xmm2
528 L027dec1_loop_4:
529 .byte 102,15,56,222,209
530 decl %ecx
531 movups (%edx),%xmm1
532 leal 16(%edx),%edx
533 jnz L027dec1_loop_4
534 .byte 102,15,56,223,209
535 movups %xmm2,(%edi)
536 jmp L010ecb_ret
537 .align 4,0x90
538 L024ecb_dec_two:
539 call __aesni_decrypt2
540 movups %xmm2,(%edi)
541 movups %xmm3,16(%edi)
542 jmp L010ecb_ret
543 .align 4,0x90
544 L025ecb_dec_three:
545 call __aesni_decrypt3
546 movups %xmm2,(%edi)
547 movups %xmm3,16(%edi)
548 movups %xmm4,32(%edi)
549 jmp L010ecb_ret
550 .align 4,0x90
551 L026ecb_dec_four:
552 call __aesni_decrypt4
553 movups %xmm2,(%edi)
554 movups %xmm3,16(%edi)
555 movups %xmm4,32(%edi)
556 movups %xmm5,48(%edi)
557 L010ecb_ret:
558 popl %edi
559 popl %esi
560 popl %ebx
561 popl %ebp
562 ret
563 .globl _aesni_ccm64_encrypt_blocks
564 .align 4
565 _aesni_ccm64_encrypt_blocks:
566 L_aesni_ccm64_encrypt_blocks_begin:
567 pushl %ebp
568 pushl %ebx
569 pushl %esi
570 pushl %edi
571 movl 20(%esp),%esi
572 movl 24(%esp),%edi
573 movl 28(%esp),%eax
574 movl 32(%esp),%edx
575 movl 36(%esp),%ebx
576 movl 40(%esp),%ecx
577 movl %esp,%ebp
578 subl $60,%esp
579 andl $-16,%esp
580 movl %ebp,48(%esp)
581 movdqu (%ebx),%xmm7
582 movdqu (%ecx),%xmm3
583 movl 240(%edx),%ecx
584 movl $202182159,(%esp)
585 movl $134810123,4(%esp)
586 movl $67438087,8(%esp)
587 movl $66051,12(%esp)
588 movl $1,%ebx
589 xorl %ebp,%ebp
590 movl %ebx,16(%esp)
591 movl %ebp,20(%esp)
592 movl %ebp,24(%esp)
593 movl %ebp,28(%esp)
594 shll $4,%ecx
595 movl $16,%ebx
596 leal (%edx),%ebp
597 movdqa (%esp),%xmm5
598 movdqa %xmm7,%xmm2
599 leal 32(%edx,%ecx,1),%edx
600 subl %ecx,%ebx
601 .byte 102,15,56,0,253
602 L028ccm64_enc_outer:
603 movups (%ebp),%xmm0
604 movl %ebx,%ecx
605 movups (%esi),%xmm6
606 xorps %xmm0,%xmm2
607 movups 16(%ebp),%xmm1
608 xorps %xmm6,%xmm0
609 xorps %xmm0,%xmm3
610 movups 32(%ebp),%xmm0
611 L029ccm64_enc2_loop:
612 .byte 102,15,56,220,209
613 .byte 102,15,56,220,217
614 movups (%edx,%ecx,1),%xmm1
615 addl $32,%ecx
616 .byte 102,15,56,220,208
617 .byte 102,15,56,220,216
618 movups -16(%edx,%ecx,1),%xmm0
619 jnz L029ccm64_enc2_loop
620 .byte 102,15,56,220,209
621 .byte 102,15,56,220,217
622 paddq 16(%esp),%xmm7
623 decl %eax
624 .byte 102,15,56,221,208
625 .byte 102,15,56,221,216
626 leal 16(%esi),%esi
627 xorps %xmm2,%xmm6
628 movdqa %xmm7,%xmm2
629 movups %xmm6,(%edi)
630 .byte 102,15,56,0,213
631 leal 16(%edi),%edi
632 jnz L028ccm64_enc_outer
633 movl 48(%esp),%esp
634 movl 40(%esp),%edi
635 movups %xmm3,(%edi)
636 popl %edi
637 popl %esi
638 popl %ebx
639 popl %ebp
640 ret
641 .globl _aesni_ccm64_decrypt_blocks
642 .align 4
643 _aesni_ccm64_decrypt_blocks:
644 L_aesni_ccm64_decrypt_blocks_begin:
645 pushl %ebp
646 pushl %ebx
647 pushl %esi
648 pushl %edi
649 movl 20(%esp),%esi
650 movl 24(%esp),%edi
651 movl 28(%esp),%eax
652 movl 32(%esp),%edx
653 movl 36(%esp),%ebx
654 movl 40(%esp),%ecx
655 movl %esp,%ebp
656 subl $60,%esp
657 andl $-16,%esp
658 movl %ebp,48(%esp)
659 movdqu (%ebx),%xmm7
660 movdqu (%ecx),%xmm3
661 movl 240(%edx),%ecx
662 movl $202182159,(%esp)
663 movl $134810123,4(%esp)
664 movl $67438087,8(%esp)
665 movl $66051,12(%esp)
666 movl $1,%ebx
667 xorl %ebp,%ebp
668 movl %ebx,16(%esp)
669 movl %ebp,20(%esp)
670 movl %ebp,24(%esp)
671 movl %ebp,28(%esp)
672 movdqa (%esp),%xmm5
673 movdqa %xmm7,%xmm2
674 movl %edx,%ebp
675 movl %ecx,%ebx
676 .byte 102,15,56,0,253
677 movups (%edx),%xmm0
678 movups 16(%edx),%xmm1
679 leal 32(%edx),%edx
680 xorps %xmm0,%xmm2
681 L030enc1_loop_5:
682 .byte 102,15,56,220,209
683 decl %ecx
684 movups (%edx),%xmm1
685 leal 16(%edx),%edx
686 jnz L030enc1_loop_5
687 .byte 102,15,56,221,209
688 shll $4,%ebx
689 movl $16,%ecx
690 movups (%esi),%xmm6
691 paddq 16(%esp),%xmm7
692 leal 16(%esi),%esi
693 subl %ebx,%ecx
694 leal 32(%ebp,%ebx,1),%edx
695 movl %ecx,%ebx
696 jmp L031ccm64_dec_outer
697 .align 4,0x90
698 L031ccm64_dec_outer:
699 xorps %xmm2,%xmm6
700 movdqa %xmm7,%xmm2
701 movups %xmm6,(%edi)
702 leal 16(%edi),%edi
703 .byte 102,15,56,0,213
704 subl $1,%eax
705 jz L032ccm64_dec_break
706 movups (%ebp),%xmm0
707 movl %ebx,%ecx
708 movups 16(%ebp),%xmm1
709 xorps %xmm0,%xmm6
710 xorps %xmm0,%xmm2
711 xorps %xmm6,%xmm3
712 movups 32(%ebp),%xmm0
713 L033ccm64_dec2_loop:
714 .byte 102,15,56,220,209
715 .byte 102,15,56,220,217
716 movups (%edx,%ecx,1),%xmm1
717 addl $32,%ecx
718 .byte 102,15,56,220,208
719 .byte 102,15,56,220,216
720 movups -16(%edx,%ecx,1),%xmm0
721 jnz L033ccm64_dec2_loop
722 movups (%esi),%xmm6
723 paddq 16(%esp),%xmm7
724 .byte 102,15,56,220,209
725 .byte 102,15,56,220,217
726 .byte 102,15,56,221,208
727 .byte 102,15,56,221,216
728 leal 16(%esi),%esi
729 jmp L031ccm64_dec_outer
730 .align 4,0x90
731 L032ccm64_dec_break:
732 movl 240(%ebp),%ecx
733 movl %ebp,%edx
734 movups (%edx),%xmm0
735 movups 16(%edx),%xmm1
736 xorps %xmm0,%xmm6
737 leal 32(%edx),%edx
738 xorps %xmm6,%xmm3
739 L034enc1_loop_6:
740 .byte 102,15,56,220,217
741 decl %ecx
742 movups (%edx),%xmm1
743 leal 16(%edx),%edx
744 jnz L034enc1_loop_6
745 .byte 102,15,56,221,217
746 movl 48(%esp),%esp
747 movl 40(%esp),%edi
748 movups %xmm3,(%edi)
749 popl %edi
750 popl %esi
751 popl %ebx
752 popl %ebp
753 ret
754 .globl _aesni_ctr32_encrypt_blocks
755 .align 4
756 _aesni_ctr32_encrypt_blocks:
757 L_aesni_ctr32_encrypt_blocks_begin:
758 pushl %ebp
759 pushl %ebx
760 pushl %esi
761 pushl %edi
762 movl 20(%esp),%esi
763 movl 24(%esp),%edi
764 movl 28(%esp),%eax
765 movl 32(%esp),%edx
766 movl 36(%esp),%ebx
767 movl %esp,%ebp
768 subl $88,%esp
769 andl $-16,%esp
770 movl %ebp,80(%esp)
771 cmpl $1,%eax
772 je L035ctr32_one_shortcut
773 movdqu (%ebx),%xmm7
774 movl $202182159,(%esp)
775 movl $134810123,4(%esp)
776 movl $67438087,8(%esp)
777 movl $66051,12(%esp)
778 movl $6,%ecx
779 xorl %ebp,%ebp
780 movl %ecx,16(%esp)
781 movl %ecx,20(%esp)
782 movl %ecx,24(%esp)
783 movl %ebp,28(%esp)
784 .byte 102,15,58,22,251,3
785 .byte 102,15,58,34,253,3
786 movl 240(%edx),%ecx
787 bswap %ebx
788 pxor %xmm0,%xmm0
789 pxor %xmm1,%xmm1
790 movdqa (%esp),%xmm2
791 .byte 102,15,58,34,195,0
792 leal 3(%ebx),%ebp
793 .byte 102,15,58,34,205,0
794 incl %ebx
795 .byte 102,15,58,34,195,1
796 incl %ebp
797 .byte 102,15,58,34,205,1
798 incl %ebx
799 .byte 102,15,58,34,195,2
800 incl %ebp
801 .byte 102,15,58,34,205,2
802 movdqa %xmm0,48(%esp)
803 .byte 102,15,56,0,194
804 movdqu (%edx),%xmm6
805 movdqa %xmm1,64(%esp)
806 .byte 102,15,56,0,202
807 pshufd $192,%xmm0,%xmm2
808 pshufd $128,%xmm0,%xmm3
809 cmpl $6,%eax
810 jb L036ctr32_tail
811 pxor %xmm6,%xmm7
812 shll $4,%ecx
813 movl $16,%ebx
814 movdqa %xmm7,32(%esp)
815 movl %edx,%ebp
816 subl %ecx,%ebx
817 leal 32(%edx,%ecx,1),%edx
818 subl $6,%eax
819 jmp L037ctr32_loop6
820 .align 4,0x90
821 L037ctr32_loop6:
822 pshufd $64,%xmm0,%xmm4
823 movdqa 32(%esp),%xmm0
824 pshufd $192,%xmm1,%xmm5
825 pxor %xmm0,%xmm2
826 pshufd $128,%xmm1,%xmm6
827 pxor %xmm0,%xmm3
828 pshufd $64,%xmm1,%xmm7
829 movups 16(%ebp),%xmm1
830 pxor %xmm0,%xmm4
831 pxor %xmm0,%xmm5
832 .byte 102,15,56,220,209
833 pxor %xmm0,%xmm6
834 pxor %xmm0,%xmm7
835 .byte 102,15,56,220,217
836 movups 32(%ebp),%xmm0
837 movl %ebx,%ecx
838 .byte 102,15,56,220,225
839 .byte 102,15,56,220,233
840 .byte 102,15,56,220,241
841 .byte 102,15,56,220,249
842 call L_aesni_encrypt6_enter
843 movups (%esi),%xmm1
844 movups 16(%esi),%xmm0
845 xorps %xmm1,%xmm2
846 movups 32(%esi),%xmm1
847 xorps %xmm0,%xmm3
848 movups %xmm2,(%edi)
849 movdqa 16(%esp),%xmm0
850 xorps %xmm1,%xmm4
851 movdqa 64(%esp),%xmm1
852 movups %xmm3,16(%edi)
853 movups %xmm4,32(%edi)
854 paddd %xmm0,%xmm1
855 paddd 48(%esp),%xmm0
856 movdqa (%esp),%xmm2
857 movups 48(%esi),%xmm3
858 movups 64(%esi),%xmm4
859 xorps %xmm3,%xmm5
860 movups 80(%esi),%xmm3
861 leal 96(%esi),%esi
862 movdqa %xmm0,48(%esp)
863 .byte 102,15,56,0,194
864 xorps %xmm4,%xmm6
865 movups %xmm5,48(%edi)
866 xorps %xmm3,%xmm7
867 movdqa %xmm1,64(%esp)
868 .byte 102,15,56,0,202
869 movups %xmm6,64(%edi)
870 pshufd $192,%xmm0,%xmm2
871 movups %xmm7,80(%edi)
872 leal 96(%edi),%edi
873 pshufd $128,%xmm0,%xmm3
874 subl $6,%eax
875 jnc L037ctr32_loop6
876 addl $6,%eax
877 jz L038ctr32_ret
878 movdqu (%ebp),%xmm7
879 movl %ebp,%edx
880 pxor 32(%esp),%xmm7
881 movl 240(%ebp),%ecx
882 L036ctr32_tail:
883 por %xmm7,%xmm2
884 cmpl $2,%eax
885 jb L039ctr32_one
886 pshufd $64,%xmm0,%xmm4
887 por %xmm7,%xmm3
888 je L040ctr32_two
889 pshufd $192,%xmm1,%xmm5
890 por %xmm7,%xmm4
891 cmpl $4,%eax
892 jb L041ctr32_three
893 pshufd $128,%xmm1,%xmm6
894 por %xmm7,%xmm5
895 je L042ctr32_four
896 por %xmm7,%xmm6
897 call __aesni_encrypt6
898 movups (%esi),%xmm1
899 movups 16(%esi),%xmm0
900 xorps %xmm1,%xmm2
901 movups 32(%esi),%xmm1
902 xorps %xmm0,%xmm3
903 movups 48(%esi),%xmm0
904 xorps %xmm1,%xmm4
905 movups 64(%esi),%xmm1
906 xorps %xmm0,%xmm5
907 movups %xmm2,(%edi)
908 xorps %xmm1,%xmm6
909 movups %xmm3,16(%edi)
910 movups %xmm4,32(%edi)
911 movups %xmm5,48(%edi)
912 movups %xmm6,64(%edi)
913 jmp L038ctr32_ret
914 .align 4,0x90
915 L035ctr32_one_shortcut:
916 movups (%ebx),%xmm2
917 movl 240(%edx),%ecx
918 L039ctr32_one:
919 movups (%edx),%xmm0
920 movups 16(%edx),%xmm1
921 leal 32(%edx),%edx
922 xorps %xmm0,%xmm2
923 L043enc1_loop_7:
924 .byte 102,15,56,220,209
925 decl %ecx
926 movups (%edx),%xmm1
927 leal 16(%edx),%edx
928 jnz L043enc1_loop_7
929 .byte 102,15,56,221,209
930 movups (%esi),%xmm6
931 xorps %xmm2,%xmm6
932 movups %xmm6,(%edi)
933 jmp L038ctr32_ret
934 .align 4,0x90
935 L040ctr32_two:
936 call __aesni_encrypt2
937 movups (%esi),%xmm5
938 movups 16(%esi),%xmm6
939 xorps %xmm5,%xmm2
940 xorps %xmm6,%xmm3
941 movups %xmm2,(%edi)
942 movups %xmm3,16(%edi)
943 jmp L038ctr32_ret
944 .align 4,0x90
945 L041ctr32_three:
946 call __aesni_encrypt3
947 movups (%esi),%xmm5
948 movups 16(%esi),%xmm6
949 xorps %xmm5,%xmm2
950 movups 32(%esi),%xmm7
951 xorps %xmm6,%xmm3
952 movups %xmm2,(%edi)
953 xorps %xmm7,%xmm4
954 movups %xmm3,16(%edi)
955 movups %xmm4,32(%edi)
956 jmp L038ctr32_ret
957 .align 4,0x90
958 L042ctr32_four:
959 call __aesni_encrypt4
960 movups (%esi),%xmm6
961 movups 16(%esi),%xmm7
962 movups 32(%esi),%xmm1
963 xorps %xmm6,%xmm2
964 movups 48(%esi),%xmm0
965 xorps %xmm7,%xmm3
966 movups %xmm2,(%edi)
967 xorps %xmm1,%xmm4
968 movups %xmm3,16(%edi)
969 xorps %xmm0,%xmm5
970 movups %xmm4,32(%edi)
971 movups %xmm5,48(%edi)
972 L038ctr32_ret:
973 movl 80(%esp),%esp
974 popl %edi
975 popl %esi
976 popl %ebx
977 popl %ebp
978 ret
979 .globl _aesni_xts_encrypt
980 .align 4
981 _aesni_xts_encrypt:
982 L_aesni_xts_encrypt_begin:
983 pushl %ebp
984 pushl %ebx
985 pushl %esi
986 pushl %edi
987 movl 36(%esp),%edx
988 movl 40(%esp),%esi
989 movl 240(%edx),%ecx
990 movups (%esi),%xmm2
991 movups (%edx),%xmm0
992 movups 16(%edx),%xmm1
993 leal 32(%edx),%edx
994 xorps %xmm0,%xmm2
995 L044enc1_loop_8:
996 .byte 102,15,56,220,209
997 decl %ecx
998 movups (%edx),%xmm1
999 leal 16(%edx),%edx
1000 jnz L044enc1_loop_8
1001 .byte 102,15,56,221,209
1002 movl 20(%esp),%esi
1003 movl 24(%esp),%edi
1004 movl 28(%esp),%eax
1005 movl 32(%esp),%edx
1006 movl %esp,%ebp
1007 subl $120,%esp
1008 movl 240(%edx),%ecx
1009 andl $-16,%esp
1010 movl $135,96(%esp)
1011 movl $0,100(%esp)
1012 movl $1,104(%esp)
1013 movl $0,108(%esp)
1014 movl %eax,112(%esp)
1015 movl %ebp,116(%esp)
1016 movdqa %xmm2,%xmm1
1017 pxor %xmm0,%xmm0
1018 movdqa 96(%esp),%xmm3
1019 pcmpgtd %xmm1,%xmm0
1020 andl $-16,%eax
1021 movl %edx,%ebp
1022 movl %ecx,%ebx
1023 subl $96,%eax
1024 jc L045xts_enc_short
1025 shll $4,%ecx
1026 movl $16,%ebx
1027 subl %ecx,%ebx
1028 leal 32(%edx,%ecx,1),%edx
1029 jmp L046xts_enc_loop6
1030 .align 4,0x90
1031 L046xts_enc_loop6:
1032 pshufd $19,%xmm0,%xmm2
1033 pxor %xmm0,%xmm0
1034 movdqa %xmm1,(%esp)
1035 paddq %xmm1,%xmm1
1036 pand %xmm3,%xmm2
1037 pcmpgtd %xmm1,%xmm0
1038 pxor %xmm2,%xmm1
1039 pshufd $19,%xmm0,%xmm2
1040 pxor %xmm0,%xmm0
1041 movdqa %xmm1,16(%esp)
1042 paddq %xmm1,%xmm1
1043 pand %xmm3,%xmm2
1044 pcmpgtd %xmm1,%xmm0
1045 pxor %xmm2,%xmm1
1046 pshufd $19,%xmm0,%xmm2
1047 pxor %xmm0,%xmm0
1048 movdqa %xmm1,32(%esp)
1049 paddq %xmm1,%xmm1
1050 pand %xmm3,%xmm2
1051 pcmpgtd %xmm1,%xmm0
1052 pxor %xmm2,%xmm1
1053 pshufd $19,%xmm0,%xmm2
1054 pxor %xmm0,%xmm0
1055 movdqa %xmm1,48(%esp)
1056 paddq %xmm1,%xmm1
1057 pand %xmm3,%xmm2
1058 pcmpgtd %xmm1,%xmm0
1059 pxor %xmm2,%xmm1
1060 pshufd $19,%xmm0,%xmm7
1061 movdqa %xmm1,64(%esp)
1062 paddq %xmm1,%xmm1
1063 movups (%ebp),%xmm0
1064 pand %xmm3,%xmm7
1065 movups (%esi),%xmm2
1066 pxor %xmm1,%xmm7
1067 movl %ebx,%ecx
1068 movdqu 16(%esi),%xmm3
1069 xorps %xmm0,%xmm2
1070 movdqu 32(%esi),%xmm4
1071 pxor %xmm0,%xmm3
1072 movdqu 48(%esi),%xmm5
1073 pxor %xmm0,%xmm4
1074 movdqu 64(%esi),%xmm6
1075 pxor %xmm0,%xmm5
1076 movdqu 80(%esi),%xmm1
1077 pxor %xmm0,%xmm6
1078 leal 96(%esi),%esi
1079 pxor (%esp),%xmm2
1080 movdqa %xmm7,80(%esp)
1081 pxor %xmm1,%xmm7
1082 movups 16(%ebp),%xmm1
1083 pxor 16(%esp),%xmm3
1084 pxor 32(%esp),%xmm4
1085 .byte 102,15,56,220,209
1086 pxor 48(%esp),%xmm5
1087 pxor 64(%esp),%xmm6
1088 .byte 102,15,56,220,217
1089 pxor %xmm0,%xmm7
1090 movups 32(%ebp),%xmm0
1091 .byte 102,15,56,220,225
1092 .byte 102,15,56,220,233
1093 .byte 102,15,56,220,241
1094 .byte 102,15,56,220,249
1095 call L_aesni_encrypt6_enter
1096 movdqa 80(%esp),%xmm1
1097 pxor %xmm0,%xmm0
1098 xorps (%esp),%xmm2
1099 pcmpgtd %xmm1,%xmm0
1100 xorps 16(%esp),%xmm3
1101 movups %xmm2,(%edi)
1102 xorps 32(%esp),%xmm4
1103 movups %xmm3,16(%edi)
1104 xorps 48(%esp),%xmm5
1105 movups %xmm4,32(%edi)
1106 xorps 64(%esp),%xmm6
1107 movups %xmm5,48(%edi)
1108 xorps %xmm1,%xmm7
1109 movups %xmm6,64(%edi)
1110 pshufd $19,%xmm0,%xmm2
1111 movups %xmm7,80(%edi)
1112 leal 96(%edi),%edi
1113 movdqa 96(%esp),%xmm3
1114 pxor %xmm0,%xmm0
1115 paddq %xmm1,%xmm1
1116 pand %xmm3,%xmm2
1117 pcmpgtd %xmm1,%xmm0
1118 pxor %xmm2,%xmm1
1119 subl $96,%eax
1120 jnc L046xts_enc_loop6
1121 movl 240(%ebp),%ecx
1122 movl %ebp,%edx
1123 movl %ecx,%ebx
1124 L045xts_enc_short:
1125 addl $96,%eax
1126 jz L047xts_enc_done6x
1127 movdqa %xmm1,%xmm5
1128 cmpl $32,%eax
1129 jb L048xts_enc_one
1130 pshufd $19,%xmm0,%xmm2
1131 pxor %xmm0,%xmm0
1132 paddq %xmm1,%xmm1
1133 pand %xmm3,%xmm2
1134 pcmpgtd %xmm1,%xmm0
1135 pxor %xmm2,%xmm1
1136 je L049xts_enc_two
1137 pshufd $19,%xmm0,%xmm2
1138 pxor %xmm0,%xmm0
1139 movdqa %xmm1,%xmm6
1140 paddq %xmm1,%xmm1
1141 pand %xmm3,%xmm2
1142 pcmpgtd %xmm1,%xmm0
1143 pxor %xmm2,%xmm1
1144 cmpl $64,%eax
1145 jb L050xts_enc_three
1146 pshufd $19,%xmm0,%xmm2
1147 pxor %xmm0,%xmm0
1148 movdqa %xmm1,%xmm7
1149 paddq %xmm1,%xmm1
1150 pand %xmm3,%xmm2
1151 pcmpgtd %xmm1,%xmm0
1152 pxor %xmm2,%xmm1
1153 movdqa %xmm5,(%esp)
1154 movdqa %xmm6,16(%esp)
1155 je L051xts_enc_four
1156 movdqa %xmm7,32(%esp)
1157 pshufd $19,%xmm0,%xmm7
1158 movdqa %xmm1,48(%esp)
1159 paddq %xmm1,%xmm1
1160 pand %xmm3,%xmm7
1161 pxor %xmm1,%xmm7
1162 movdqu (%esi),%xmm2
1163 movdqu 16(%esi),%xmm3
1164 movdqu 32(%esi),%xmm4
1165 pxor (%esp),%xmm2
1166 movdqu 48(%esi),%xmm5
1167 pxor 16(%esp),%xmm3
1168 movdqu 64(%esi),%xmm6
1169 pxor 32(%esp),%xmm4
1170 leal 80(%esi),%esi
1171 pxor 48(%esp),%xmm5
1172 movdqa %xmm7,64(%esp)
1173 pxor %xmm7,%xmm6
1174 call __aesni_encrypt6
1175 movaps 64(%esp),%xmm1
1176 xorps (%esp),%xmm2
1177 xorps 16(%esp),%xmm3
1178 xorps 32(%esp),%xmm4
1179 movups %xmm2,(%edi)
1180 xorps 48(%esp),%xmm5
1181 movups %xmm3,16(%edi)
1182 xorps %xmm1,%xmm6
1183 movups %xmm4,32(%edi)
1184 movups %xmm5,48(%edi)
1185 movups %xmm6,64(%edi)
1186 leal 80(%edi),%edi
1187 jmp L052xts_enc_done
1188 .align 4,0x90
1189 L048xts_enc_one:
1190 movups (%esi),%xmm2
1191 leal 16(%esi),%esi
1192 xorps %xmm5,%xmm2
1193 movups (%edx),%xmm0
1194 movups 16(%edx),%xmm1
1195 leal 32(%edx),%edx
1196 xorps %xmm0,%xmm2
1197 L053enc1_loop_9:
1198 .byte 102,15,56,220,209
1199 decl %ecx
1200 movups (%edx),%xmm1
1201 leal 16(%edx),%edx
1202 jnz L053enc1_loop_9
1203 .byte 102,15,56,221,209
1204 xorps %xmm5,%xmm2
1205 movups %xmm2,(%edi)
1206 leal 16(%edi),%edi
1207 movdqa %xmm5,%xmm1
1208 jmp L052xts_enc_done
1209 .align 4,0x90
1210 L049xts_enc_two:
1211 movaps %xmm1,%xmm6
1212 movups (%esi),%xmm2
1213 movups 16(%esi),%xmm3
1214 leal 32(%esi),%esi
1215 xorps %xmm5,%xmm2
1216 xorps %xmm6,%xmm3
1217 call __aesni_encrypt2
1218 xorps %xmm5,%xmm2
1219 xorps %xmm6,%xmm3
1220 movups %xmm2,(%edi)
1221 movups %xmm3,16(%edi)
1222 leal 32(%edi),%edi
1223 movdqa %xmm6,%xmm1
1224 jmp L052xts_enc_done
1225 .align 4,0x90
1226 L050xts_enc_three:
1227 movaps %xmm1,%xmm7
1228 movups (%esi),%xmm2
1229 movups 16(%esi),%xmm3
1230 movups 32(%esi),%xmm4
1231 leal 48(%esi),%esi
1232 xorps %xmm5,%xmm2
1233 xorps %xmm6,%xmm3
1234 xorps %xmm7,%xmm4
1235 call __aesni_encrypt3
1236 xorps %xmm5,%xmm2
1237 xorps %xmm6,%xmm3
1238 xorps %xmm7,%xmm4
1239 movups %xmm2,(%edi)
1240 movups %xmm3,16(%edi)
1241 movups %xmm4,32(%edi)
1242 leal 48(%edi),%edi
1243 movdqa %xmm7,%xmm1
1244 jmp L052xts_enc_done
1245 .align 4,0x90
1246 L051xts_enc_four:
1247 movaps %xmm1,%xmm6
1248 movups (%esi),%xmm2
1249 movups 16(%esi),%xmm3
1250 movups 32(%esi),%xmm4
1251 xorps (%esp),%xmm2
1252 movups 48(%esi),%xmm5
1253 leal 64(%esi),%esi
1254 xorps 16(%esp),%xmm3
1255 xorps %xmm7,%xmm4
1256 xorps %xmm6,%xmm5
1257 call __aesni_encrypt4
1258 xorps (%esp),%xmm2
1259 xorps 16(%esp),%xmm3
1260 xorps %xmm7,%xmm4
1261 movups %xmm2,(%edi)
1262 xorps %xmm6,%xmm5
1263 movups %xmm3,16(%edi)
1264 movups %xmm4,32(%edi)
1265 movups %xmm5,48(%edi)
1266 leal 64(%edi),%edi
1267 movdqa %xmm6,%xmm1
1268 jmp L052xts_enc_done
1269 .align 4,0x90
1270 L047xts_enc_done6x:
1271 movl 112(%esp),%eax
1272 andl $15,%eax
1273 jz L054xts_enc_ret
1274 movdqa %xmm1,%xmm5
1275 movl %eax,112(%esp)
1276 jmp L055xts_enc_steal
1277 .align 4,0x90
1278 L052xts_enc_done:
1279 movl 112(%esp),%eax
1280 pxor %xmm0,%xmm0
1281 andl $15,%eax
1282 jz L054xts_enc_ret
1283 pcmpgtd %xmm1,%xmm0
1284 movl %eax,112(%esp)
1285 pshufd $19,%xmm0,%xmm5
1286 paddq %xmm1,%xmm1
1287 pand 96(%esp),%xmm5
1288 pxor %xmm1,%xmm5
1289 L055xts_enc_steal:
1290 movzbl (%esi),%ecx
1291 movzbl -16(%edi),%edx
1292 leal 1(%esi),%esi
1293 movb %cl,-16(%edi)
1294 movb %dl,(%edi)
1295 leal 1(%edi),%edi
1296 subl $1,%eax
1297 jnz L055xts_enc_steal
1298 subl 112(%esp),%edi
1299 movl %ebp,%edx
1300 movl %ebx,%ecx
1301 movups -16(%edi),%xmm2
1302 xorps %xmm5,%xmm2
1303 movups (%edx),%xmm0
1304 movups 16(%edx),%xmm1
1305 leal 32(%edx),%edx
1306 xorps %xmm0,%xmm2
1307 L056enc1_loop_10:
1308 .byte 102,15,56,220,209
1309 decl %ecx
1310 movups (%edx),%xmm1
1311 leal 16(%edx),%edx
1312 jnz L056enc1_loop_10
1313 .byte 102,15,56,221,209
1314 xorps %xmm5,%xmm2
1315 movups %xmm2,-16(%edi)
1316 L054xts_enc_ret:
1317 movl 116(%esp),%esp
1318 popl %edi
1319 popl %esi
1320 popl %ebx
1321 popl %ebp
1322 ret
1323 .globl _aesni_xts_decrypt
1324 .align 4
1325 _aesni_xts_decrypt:
1326 L_aesni_xts_decrypt_begin:
1327 pushl %ebp
1328 pushl %ebx
1329 pushl %esi
1330 pushl %edi
1331 movl 36(%esp),%edx
1332 movl 40(%esp),%esi
1333 movl 240(%edx),%ecx
1334 movups (%esi),%xmm2
1335 movups (%edx),%xmm0
1336 movups 16(%edx),%xmm1
1337 leal 32(%edx),%edx
1338 xorps %xmm0,%xmm2
1339 L057enc1_loop_11:
1340 .byte 102,15,56,220,209
1341 decl %ecx
1342 movups (%edx),%xmm1
1343 leal 16(%edx),%edx
1344 jnz L057enc1_loop_11
1345 .byte 102,15,56,221,209
1346 movl 20(%esp),%esi
1347 movl 24(%esp),%edi
1348 movl 28(%esp),%eax
1349 movl 32(%esp),%edx
1350 movl %esp,%ebp
1351 subl $120,%esp
1352 andl $-16,%esp
1353 xorl %ebx,%ebx
1354 testl $15,%eax
1355 setnz %bl
1356 shll $4,%ebx
1357 subl %ebx,%eax
1358 movl $135,96(%esp)
1359 movl $0,100(%esp)
1360 movl $1,104(%esp)
1361 movl $0,108(%esp)
1362 movl %eax,112(%esp)
1363 movl %ebp,116(%esp)
1364 movl 240(%edx),%ecx
1365 movl %edx,%ebp
1366 movl %ecx,%ebx
1367 movdqa %xmm2,%xmm1
1368 pxor %xmm0,%xmm0
1369 movdqa 96(%esp),%xmm3
1370 pcmpgtd %xmm1,%xmm0
1371 andl $-16,%eax
1372 subl $96,%eax
1373 jc L058xts_dec_short
1374 shll $4,%ecx
1375 movl $16,%ebx
1376 subl %ecx,%ebx
1377 leal 32(%edx,%ecx,1),%edx
1378 jmp L059xts_dec_loop6
1379 .align 4,0x90
1380 L059xts_dec_loop6:
1381 pshufd $19,%xmm0,%xmm2
1382 pxor %xmm0,%xmm0
1383 movdqa %xmm1,(%esp)
1384 paddq %xmm1,%xmm1
1385 pand %xmm3,%xmm2
1386 pcmpgtd %xmm1,%xmm0
1387 pxor %xmm2,%xmm1
1388 pshufd $19,%xmm0,%xmm2
1389 pxor %xmm0,%xmm0
1390 movdqa %xmm1,16(%esp)
1391 paddq %xmm1,%xmm1
1392 pand %xmm3,%xmm2
1393 pcmpgtd %xmm1,%xmm0
1394 pxor %xmm2,%xmm1
1395 pshufd $19,%xmm0,%xmm2
1396 pxor %xmm0,%xmm0
1397 movdqa %xmm1,32(%esp)
1398 paddq %xmm1,%xmm1
1399 pand %xmm3,%xmm2
1400 pcmpgtd %xmm1,%xmm0
1401 pxor %xmm2,%xmm1
1402 pshufd $19,%xmm0,%xmm2
1403 pxor %xmm0,%xmm0
1404 movdqa %xmm1,48(%esp)
1405 paddq %xmm1,%xmm1
1406 pand %xmm3,%xmm2
1407 pcmpgtd %xmm1,%xmm0
1408 pxor %xmm2,%xmm1
1409 pshufd $19,%xmm0,%xmm7
1410 movdqa %xmm1,64(%esp)
1411 paddq %xmm1,%xmm1
1412 movups (%ebp),%xmm0
1413 pand %xmm3,%xmm7
1414 movups (%esi),%xmm2
1415 pxor %xmm1,%xmm7
1416 movl %ebx,%ecx
1417 movdqu 16(%esi),%xmm3
1418 xorps %xmm0,%xmm2
1419 movdqu 32(%esi),%xmm4
1420 pxor %xmm0,%xmm3
1421 movdqu 48(%esi),%xmm5
1422 pxor %xmm0,%xmm4
1423 movdqu 64(%esi),%xmm6
1424 pxor %xmm0,%xmm5
1425 movdqu 80(%esi),%xmm1
1426 pxor %xmm0,%xmm6
1427 leal 96(%esi),%esi
1428 pxor (%esp),%xmm2
1429 movdqa %xmm7,80(%esp)
1430 pxor %xmm1,%xmm7
1431 movups 16(%ebp),%xmm1
1432 pxor 16(%esp),%xmm3
1433 pxor 32(%esp),%xmm4
1434 .byte 102,15,56,222,209
1435 pxor 48(%esp),%xmm5
1436 pxor 64(%esp),%xmm6
1437 .byte 102,15,56,222,217
1438 pxor %xmm0,%xmm7
1439 movups 32(%ebp),%xmm0
1440 .byte 102,15,56,222,225
1441 .byte 102,15,56,222,233
1442 .byte 102,15,56,222,241
1443 .byte 102,15,56,222,249
1444 call L_aesni_decrypt6_enter
1445 movdqa 80(%esp),%xmm1
1446 pxor %xmm0,%xmm0
1447 xorps (%esp),%xmm2
1448 pcmpgtd %xmm1,%xmm0
1449 xorps 16(%esp),%xmm3
1450 movups %xmm2,(%edi)
1451 xorps 32(%esp),%xmm4
1452 movups %xmm3,16(%edi)
1453 xorps 48(%esp),%xmm5
1454 movups %xmm4,32(%edi)
1455 xorps 64(%esp),%xmm6
1456 movups %xmm5,48(%edi)
1457 xorps %xmm1,%xmm7
1458 movups %xmm6,64(%edi)
1459 pshufd $19,%xmm0,%xmm2
1460 movups %xmm7,80(%edi)
1461 leal 96(%edi),%edi
1462 movdqa 96(%esp),%xmm3
1463 pxor %xmm0,%xmm0
1464 paddq %xmm1,%xmm1
1465 pand %xmm3,%xmm2
1466 pcmpgtd %xmm1,%xmm0
1467 pxor %xmm2,%xmm1
1468 subl $96,%eax
1469 jnc L059xts_dec_loop6
1470 movl 240(%ebp),%ecx
1471 movl %ebp,%edx
1472 movl %ecx,%ebx
1473 L058xts_dec_short:
1474 addl $96,%eax
1475 jz L060xts_dec_done6x
1476 movdqa %xmm1,%xmm5
1477 cmpl $32,%eax
1478 jb L061xts_dec_one
1479 pshufd $19,%xmm0,%xmm2
1480 pxor %xmm0,%xmm0
1481 paddq %xmm1,%xmm1
1482 pand %xmm3,%xmm2
1483 pcmpgtd %xmm1,%xmm0
1484 pxor %xmm2,%xmm1
1485 je L062xts_dec_two
1486 pshufd $19,%xmm0,%xmm2
1487 pxor %xmm0,%xmm0
1488 movdqa %xmm1,%xmm6
1489 paddq %xmm1,%xmm1
1490 pand %xmm3,%xmm2
1491 pcmpgtd %xmm1,%xmm0
1492 pxor %xmm2,%xmm1
1493 cmpl $64,%eax
1494 jb L063xts_dec_three
1495 pshufd $19,%xmm0,%xmm2
1496 pxor %xmm0,%xmm0
1497 movdqa %xmm1,%xmm7
1498 paddq %xmm1,%xmm1
1499 pand %xmm3,%xmm2
1500 pcmpgtd %xmm1,%xmm0
1501 pxor %xmm2,%xmm1
1502 movdqa %xmm5,(%esp)
1503 movdqa %xmm6,16(%esp)
1504 je L064xts_dec_four
1505 movdqa %xmm7,32(%esp)
1506 pshufd $19,%xmm0,%xmm7
1507 movdqa %xmm1,48(%esp)
1508 paddq %xmm1,%xmm1
1509 pand %xmm3,%xmm7
1510 pxor %xmm1,%xmm7
1511 movdqu (%esi),%xmm2
1512 movdqu 16(%esi),%xmm3
1513 movdqu 32(%esi),%xmm4
1514 pxor (%esp),%xmm2
1515 movdqu 48(%esi),%xmm5
1516 pxor 16(%esp),%xmm3
1517 movdqu 64(%esi),%xmm6
1518 pxor 32(%esp),%xmm4
1519 leal 80(%esi),%esi
1520 pxor 48(%esp),%xmm5
1521 movdqa %xmm7,64(%esp)
1522 pxor %xmm7,%xmm6
1523 call __aesni_decrypt6
1524 movaps 64(%esp),%xmm1
1525 xorps (%esp),%xmm2
1526 xorps 16(%esp),%xmm3
1527 xorps 32(%esp),%xmm4
1528 movups %xmm2,(%edi)
1529 xorps 48(%esp),%xmm5
1530 movups %xmm3,16(%edi)
1531 xorps %xmm1,%xmm6
1532 movups %xmm4,32(%edi)
1533 movups %xmm5,48(%edi)
1534 movups %xmm6,64(%edi)
1535 leal 80(%edi),%edi
1536 jmp L065xts_dec_done
1537 .align 4,0x90
1538 L061xts_dec_one:
1539 movups (%esi),%xmm2
1540 leal 16(%esi),%esi
1541 xorps %xmm5,%xmm2
1542 movups (%edx),%xmm0
1543 movups 16(%edx),%xmm1
1544 leal 32(%edx),%edx
1545 xorps %xmm0,%xmm2
1546 L066dec1_loop_12:
1547 .byte 102,15,56,222,209
1548 decl %ecx
1549 movups (%edx),%xmm1
1550 leal 16(%edx),%edx
1551 jnz L066dec1_loop_12
1552 .byte 102,15,56,223,209
1553 xorps %xmm5,%xmm2
1554 movups %xmm2,(%edi)
1555 leal 16(%edi),%edi
1556 movdqa %xmm5,%xmm1
1557 jmp L065xts_dec_done
1558 .align 4,0x90
1559 L062xts_dec_two:
1560 movaps %xmm1,%xmm6
1561 movups (%esi),%xmm2
1562 movups 16(%esi),%xmm3
1563 leal 32(%esi),%esi
1564 xorps %xmm5,%xmm2
1565 xorps %xmm6,%xmm3
1566 call __aesni_decrypt2
1567 xorps %xmm5,%xmm2
1568 xorps %xmm6,%xmm3
1569 movups %xmm2,(%edi)
1570 movups %xmm3,16(%edi)
1571 leal 32(%edi),%edi
1572 movdqa %xmm6,%xmm1
1573 jmp L065xts_dec_done
1574 .align 4,0x90
1575 L063xts_dec_three:
1576 movaps %xmm1,%xmm7
1577 movups (%esi),%xmm2
1578 movups 16(%esi),%xmm3
1579 movups 32(%esi),%xmm4
1580 leal 48(%esi),%esi
1581 xorps %xmm5,%xmm2
1582 xorps %xmm6,%xmm3
1583 xorps %xmm7,%xmm4
1584 call __aesni_decrypt3
1585 xorps %xmm5,%xmm2
1586 xorps %xmm6,%xmm3
1587 xorps %xmm7,%xmm4
1588 movups %xmm2,(%edi)
1589 movups %xmm3,16(%edi)
1590 movups %xmm4,32(%edi)
1591 leal 48(%edi),%edi
1592 movdqa %xmm7,%xmm1
1593 jmp L065xts_dec_done
1594 .align 4,0x90
1595 L064xts_dec_four:
1596 movaps %xmm1,%xmm6
1597 movups (%esi),%xmm2
1598 movups 16(%esi),%xmm3
1599 movups 32(%esi),%xmm4
1600 xorps (%esp),%xmm2
1601 movups 48(%esi),%xmm5
1602 leal 64(%esi),%esi
1603 xorps 16(%esp),%xmm3
1604 xorps %xmm7,%xmm4
1605 xorps %xmm6,%xmm5
1606 call __aesni_decrypt4
1607 xorps (%esp),%xmm2
1608 xorps 16(%esp),%xmm3
1609 xorps %xmm7,%xmm4
1610 movups %xmm2,(%edi)
1611 xorps %xmm6,%xmm5
1612 movups %xmm3,16(%edi)
1613 movups %xmm4,32(%edi)
1614 movups %xmm5,48(%edi)
1615 leal 64(%edi),%edi
1616 movdqa %xmm6,%xmm1
1617 jmp L065xts_dec_done
1618 .align 4,0x90
1619 L060xts_dec_done6x:
1620 movl 112(%esp),%eax
1621 andl $15,%eax
1622 jz L067xts_dec_ret
1623 movl %eax,112(%esp)
1624 jmp L068xts_dec_only_one_more
1625 .align 4,0x90
1626 L065xts_dec_done:
1627 movl 112(%esp),%eax
1628 pxor %xmm0,%xmm0
1629 andl $15,%eax
1630 jz L067xts_dec_ret
1631 pcmpgtd %xmm1,%xmm0
1632 movl %eax,112(%esp)
1633 pshufd $19,%xmm0,%xmm2
1634 pxor %xmm0,%xmm0
1635 movdqa 96(%esp),%xmm3
1636 paddq %xmm1,%xmm1
1637 pand %xmm3,%xmm2
1638 pcmpgtd %xmm1,%xmm0
1639 pxor %xmm2,%xmm1
1640 L068xts_dec_only_one_more:
1641 pshufd $19,%xmm0,%xmm5
1642 movdqa %xmm1,%xmm6
1643 paddq %xmm1,%xmm1
1644 pand %xmm3,%xmm5
1645 pxor %xmm1,%xmm5
1646 movl %ebp,%edx
1647 movl %ebx,%ecx
1648 movups (%esi),%xmm2
1649 xorps %xmm5,%xmm2
1650 movups (%edx),%xmm0
1651 movups 16(%edx),%xmm1
1652 leal 32(%edx),%edx
1653 xorps %xmm0,%xmm2
1654 L069dec1_loop_13:
1655 .byte 102,15,56,222,209
1656 decl %ecx
1657 movups (%edx),%xmm1
1658 leal 16(%edx),%edx
1659 jnz L069dec1_loop_13
1660 .byte 102,15,56,223,209
1661 xorps %xmm5,%xmm2
1662 movups %xmm2,(%edi)
1663 L070xts_dec_steal:
1664 movzbl 16(%esi),%ecx
1665 movzbl (%edi),%edx
1666 leal 1(%esi),%esi
1667 movb %cl,(%edi)
1668 movb %dl,16(%edi)
1669 leal 1(%edi),%edi
1670 subl $1,%eax
1671 jnz L070xts_dec_steal
1672 subl 112(%esp),%edi
1673 movl %ebp,%edx
1674 movl %ebx,%ecx
1675 movups (%edi),%xmm2
1676 xorps %xmm6,%xmm2
1677 movups (%edx),%xmm0
1678 movups 16(%edx),%xmm1
1679 leal 32(%edx),%edx
1680 xorps %xmm0,%xmm2
1681 L071dec1_loop_14:
1682 .byte 102,15,56,222,209
1683 decl %ecx
1684 movups (%edx),%xmm1
1685 leal 16(%edx),%edx
1686 jnz L071dec1_loop_14
1687 .byte 102,15,56,223,209
1688 xorps %xmm6,%xmm2
1689 movups %xmm2,(%edi)
1690 L067xts_dec_ret:
1691 movl 116(%esp),%esp
1692 popl %edi
1693 popl %esi
1694 popl %ebx
1695 popl %ebp
1696 ret
1697 .globl _aesni_cbc_encrypt
1698 .align 4
1699 _aesni_cbc_encrypt:
1700 L_aesni_cbc_encrypt_begin:
1701 pushl %ebp
1702 pushl %ebx
1703 pushl %esi
1704 pushl %edi
1705 movl 20(%esp),%esi
1706 movl %esp,%ebx
1707 movl 24(%esp),%edi
1708 subl $24,%ebx
1709 movl 28(%esp),%eax
1710 andl $-16,%ebx
1711 movl 32(%esp),%edx
1712 movl 36(%esp),%ebp
1713 testl %eax,%eax
1714 jz L072cbc_abort
1715 cmpl $0,40(%esp)
1716 xchgl %esp,%ebx
1717 movups (%ebp),%xmm7
1718 movl 240(%edx),%ecx
1719 movl %edx,%ebp
1720 movl %ebx,16(%esp)
1721 movl %ecx,%ebx
1722 je L073cbc_decrypt
1723 movaps %xmm7,%xmm2
1724 cmpl $16,%eax
1725 jb L074cbc_enc_tail
1726 subl $16,%eax
1727 jmp L075cbc_enc_loop
1728 .align 4,0x90
1729 L075cbc_enc_loop:
1730 movups (%esi),%xmm7
1731 leal 16(%esi),%esi
1732 movups (%edx),%xmm0
1733 movups 16(%edx),%xmm1
1734 xorps %xmm0,%xmm7
1735 leal 32(%edx),%edx
1736 xorps %xmm7,%xmm2
1737 L076enc1_loop_15:
1738 .byte 102,15,56,220,209
1739 decl %ecx
1740 movups (%edx),%xmm1
1741 leal 16(%edx),%edx
1742 jnz L076enc1_loop_15
1743 .byte 102,15,56,221,209
1744 movl %ebx,%ecx
1745 movl %ebp,%edx
1746 movups %xmm2,(%edi)
1747 leal 16(%edi),%edi
1748 subl $16,%eax
1749 jnc L075cbc_enc_loop
1750 addl $16,%eax
1751 jnz L074cbc_enc_tail
1752 movaps %xmm2,%xmm7
1753 jmp L077cbc_ret
1754 L074cbc_enc_tail:
1755 movl %eax,%ecx
1756 .long 2767451785
1757 movl $16,%ecx
1758 subl %eax,%ecx
1759 xorl %eax,%eax
1760 .long 2868115081
1761 leal -16(%edi),%edi
1762 movl %ebx,%ecx
1763 movl %edi,%esi
1764 movl %ebp,%edx
1765 jmp L075cbc_enc_loop
1766 .align 4,0x90
1767 L073cbc_decrypt:
1768 cmpl $80,%eax
1769 jbe L078cbc_dec_tail
1770 movaps %xmm7,(%esp)
1771 subl $80,%eax
1772 jmp L079cbc_dec_loop6_enter
1773 .align 4,0x90
1774 L080cbc_dec_loop6:
1775 movaps %xmm0,(%esp)
1776 movups %xmm7,(%edi)
1777 leal 16(%edi),%edi
1778 L079cbc_dec_loop6_enter:
1779 movdqu (%esi),%xmm2
1780 movdqu 16(%esi),%xmm3
1781 movdqu 32(%esi),%xmm4
1782 movdqu 48(%esi),%xmm5
1783 movdqu 64(%esi),%xmm6
1784 movdqu 80(%esi),%xmm7
1785 call __aesni_decrypt6
1786 movups (%esi),%xmm1
1787 movups 16(%esi),%xmm0
1788 xorps (%esp),%xmm2
1789 xorps %xmm1,%xmm3
1790 movups 32(%esi),%xmm1
1791 xorps %xmm0,%xmm4
1792 movups 48(%esi),%xmm0
1793 xorps %xmm1,%xmm5
1794 movups 64(%esi),%xmm1
1795 xorps %xmm0,%xmm6
1796 movups 80(%esi),%xmm0
1797 xorps %xmm1,%xmm7
1798 movups %xmm2,(%edi)
1799 movups %xmm3,16(%edi)
1800 leal 96(%esi),%esi
1801 movups %xmm4,32(%edi)
1802 movl %ebx,%ecx
1803 movups %xmm5,48(%edi)
1804 movl %ebp,%edx
1805 movups %xmm6,64(%edi)
1806 leal 80(%edi),%edi
1807 subl $96,%eax
1808 ja L080cbc_dec_loop6
1809 movaps %xmm7,%xmm2
1810 movaps %xmm0,%xmm7
1811 addl $80,%eax
1812 jle L081cbc_dec_tail_collected
1813 movups %xmm2,(%edi)
1814 leal 16(%edi),%edi
1815 L078cbc_dec_tail:
1816 movups (%esi),%xmm2
1817 movaps %xmm2,%xmm6
1818 cmpl $16,%eax
1819 jbe L082cbc_dec_one
1820 movups 16(%esi),%xmm3
1821 movaps %xmm3,%xmm5
1822 cmpl $32,%eax
1823 jbe L083cbc_dec_two
1824 movups 32(%esi),%xmm4
1825 cmpl $48,%eax
1826 jbe L084cbc_dec_three
1827 movups 48(%esi),%xmm5
1828 cmpl $64,%eax
1829 jbe L085cbc_dec_four
1830 movups 64(%esi),%xmm6
1831 movaps %xmm7,(%esp)
1832 movups (%esi),%xmm2
1833 xorps %xmm7,%xmm7
1834 call __aesni_decrypt6
1835 movups (%esi),%xmm1
1836 movups 16(%esi),%xmm0
1837 xorps (%esp),%xmm2
1838 xorps %xmm1,%xmm3
1839 movups 32(%esi),%xmm1
1840 xorps %xmm0,%xmm4
1841 movups 48(%esi),%xmm0
1842 xorps %xmm1,%xmm5
1843 movups 64(%esi),%xmm7
1844 xorps %xmm0,%xmm6
1845 movups %xmm2,(%edi)
1846 movups %xmm3,16(%edi)
1847 movups %xmm4,32(%edi)
1848 movups %xmm5,48(%edi)
1849 leal 64(%edi),%edi
1850 movaps %xmm6,%xmm2
1851 subl $80,%eax
1852 jmp L081cbc_dec_tail_collected
1853 .align 4,0x90
1854 L082cbc_dec_one:
1855 movups (%edx),%xmm0
1856 movups 16(%edx),%xmm1
1857 leal 32(%edx),%edx
1858 xorps %xmm0,%xmm2
1859 L086dec1_loop_16:
1860 .byte 102,15,56,222,209
1861 decl %ecx
1862 movups (%edx),%xmm1
1863 leal 16(%edx),%edx
1864 jnz L086dec1_loop_16
1865 .byte 102,15,56,223,209
1866 xorps %xmm7,%xmm2
1867 movaps %xmm6,%xmm7
1868 subl $16,%eax
1869 jmp L081cbc_dec_tail_collected
1870 .align 4,0x90
1871 L083cbc_dec_two:
1872 call __aesni_decrypt2
1873 xorps %xmm7,%xmm2
1874 xorps %xmm6,%xmm3
1875 movups %xmm2,(%edi)
1876 movaps %xmm3,%xmm2
1877 leal 16(%edi),%edi
1878 movaps %xmm5,%xmm7
1879 subl $32,%eax
1880 jmp L081cbc_dec_tail_collected
1881 .align 4,0x90
1882 L084cbc_dec_three:
1883 call __aesni_decrypt3
1884 xorps %xmm7,%xmm2
1885 xorps %xmm6,%xmm3
1886 xorps %xmm5,%xmm4
1887 movups %xmm2,(%edi)
1888 movaps %xmm4,%xmm2
1889 movups %xmm3,16(%edi)
1890 leal 32(%edi),%edi
1891 movups 32(%esi),%xmm7
1892 subl $48,%eax
1893 jmp L081cbc_dec_tail_collected
1894 .align 4,0x90
1895 L085cbc_dec_four:
1896 call __aesni_decrypt4
1897 movups 16(%esi),%xmm1
1898 movups 32(%esi),%xmm0
1899 xorps %xmm7,%xmm2
1900 movups 48(%esi),%xmm7
1901 xorps %xmm6,%xmm3
1902 movups %xmm2,(%edi)
1903 xorps %xmm1,%xmm4
1904 movups %xmm3,16(%edi)
1905 xorps %xmm0,%xmm5
1906 movups %xmm4,32(%edi)
1907 leal 48(%edi),%edi
1908 movaps %xmm5,%xmm2
1909 subl $64,%eax
1910 L081cbc_dec_tail_collected:
1911 andl $15,%eax
1912 jnz L087cbc_dec_tail_partial
1913 movups %xmm2,(%edi)
1914 jmp L077cbc_ret
1915 .align 4,0x90
1916 L087cbc_dec_tail_partial:
1917 movaps %xmm2,(%esp)
1918 movl $16,%ecx
1919 movl %esp,%esi
1920 subl %eax,%ecx
1921 .long 2767451785
1922 L077cbc_ret:
1923 movl 16(%esp),%esp
1924 movl 36(%esp),%ebp
1925 movups %xmm7,(%ebp)
1926 L072cbc_abort:
1927 popl %edi
1928 popl %esi
1929 popl %ebx
1930 popl %ebp
1931 ret
1932 .align 4
1933 __aesni_set_encrypt_key:
1934 testl %eax,%eax
1935 jz L088bad_pointer
1936 testl %edx,%edx
1937 jz L088bad_pointer
1938 movups (%eax),%xmm0
1939 xorps %xmm4,%xmm4
1940 leal 16(%edx),%edx
1941 cmpl $256,%ecx
1942 je L08914rounds
1943 cmpl $192,%ecx
1944 je L09012rounds
1945 cmpl $128,%ecx
1946 jne L091bad_keybits
1947 .align 4,0x90
1948 L09210rounds:
1949 movl $9,%ecx
1950 movups %xmm0,-16(%edx)
1951 .byte 102,15,58,223,200,1
1952 call L093key_128_cold
1953 .byte 102,15,58,223,200,2
1954 call L094key_128
1955 .byte 102,15,58,223,200,4
1956 call L094key_128
1957 .byte 102,15,58,223,200,8
1958 call L094key_128
1959 .byte 102,15,58,223,200,16
1960 call L094key_128
1961 .byte 102,15,58,223,200,32
1962 call L094key_128
1963 .byte 102,15,58,223,200,64
1964 call L094key_128
1965 .byte 102,15,58,223,200,128
1966 call L094key_128
1967 .byte 102,15,58,223,200,27
1968 call L094key_128
1969 .byte 102,15,58,223,200,54
1970 call L094key_128
1971 movups %xmm0,(%edx)
1972 movl %ecx,80(%edx)
1973 xorl %eax,%eax
1974 ret
1975 .align 4,0x90
1976 L094key_128:
1977 movups %xmm0,(%edx)
1978 leal 16(%edx),%edx
1979 L093key_128_cold:
1980 shufps $16,%xmm0,%xmm4
1981 xorps %xmm4,%xmm0
1982 shufps $140,%xmm0,%xmm4
1983 xorps %xmm4,%xmm0
1984 shufps $255,%xmm1,%xmm1
1985 xorps %xmm1,%xmm0
1986 ret
1987 .align 4,0x90
1988 L09012rounds:
1989 movq 16(%eax),%xmm2
1990 movl $11,%ecx
1991 movups %xmm0,-16(%edx)
1992 .byte 102,15,58,223,202,1
1993 call L095key_192a_cold
1994 .byte 102,15,58,223,202,2
1995 call L096key_192b
1996 .byte 102,15,58,223,202,4
1997 call L097key_192a
1998 .byte 102,15,58,223,202,8
1999 call L096key_192b
2000 .byte 102,15,58,223,202,16
2001 call L097key_192a
2002 .byte 102,15,58,223,202,32
2003 call L096key_192b
2004 .byte 102,15,58,223,202,64
2005 call L097key_192a
2006 .byte 102,15,58,223,202,128
2007 call L096key_192b
2008 movups %xmm0,(%edx)
2009 movl %ecx,48(%edx)
2010 xorl %eax,%eax
2011 ret
2012 .align 4,0x90
2013 L097key_192a:
2014 movups %xmm0,(%edx)
2015 leal 16(%edx),%edx
2016 .align 4,0x90
2017 L095key_192a_cold:
2018 movaps %xmm2,%xmm5
2019 L098key_192b_warm:
2020 shufps $16,%xmm0,%xmm4
2021 movdqa %xmm2,%xmm3
2022 xorps %xmm4,%xmm0
2023 shufps $140,%xmm0,%xmm4
2024 pslldq $4,%xmm3
2025 xorps %xmm4,%xmm0
2026 pshufd $85,%xmm1,%xmm1
2027 pxor %xmm3,%xmm2
2028 pxor %xmm1,%xmm0
2029 pshufd $255,%xmm0,%xmm3
2030 pxor %xmm3,%xmm2
2031 ret
2032 .align 4,0x90
2033 L096key_192b:
2034 movaps %xmm0,%xmm3
2035 shufps $68,%xmm0,%xmm5
2036 movups %xmm5,(%edx)
2037 shufps $78,%xmm2,%xmm3
2038 movups %xmm3,16(%edx)
2039 leal 32(%edx),%edx
2040 jmp L098key_192b_warm
2041 .align 4,0x90
2042 L08914rounds:
2043 movups 16(%eax),%xmm2
2044 movl $13,%ecx
2045 leal 16(%edx),%edx
2046 movups %xmm0,-32(%edx)
2047 movups %xmm2,-16(%edx)
2048 .byte 102,15,58,223,202,1
2049 call L099key_256a_cold
2050 .byte 102,15,58,223,200,1
2051 call L100key_256b
2052 .byte 102,15,58,223,202,2
2053 call L101key_256a
2054 .byte 102,15,58,223,200,2
2055 call L100key_256b
2056 .byte 102,15,58,223,202,4
2057 call L101key_256a
2058 .byte 102,15,58,223,200,4
2059 call L100key_256b
2060 .byte 102,15,58,223,202,8
2061 call L101key_256a
2062 .byte 102,15,58,223,200,8
2063 call L100key_256b
2064 .byte 102,15,58,223,202,16
2065 call L101key_256a
2066 .byte 102,15,58,223,200,16
2067 call L100key_256b
2068 .byte 102,15,58,223,202,32
2069 call L101key_256a
2070 .byte 102,15,58,223,200,32
2071 call L100key_256b
2072 .byte 102,15,58,223,202,64
2073 call L101key_256a
2074 movups %xmm0,(%edx)
2075 movl %ecx,16(%edx)
2076 xorl %eax,%eax
2077 ret
2078 .align 4,0x90
2079 L101key_256a:
2080 movups %xmm2,(%edx)
2081 leal 16(%edx),%edx
2082 L099key_256a_cold:
2083 shufps $16,%xmm0,%xmm4
2084 xorps %xmm4,%xmm0
2085 shufps $140,%xmm0,%xmm4
2086 xorps %xmm4,%xmm0
2087 shufps $255,%xmm1,%xmm1
2088 xorps %xmm1,%xmm0
2089 ret
2090 .align 4,0x90
2091 L100key_256b:
2092 movups %xmm0,(%edx)
2093 leal 16(%edx),%edx
2094 shufps $16,%xmm2,%xmm4
2095 xorps %xmm4,%xmm2
2096 shufps $140,%xmm2,%xmm4
2097 xorps %xmm4,%xmm2
2098 shufps $170,%xmm1,%xmm1
2099 xorps %xmm1,%xmm2
2100 ret
2101 .align 2,0x90
2102 L088bad_pointer:
2103 movl $-1,%eax
2104 ret
2105 .align 2,0x90
2106 L091bad_keybits:
2107 movl $-2,%eax
2108 ret
2109 .globl _aesni_set_encrypt_key
2110 .align 4
2111 _aesni_set_encrypt_key:
2112 L_aesni_set_encrypt_key_begin:
2113 movl 4(%esp),%eax
2114 movl 8(%esp),%ecx
2115 movl 12(%esp),%edx
2116 call __aesni_set_encrypt_key
2117 ret
2118 .globl _aesni_set_decrypt_key
2119 .align 4
2120 _aesni_set_decrypt_key:
2121 L_aesni_set_decrypt_key_begin:
2122 movl 4(%esp),%eax
2123 movl 8(%esp),%ecx
2124 movl 12(%esp),%edx
2125 call __aesni_set_encrypt_key
2126 movl 12(%esp),%edx
2127 shll $4,%ecx
2128 testl %eax,%eax
2129 jnz L102dec_key_ret
2130 leal 16(%edx,%ecx,1),%eax
2131 movups (%edx),%xmm0
2132 movups (%eax),%xmm1
2133 movups %xmm0,(%eax)
2134 movups %xmm1,(%edx)
2135 leal 16(%edx),%edx
2136 leal -16(%eax),%eax
2137 L103dec_key_inverse:
2138 movups (%edx),%xmm0
2139 movups (%eax),%xmm1
2140 .byte 102,15,56,219,192
2141 .byte 102,15,56,219,201
2142 leal 16(%edx),%edx
2143 leal -16(%eax),%eax
2144 movups %xmm0,16(%eax)
2145 movups %xmm1,-16(%edx)
2146 cmpl %edx,%eax
2147 ja L103dec_key_inverse
2148 movups (%edx),%xmm0
2149 .byte 102,15,56,219,192
2150 movups %xmm0,(%edx)
2151 xorl %eax,%eax
2152 L102dec_key_ret:
2153 ret
2154 .byte 65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69
2155 .byte 83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83
2156 .byte 32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
2157 .byte 115,108,46,111,114,103,62,0
2158 #endif
OLDNEW
« no previous file with comments | « third_party/boringssl/linux-x86_64/crypto/sha/sha512-x86_64.S ('k') | third_party/boringssl/mac-x86/crypto/aes/vpaes-x86.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698