VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.1/crypto/genasm-macosx/aesni-x86.S@ 94081

Last change on this file since 94081 was 83531, checked in by vboxsync, 5 years ago

setting svn:sync-process=export for openssl-1.1.1f, all files except tests

File size: 62.4 KB
Line 
1.text
2.globl _aesni_encrypt
3.align 4
4_aesni_encrypt:
5L_aesni_encrypt_begin:
6 movl 4(%esp),%eax
7 movl 12(%esp),%edx
8 movups (%eax),%xmm2
9 movl 240(%edx),%ecx
10 movl 8(%esp),%eax
11 movups (%edx),%xmm0
12 movups 16(%edx),%xmm1
13 leal 32(%edx),%edx
14 xorps %xmm0,%xmm2
15L000enc1_loop_1:
16.byte 102,15,56,220,209
17 decl %ecx
18 movups (%edx),%xmm1
19 leal 16(%edx),%edx
20 jnz L000enc1_loop_1
21.byte 102,15,56,221,209
22 pxor %xmm0,%xmm0
23 pxor %xmm1,%xmm1
24 movups %xmm2,(%eax)
25 pxor %xmm2,%xmm2
26 ret
27.globl _aesni_decrypt
28.align 4
29_aesni_decrypt:
30L_aesni_decrypt_begin:
31 movl 4(%esp),%eax
32 movl 12(%esp),%edx
33 movups (%eax),%xmm2
34 movl 240(%edx),%ecx
35 movl 8(%esp),%eax
36 movups (%edx),%xmm0
37 movups 16(%edx),%xmm1
38 leal 32(%edx),%edx
39 xorps %xmm0,%xmm2
40L001dec1_loop_2:
41.byte 102,15,56,222,209
42 decl %ecx
43 movups (%edx),%xmm1
44 leal 16(%edx),%edx
45 jnz L001dec1_loop_2
46.byte 102,15,56,223,209
47 pxor %xmm0,%xmm0
48 pxor %xmm1,%xmm1
49 movups %xmm2,(%eax)
50 pxor %xmm2,%xmm2
51 ret
52.align 4
53__aesni_encrypt2:
54 movups (%edx),%xmm0
55 shll $4,%ecx
56 movups 16(%edx),%xmm1
57 xorps %xmm0,%xmm2
58 pxor %xmm0,%xmm3
59 movups 32(%edx),%xmm0
60 leal 32(%edx,%ecx,1),%edx
61 negl %ecx
62 addl $16,%ecx
63L002enc2_loop:
64.byte 102,15,56,220,209
65.byte 102,15,56,220,217
66 movups (%edx,%ecx,1),%xmm1
67 addl $32,%ecx
68.byte 102,15,56,220,208
69.byte 102,15,56,220,216
70 movups -16(%edx,%ecx,1),%xmm0
71 jnz L002enc2_loop
72.byte 102,15,56,220,209
73.byte 102,15,56,220,217
74.byte 102,15,56,221,208
75.byte 102,15,56,221,216
76 ret
77.align 4
78__aesni_decrypt2:
79 movups (%edx),%xmm0
80 shll $4,%ecx
81 movups 16(%edx),%xmm1
82 xorps %xmm0,%xmm2
83 pxor %xmm0,%xmm3
84 movups 32(%edx),%xmm0
85 leal 32(%edx,%ecx,1),%edx
86 negl %ecx
87 addl $16,%ecx
88L003dec2_loop:
89.byte 102,15,56,222,209
90.byte 102,15,56,222,217
91 movups (%edx,%ecx,1),%xmm1
92 addl $32,%ecx
93.byte 102,15,56,222,208
94.byte 102,15,56,222,216
95 movups -16(%edx,%ecx,1),%xmm0
96 jnz L003dec2_loop
97.byte 102,15,56,222,209
98.byte 102,15,56,222,217
99.byte 102,15,56,223,208
100.byte 102,15,56,223,216
101 ret
102.align 4
103__aesni_encrypt3:
104 movups (%edx),%xmm0
105 shll $4,%ecx
106 movups 16(%edx),%xmm1
107 xorps %xmm0,%xmm2
108 pxor %xmm0,%xmm3
109 pxor %xmm0,%xmm4
110 movups 32(%edx),%xmm0
111 leal 32(%edx,%ecx,1),%edx
112 negl %ecx
113 addl $16,%ecx
114L004enc3_loop:
115.byte 102,15,56,220,209
116.byte 102,15,56,220,217
117.byte 102,15,56,220,225
118 movups (%edx,%ecx,1),%xmm1
119 addl $32,%ecx
120.byte 102,15,56,220,208
121.byte 102,15,56,220,216
122.byte 102,15,56,220,224
123 movups -16(%edx,%ecx,1),%xmm0
124 jnz L004enc3_loop
125.byte 102,15,56,220,209
126.byte 102,15,56,220,217
127.byte 102,15,56,220,225
128.byte 102,15,56,221,208
129.byte 102,15,56,221,216
130.byte 102,15,56,221,224
131 ret
132.align 4
133__aesni_decrypt3:
134 movups (%edx),%xmm0
135 shll $4,%ecx
136 movups 16(%edx),%xmm1
137 xorps %xmm0,%xmm2
138 pxor %xmm0,%xmm3
139 pxor %xmm0,%xmm4
140 movups 32(%edx),%xmm0
141 leal 32(%edx,%ecx,1),%edx
142 negl %ecx
143 addl $16,%ecx
144L005dec3_loop:
145.byte 102,15,56,222,209
146.byte 102,15,56,222,217
147.byte 102,15,56,222,225
148 movups (%edx,%ecx,1),%xmm1
149 addl $32,%ecx
150.byte 102,15,56,222,208
151.byte 102,15,56,222,216
152.byte 102,15,56,222,224
153 movups -16(%edx,%ecx,1),%xmm0
154 jnz L005dec3_loop
155.byte 102,15,56,222,209
156.byte 102,15,56,222,217
157.byte 102,15,56,222,225
158.byte 102,15,56,223,208
159.byte 102,15,56,223,216
160.byte 102,15,56,223,224
161 ret
162.align 4
163__aesni_encrypt4:
164 movups (%edx),%xmm0
165 movups 16(%edx),%xmm1
166 shll $4,%ecx
167 xorps %xmm0,%xmm2
168 pxor %xmm0,%xmm3
169 pxor %xmm0,%xmm4
170 pxor %xmm0,%xmm5
171 movups 32(%edx),%xmm0
172 leal 32(%edx,%ecx,1),%edx
173 negl %ecx
174.byte 15,31,64,0
175 addl $16,%ecx
176L006enc4_loop:
177.byte 102,15,56,220,209
178.byte 102,15,56,220,217
179.byte 102,15,56,220,225
180.byte 102,15,56,220,233
181 movups (%edx,%ecx,1),%xmm1
182 addl $32,%ecx
183.byte 102,15,56,220,208
184.byte 102,15,56,220,216
185.byte 102,15,56,220,224
186.byte 102,15,56,220,232
187 movups -16(%edx,%ecx,1),%xmm0
188 jnz L006enc4_loop
189.byte 102,15,56,220,209
190.byte 102,15,56,220,217
191.byte 102,15,56,220,225
192.byte 102,15,56,220,233
193.byte 102,15,56,221,208
194.byte 102,15,56,221,216
195.byte 102,15,56,221,224
196.byte 102,15,56,221,232
197 ret
198.align 4
199__aesni_decrypt4:
200 movups (%edx),%xmm0
201 movups 16(%edx),%xmm1
202 shll $4,%ecx
203 xorps %xmm0,%xmm2
204 pxor %xmm0,%xmm3
205 pxor %xmm0,%xmm4
206 pxor %xmm0,%xmm5
207 movups 32(%edx),%xmm0
208 leal 32(%edx,%ecx,1),%edx
209 negl %ecx
210.byte 15,31,64,0
211 addl $16,%ecx
212L007dec4_loop:
213.byte 102,15,56,222,209
214.byte 102,15,56,222,217
215.byte 102,15,56,222,225
216.byte 102,15,56,222,233
217 movups (%edx,%ecx,1),%xmm1
218 addl $32,%ecx
219.byte 102,15,56,222,208
220.byte 102,15,56,222,216
221.byte 102,15,56,222,224
222.byte 102,15,56,222,232
223 movups -16(%edx,%ecx,1),%xmm0
224 jnz L007dec4_loop
225.byte 102,15,56,222,209
226.byte 102,15,56,222,217
227.byte 102,15,56,222,225
228.byte 102,15,56,222,233
229.byte 102,15,56,223,208
230.byte 102,15,56,223,216
231.byte 102,15,56,223,224
232.byte 102,15,56,223,232
233 ret
234.align 4
235__aesni_encrypt6:
236 movups (%edx),%xmm0
237 shll $4,%ecx
238 movups 16(%edx),%xmm1
239 xorps %xmm0,%xmm2
240 pxor %xmm0,%xmm3
241 pxor %xmm0,%xmm4
242.byte 102,15,56,220,209
243 pxor %xmm0,%xmm5
244 pxor %xmm0,%xmm6
245.byte 102,15,56,220,217
246 leal 32(%edx,%ecx,1),%edx
247 negl %ecx
248.byte 102,15,56,220,225
249 pxor %xmm0,%xmm7
250 movups (%edx,%ecx,1),%xmm0
251 addl $16,%ecx
252 jmp L008_aesni_encrypt6_inner
253.align 4,0x90
254L009enc6_loop:
255.byte 102,15,56,220,209
256.byte 102,15,56,220,217
257.byte 102,15,56,220,225
258L008_aesni_encrypt6_inner:
259.byte 102,15,56,220,233
260.byte 102,15,56,220,241
261.byte 102,15,56,220,249
262L_aesni_encrypt6_enter:
263 movups (%edx,%ecx,1),%xmm1
264 addl $32,%ecx
265.byte 102,15,56,220,208
266.byte 102,15,56,220,216
267.byte 102,15,56,220,224
268.byte 102,15,56,220,232
269.byte 102,15,56,220,240
270.byte 102,15,56,220,248
271 movups -16(%edx,%ecx,1),%xmm0
272 jnz L009enc6_loop
273.byte 102,15,56,220,209
274.byte 102,15,56,220,217
275.byte 102,15,56,220,225
276.byte 102,15,56,220,233
277.byte 102,15,56,220,241
278.byte 102,15,56,220,249
279.byte 102,15,56,221,208
280.byte 102,15,56,221,216
281.byte 102,15,56,221,224
282.byte 102,15,56,221,232
283.byte 102,15,56,221,240
284.byte 102,15,56,221,248
285 ret
286.align 4
287__aesni_decrypt6:
288 movups (%edx),%xmm0
289 shll $4,%ecx
290 movups 16(%edx),%xmm1
291 xorps %xmm0,%xmm2
292 pxor %xmm0,%xmm3
293 pxor %xmm0,%xmm4
294.byte 102,15,56,222,209
295 pxor %xmm0,%xmm5
296 pxor %xmm0,%xmm6
297.byte 102,15,56,222,217
298 leal 32(%edx,%ecx,1),%edx
299 negl %ecx
300.byte 102,15,56,222,225
301 pxor %xmm0,%xmm7
302 movups (%edx,%ecx,1),%xmm0
303 addl $16,%ecx
304 jmp L010_aesni_decrypt6_inner
305.align 4,0x90
306L011dec6_loop:
307.byte 102,15,56,222,209
308.byte 102,15,56,222,217
309.byte 102,15,56,222,225
310L010_aesni_decrypt6_inner:
311.byte 102,15,56,222,233
312.byte 102,15,56,222,241
313.byte 102,15,56,222,249
314L_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 L011dec6_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:
341L_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 L012ecb_ret
353 movl 240(%edx),%ecx
354 testl %ebx,%ebx
355 jz L013ecb_decrypt
356 movl %edx,%ebp
357 movl %ecx,%ebx
358 cmpl $96,%eax
359 jb L014ecb_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 L015ecb_enc_loop6_enter
369.align 4,0x90
370L016ecb_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
385L015ecb_enc_loop6_enter:
386 call __aesni_encrypt6
387 movl %ebp,%edx
388 movl %ebx,%ecx
389 subl $96,%eax
390 jnc L016ecb_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 L012ecb_ret
400L014ecb_enc_tail:
401 movups (%esi),%xmm2
402 cmpl $32,%eax
403 jb L017ecb_enc_one
404 movups 16(%esi),%xmm3
405 je L018ecb_enc_two
406 movups 32(%esi),%xmm4
407 cmpl $64,%eax
408 jb L019ecb_enc_three
409 movups 48(%esi),%xmm5
410 je L020ecb_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 L012ecb_ret
420.align 4,0x90
421L017ecb_enc_one:
422 movups (%edx),%xmm0
423 movups 16(%edx),%xmm1
424 leal 32(%edx),%edx
425 xorps %xmm0,%xmm2
426L021enc1_loop_3:
427.byte 102,15,56,220,209
428 decl %ecx
429 movups (%edx),%xmm1
430 leal 16(%edx),%edx
431 jnz L021enc1_loop_3
432.byte 102,15,56,221,209
433 movups %xmm2,(%edi)
434 jmp L012ecb_ret
435.align 4,0x90
436L018ecb_enc_two:
437 call __aesni_encrypt2
438 movups %xmm2,(%edi)
439 movups %xmm3,16(%edi)
440 jmp L012ecb_ret
441.align 4,0x90
442L019ecb_enc_three:
443 call __aesni_encrypt3
444 movups %xmm2,(%edi)
445 movups %xmm3,16(%edi)
446 movups %xmm4,32(%edi)
447 jmp L012ecb_ret
448.align 4,0x90
449L020ecb_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 L012ecb_ret
456.align 4,0x90
457L013ecb_decrypt:
458 movl %edx,%ebp
459 movl %ecx,%ebx
460 cmpl $96,%eax
461 jb L022ecb_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 L023ecb_dec_loop6_enter
471.align 4,0x90
472L024ecb_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
487L023ecb_dec_loop6_enter:
488 call __aesni_decrypt6
489 movl %ebp,%edx
490 movl %ebx,%ecx
491 subl $96,%eax
492 jnc L024ecb_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 L012ecb_ret
502L022ecb_dec_tail:
503 movups (%esi),%xmm2
504 cmpl $32,%eax
505 jb L025ecb_dec_one
506 movups 16(%esi),%xmm3
507 je L026ecb_dec_two
508 movups 32(%esi),%xmm4
509 cmpl $64,%eax
510 jb L027ecb_dec_three
511 movups 48(%esi),%xmm5
512 je L028ecb_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 L012ecb_ret
522.align 4,0x90
523L025ecb_dec_one:
524 movups (%edx),%xmm0
525 movups 16(%edx),%xmm1
526 leal 32(%edx),%edx
527 xorps %xmm0,%xmm2
528L029dec1_loop_4:
529.byte 102,15,56,222,209
530 decl %ecx
531 movups (%edx),%xmm1
532 leal 16(%edx),%edx
533 jnz L029dec1_loop_4
534.byte 102,15,56,223,209
535 movups %xmm2,(%edi)
536 jmp L012ecb_ret
537.align 4,0x90
538L026ecb_dec_two:
539 call __aesni_decrypt2
540 movups %xmm2,(%edi)
541 movups %xmm3,16(%edi)
542 jmp L012ecb_ret
543.align 4,0x90
544L027ecb_dec_three:
545 call __aesni_decrypt3
546 movups %xmm2,(%edi)
547 movups %xmm3,16(%edi)
548 movups %xmm4,32(%edi)
549 jmp L012ecb_ret
550.align 4,0x90
551L028ecb_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)
557L012ecb_ret:
558 pxor %xmm0,%xmm0
559 pxor %xmm1,%xmm1
560 pxor %xmm2,%xmm2
561 pxor %xmm3,%xmm3
562 pxor %xmm4,%xmm4
563 pxor %xmm5,%xmm5
564 pxor %xmm6,%xmm6
565 pxor %xmm7,%xmm7
566 popl %edi
567 popl %esi
568 popl %ebx
569 popl %ebp
570 ret
571.globl _aesni_ccm64_encrypt_blocks
572.align 4
573_aesni_ccm64_encrypt_blocks:
574L_aesni_ccm64_encrypt_blocks_begin:
575 pushl %ebp
576 pushl %ebx
577 pushl %esi
578 pushl %edi
579 movl 20(%esp),%esi
580 movl 24(%esp),%edi
581 movl 28(%esp),%eax
582 movl 32(%esp),%edx
583 movl 36(%esp),%ebx
584 movl 40(%esp),%ecx
585 movl %esp,%ebp
586 subl $60,%esp
587 andl $-16,%esp
588 movl %ebp,48(%esp)
589 movdqu (%ebx),%xmm7
590 movdqu (%ecx),%xmm3
591 movl 240(%edx),%ecx
592 movl $202182159,(%esp)
593 movl $134810123,4(%esp)
594 movl $67438087,8(%esp)
595 movl $66051,12(%esp)
596 movl $1,%ebx
597 xorl %ebp,%ebp
598 movl %ebx,16(%esp)
599 movl %ebp,20(%esp)
600 movl %ebp,24(%esp)
601 movl %ebp,28(%esp)
602 shll $4,%ecx
603 movl $16,%ebx
604 leal (%edx),%ebp
605 movdqa (%esp),%xmm5
606 movdqa %xmm7,%xmm2
607 leal 32(%edx,%ecx,1),%edx
608 subl %ecx,%ebx
609.byte 102,15,56,0,253
610L030ccm64_enc_outer:
611 movups (%ebp),%xmm0
612 movl %ebx,%ecx
613 movups (%esi),%xmm6
614 xorps %xmm0,%xmm2
615 movups 16(%ebp),%xmm1
616 xorps %xmm6,%xmm0
617 xorps %xmm0,%xmm3
618 movups 32(%ebp),%xmm0
619L031ccm64_enc2_loop:
620.byte 102,15,56,220,209
621.byte 102,15,56,220,217
622 movups (%edx,%ecx,1),%xmm1
623 addl $32,%ecx
624.byte 102,15,56,220,208
625.byte 102,15,56,220,216
626 movups -16(%edx,%ecx,1),%xmm0
627 jnz L031ccm64_enc2_loop
628.byte 102,15,56,220,209
629.byte 102,15,56,220,217
630 paddq 16(%esp),%xmm7
631 decl %eax
632.byte 102,15,56,221,208
633.byte 102,15,56,221,216
634 leal 16(%esi),%esi
635 xorps %xmm2,%xmm6
636 movdqa %xmm7,%xmm2
637 movups %xmm6,(%edi)
638.byte 102,15,56,0,213
639 leal 16(%edi),%edi
640 jnz L030ccm64_enc_outer
641 movl 48(%esp),%esp
642 movl 40(%esp),%edi
643 movups %xmm3,(%edi)
644 pxor %xmm0,%xmm0
645 pxor %xmm1,%xmm1
646 pxor %xmm2,%xmm2
647 pxor %xmm3,%xmm3
648 pxor %xmm4,%xmm4
649 pxor %xmm5,%xmm5
650 pxor %xmm6,%xmm6
651 pxor %xmm7,%xmm7
652 popl %edi
653 popl %esi
654 popl %ebx
655 popl %ebp
656 ret
657.globl _aesni_ccm64_decrypt_blocks
658.align 4
659_aesni_ccm64_decrypt_blocks:
660L_aesni_ccm64_decrypt_blocks_begin:
661 pushl %ebp
662 pushl %ebx
663 pushl %esi
664 pushl %edi
665 movl 20(%esp),%esi
666 movl 24(%esp),%edi
667 movl 28(%esp),%eax
668 movl 32(%esp),%edx
669 movl 36(%esp),%ebx
670 movl 40(%esp),%ecx
671 movl %esp,%ebp
672 subl $60,%esp
673 andl $-16,%esp
674 movl %ebp,48(%esp)
675 movdqu (%ebx),%xmm7
676 movdqu (%ecx),%xmm3
677 movl 240(%edx),%ecx
678 movl $202182159,(%esp)
679 movl $134810123,4(%esp)
680 movl $67438087,8(%esp)
681 movl $66051,12(%esp)
682 movl $1,%ebx
683 xorl %ebp,%ebp
684 movl %ebx,16(%esp)
685 movl %ebp,20(%esp)
686 movl %ebp,24(%esp)
687 movl %ebp,28(%esp)
688 movdqa (%esp),%xmm5
689 movdqa %xmm7,%xmm2
690 movl %edx,%ebp
691 movl %ecx,%ebx
692.byte 102,15,56,0,253
693 movups (%edx),%xmm0
694 movups 16(%edx),%xmm1
695 leal 32(%edx),%edx
696 xorps %xmm0,%xmm2
697L032enc1_loop_5:
698.byte 102,15,56,220,209
699 decl %ecx
700 movups (%edx),%xmm1
701 leal 16(%edx),%edx
702 jnz L032enc1_loop_5
703.byte 102,15,56,221,209
704 shll $4,%ebx
705 movl $16,%ecx
706 movups (%esi),%xmm6
707 paddq 16(%esp),%xmm7
708 leal 16(%esi),%esi
709 subl %ebx,%ecx
710 leal 32(%ebp,%ebx,1),%edx
711 movl %ecx,%ebx
712 jmp L033ccm64_dec_outer
713.align 4,0x90
714L033ccm64_dec_outer:
715 xorps %xmm2,%xmm6
716 movdqa %xmm7,%xmm2
717 movups %xmm6,(%edi)
718 leal 16(%edi),%edi
719.byte 102,15,56,0,213
720 subl $1,%eax
721 jz L034ccm64_dec_break
722 movups (%ebp),%xmm0
723 movl %ebx,%ecx
724 movups 16(%ebp),%xmm1
725 xorps %xmm0,%xmm6
726 xorps %xmm0,%xmm2
727 xorps %xmm6,%xmm3
728 movups 32(%ebp),%xmm0
729L035ccm64_dec2_loop:
730.byte 102,15,56,220,209
731.byte 102,15,56,220,217
732 movups (%edx,%ecx,1),%xmm1
733 addl $32,%ecx
734.byte 102,15,56,220,208
735.byte 102,15,56,220,216
736 movups -16(%edx,%ecx,1),%xmm0
737 jnz L035ccm64_dec2_loop
738 movups (%esi),%xmm6
739 paddq 16(%esp),%xmm7
740.byte 102,15,56,220,209
741.byte 102,15,56,220,217
742.byte 102,15,56,221,208
743.byte 102,15,56,221,216
744 leal 16(%esi),%esi
745 jmp L033ccm64_dec_outer
746.align 4,0x90
747L034ccm64_dec_break:
748 movl 240(%ebp),%ecx
749 movl %ebp,%edx
750 movups (%edx),%xmm0
751 movups 16(%edx),%xmm1
752 xorps %xmm0,%xmm6
753 leal 32(%edx),%edx
754 xorps %xmm6,%xmm3
755L036enc1_loop_6:
756.byte 102,15,56,220,217
757 decl %ecx
758 movups (%edx),%xmm1
759 leal 16(%edx),%edx
760 jnz L036enc1_loop_6
761.byte 102,15,56,221,217
762 movl 48(%esp),%esp
763 movl 40(%esp),%edi
764 movups %xmm3,(%edi)
765 pxor %xmm0,%xmm0
766 pxor %xmm1,%xmm1
767 pxor %xmm2,%xmm2
768 pxor %xmm3,%xmm3
769 pxor %xmm4,%xmm4
770 pxor %xmm5,%xmm5
771 pxor %xmm6,%xmm6
772 pxor %xmm7,%xmm7
773 popl %edi
774 popl %esi
775 popl %ebx
776 popl %ebp
777 ret
778.globl _aesni_ctr32_encrypt_blocks
779.align 4
780_aesni_ctr32_encrypt_blocks:
781L_aesni_ctr32_encrypt_blocks_begin:
782 pushl %ebp
783 pushl %ebx
784 pushl %esi
785 pushl %edi
786 movl 20(%esp),%esi
787 movl 24(%esp),%edi
788 movl 28(%esp),%eax
789 movl 32(%esp),%edx
790 movl 36(%esp),%ebx
791 movl %esp,%ebp
792 subl $88,%esp
793 andl $-16,%esp
794 movl %ebp,80(%esp)
795 cmpl $1,%eax
796 je L037ctr32_one_shortcut
797 movdqu (%ebx),%xmm7
798 movl $202182159,(%esp)
799 movl $134810123,4(%esp)
800 movl $67438087,8(%esp)
801 movl $66051,12(%esp)
802 movl $6,%ecx
803 xorl %ebp,%ebp
804 movl %ecx,16(%esp)
805 movl %ecx,20(%esp)
806 movl %ecx,24(%esp)
807 movl %ebp,28(%esp)
808.byte 102,15,58,22,251,3
809.byte 102,15,58,34,253,3
810 movl 240(%edx),%ecx
811 bswap %ebx
812 pxor %xmm0,%xmm0
813 pxor %xmm1,%xmm1
814 movdqa (%esp),%xmm2
815.byte 102,15,58,34,195,0
816 leal 3(%ebx),%ebp
817.byte 102,15,58,34,205,0
818 incl %ebx
819.byte 102,15,58,34,195,1
820 incl %ebp
821.byte 102,15,58,34,205,1
822 incl %ebx
823.byte 102,15,58,34,195,2
824 incl %ebp
825.byte 102,15,58,34,205,2
826 movdqa %xmm0,48(%esp)
827.byte 102,15,56,0,194
828 movdqu (%edx),%xmm6
829 movdqa %xmm1,64(%esp)
830.byte 102,15,56,0,202
831 pshufd $192,%xmm0,%xmm2
832 pshufd $128,%xmm0,%xmm3
833 cmpl $6,%eax
834 jb L038ctr32_tail
835 pxor %xmm6,%xmm7
836 shll $4,%ecx
837 movl $16,%ebx
838 movdqa %xmm7,32(%esp)
839 movl %edx,%ebp
840 subl %ecx,%ebx
841 leal 32(%edx,%ecx,1),%edx
842 subl $6,%eax
843 jmp L039ctr32_loop6
844.align 4,0x90
845L039ctr32_loop6:
846 pshufd $64,%xmm0,%xmm4
847 movdqa 32(%esp),%xmm0
848 pshufd $192,%xmm1,%xmm5
849 pxor %xmm0,%xmm2
850 pshufd $128,%xmm1,%xmm6
851 pxor %xmm0,%xmm3
852 pshufd $64,%xmm1,%xmm7
853 movups 16(%ebp),%xmm1
854 pxor %xmm0,%xmm4
855 pxor %xmm0,%xmm5
856.byte 102,15,56,220,209
857 pxor %xmm0,%xmm6
858 pxor %xmm0,%xmm7
859.byte 102,15,56,220,217
860 movups 32(%ebp),%xmm0
861 movl %ebx,%ecx
862.byte 102,15,56,220,225
863.byte 102,15,56,220,233
864.byte 102,15,56,220,241
865.byte 102,15,56,220,249
866 call L_aesni_encrypt6_enter
867 movups (%esi),%xmm1
868 movups 16(%esi),%xmm0
869 xorps %xmm1,%xmm2
870 movups 32(%esi),%xmm1
871 xorps %xmm0,%xmm3
872 movups %xmm2,(%edi)
873 movdqa 16(%esp),%xmm0
874 xorps %xmm1,%xmm4
875 movdqa 64(%esp),%xmm1
876 movups %xmm3,16(%edi)
877 movups %xmm4,32(%edi)
878 paddd %xmm0,%xmm1
879 paddd 48(%esp),%xmm0
880 movdqa (%esp),%xmm2
881 movups 48(%esi),%xmm3
882 movups 64(%esi),%xmm4
883 xorps %xmm3,%xmm5
884 movups 80(%esi),%xmm3
885 leal 96(%esi),%esi
886 movdqa %xmm0,48(%esp)
887.byte 102,15,56,0,194
888 xorps %xmm4,%xmm6
889 movups %xmm5,48(%edi)
890 xorps %xmm3,%xmm7
891 movdqa %xmm1,64(%esp)
892.byte 102,15,56,0,202
893 movups %xmm6,64(%edi)
894 pshufd $192,%xmm0,%xmm2
895 movups %xmm7,80(%edi)
896 leal 96(%edi),%edi
897 pshufd $128,%xmm0,%xmm3
898 subl $6,%eax
899 jnc L039ctr32_loop6
900 addl $6,%eax
901 jz L040ctr32_ret
902 movdqu (%ebp),%xmm7
903 movl %ebp,%edx
904 pxor 32(%esp),%xmm7
905 movl 240(%ebp),%ecx
906L038ctr32_tail:
907 por %xmm7,%xmm2
908 cmpl $2,%eax
909 jb L041ctr32_one
910 pshufd $64,%xmm0,%xmm4
911 por %xmm7,%xmm3
912 je L042ctr32_two
913 pshufd $192,%xmm1,%xmm5
914 por %xmm7,%xmm4
915 cmpl $4,%eax
916 jb L043ctr32_three
917 pshufd $128,%xmm1,%xmm6
918 por %xmm7,%xmm5
919 je L044ctr32_four
920 por %xmm7,%xmm6
921 call __aesni_encrypt6
922 movups (%esi),%xmm1
923 movups 16(%esi),%xmm0
924 xorps %xmm1,%xmm2
925 movups 32(%esi),%xmm1
926 xorps %xmm0,%xmm3
927 movups 48(%esi),%xmm0
928 xorps %xmm1,%xmm4
929 movups 64(%esi),%xmm1
930 xorps %xmm0,%xmm5
931 movups %xmm2,(%edi)
932 xorps %xmm1,%xmm6
933 movups %xmm3,16(%edi)
934 movups %xmm4,32(%edi)
935 movups %xmm5,48(%edi)
936 movups %xmm6,64(%edi)
937 jmp L040ctr32_ret
938.align 4,0x90
939L037ctr32_one_shortcut:
940 movups (%ebx),%xmm2
941 movl 240(%edx),%ecx
942L041ctr32_one:
943 movups (%edx),%xmm0
944 movups 16(%edx),%xmm1
945 leal 32(%edx),%edx
946 xorps %xmm0,%xmm2
947L045enc1_loop_7:
948.byte 102,15,56,220,209
949 decl %ecx
950 movups (%edx),%xmm1
951 leal 16(%edx),%edx
952 jnz L045enc1_loop_7
953.byte 102,15,56,221,209
954 movups (%esi),%xmm6
955 xorps %xmm2,%xmm6
956 movups %xmm6,(%edi)
957 jmp L040ctr32_ret
958.align 4,0x90
959L042ctr32_two:
960 call __aesni_encrypt2
961 movups (%esi),%xmm5
962 movups 16(%esi),%xmm6
963 xorps %xmm5,%xmm2
964 xorps %xmm6,%xmm3
965 movups %xmm2,(%edi)
966 movups %xmm3,16(%edi)
967 jmp L040ctr32_ret
968.align 4,0x90
969L043ctr32_three:
970 call __aesni_encrypt3
971 movups (%esi),%xmm5
972 movups 16(%esi),%xmm6
973 xorps %xmm5,%xmm2
974 movups 32(%esi),%xmm7
975 xorps %xmm6,%xmm3
976 movups %xmm2,(%edi)
977 xorps %xmm7,%xmm4
978 movups %xmm3,16(%edi)
979 movups %xmm4,32(%edi)
980 jmp L040ctr32_ret
981.align 4,0x90
982L044ctr32_four:
983 call __aesni_encrypt4
984 movups (%esi),%xmm6
985 movups 16(%esi),%xmm7
986 movups 32(%esi),%xmm1
987 xorps %xmm6,%xmm2
988 movups 48(%esi),%xmm0
989 xorps %xmm7,%xmm3
990 movups %xmm2,(%edi)
991 xorps %xmm1,%xmm4
992 movups %xmm3,16(%edi)
993 xorps %xmm0,%xmm5
994 movups %xmm4,32(%edi)
995 movups %xmm5,48(%edi)
996L040ctr32_ret:
997 pxor %xmm0,%xmm0
998 pxor %xmm1,%xmm1
999 pxor %xmm2,%xmm2
1000 pxor %xmm3,%xmm3
1001 pxor %xmm4,%xmm4
1002 movdqa %xmm0,32(%esp)
1003 pxor %xmm5,%xmm5
1004 movdqa %xmm0,48(%esp)
1005 pxor %xmm6,%xmm6
1006 movdqa %xmm0,64(%esp)
1007 pxor %xmm7,%xmm7
1008 movl 80(%esp),%esp
1009 popl %edi
1010 popl %esi
1011 popl %ebx
1012 popl %ebp
1013 ret
1014.globl _aesni_xts_encrypt
1015.align 4
1016_aesni_xts_encrypt:
1017L_aesni_xts_encrypt_begin:
1018 pushl %ebp
1019 pushl %ebx
1020 pushl %esi
1021 pushl %edi
1022 movl 36(%esp),%edx
1023 movl 40(%esp),%esi
1024 movl 240(%edx),%ecx
1025 movups (%esi),%xmm2
1026 movups (%edx),%xmm0
1027 movups 16(%edx),%xmm1
1028 leal 32(%edx),%edx
1029 xorps %xmm0,%xmm2
1030L046enc1_loop_8:
1031.byte 102,15,56,220,209
1032 decl %ecx
1033 movups (%edx),%xmm1
1034 leal 16(%edx),%edx
1035 jnz L046enc1_loop_8
1036.byte 102,15,56,221,209
1037 movl 20(%esp),%esi
1038 movl 24(%esp),%edi
1039 movl 28(%esp),%eax
1040 movl 32(%esp),%edx
1041 movl %esp,%ebp
1042 subl $120,%esp
1043 movl 240(%edx),%ecx
1044 andl $-16,%esp
1045 movl $135,96(%esp)
1046 movl $0,100(%esp)
1047 movl $1,104(%esp)
1048 movl $0,108(%esp)
1049 movl %eax,112(%esp)
1050 movl %ebp,116(%esp)
1051 movdqa %xmm2,%xmm1
1052 pxor %xmm0,%xmm0
1053 movdqa 96(%esp),%xmm3
1054 pcmpgtd %xmm1,%xmm0
1055 andl $-16,%eax
1056 movl %edx,%ebp
1057 movl %ecx,%ebx
1058 subl $96,%eax
1059 jc L047xts_enc_short
1060 shll $4,%ecx
1061 movl $16,%ebx
1062 subl %ecx,%ebx
1063 leal 32(%edx,%ecx,1),%edx
1064 jmp L048xts_enc_loop6
1065.align 4,0x90
1066L048xts_enc_loop6:
1067 pshufd $19,%xmm0,%xmm2
1068 pxor %xmm0,%xmm0
1069 movdqa %xmm1,(%esp)
1070 paddq %xmm1,%xmm1
1071 pand %xmm3,%xmm2
1072 pcmpgtd %xmm1,%xmm0
1073 pxor %xmm2,%xmm1
1074 pshufd $19,%xmm0,%xmm2
1075 pxor %xmm0,%xmm0
1076 movdqa %xmm1,16(%esp)
1077 paddq %xmm1,%xmm1
1078 pand %xmm3,%xmm2
1079 pcmpgtd %xmm1,%xmm0
1080 pxor %xmm2,%xmm1
1081 pshufd $19,%xmm0,%xmm2
1082 pxor %xmm0,%xmm0
1083 movdqa %xmm1,32(%esp)
1084 paddq %xmm1,%xmm1
1085 pand %xmm3,%xmm2
1086 pcmpgtd %xmm1,%xmm0
1087 pxor %xmm2,%xmm1
1088 pshufd $19,%xmm0,%xmm2
1089 pxor %xmm0,%xmm0
1090 movdqa %xmm1,48(%esp)
1091 paddq %xmm1,%xmm1
1092 pand %xmm3,%xmm2
1093 pcmpgtd %xmm1,%xmm0
1094 pxor %xmm2,%xmm1
1095 pshufd $19,%xmm0,%xmm7
1096 movdqa %xmm1,64(%esp)
1097 paddq %xmm1,%xmm1
1098 movups (%ebp),%xmm0
1099 pand %xmm3,%xmm7
1100 movups (%esi),%xmm2
1101 pxor %xmm1,%xmm7
1102 movl %ebx,%ecx
1103 movdqu 16(%esi),%xmm3
1104 xorps %xmm0,%xmm2
1105 movdqu 32(%esi),%xmm4
1106 pxor %xmm0,%xmm3
1107 movdqu 48(%esi),%xmm5
1108 pxor %xmm0,%xmm4
1109 movdqu 64(%esi),%xmm6
1110 pxor %xmm0,%xmm5
1111 movdqu 80(%esi),%xmm1
1112 pxor %xmm0,%xmm6
1113 leal 96(%esi),%esi
1114 pxor (%esp),%xmm2
1115 movdqa %xmm7,80(%esp)
1116 pxor %xmm1,%xmm7
1117 movups 16(%ebp),%xmm1
1118 pxor 16(%esp),%xmm3
1119 pxor 32(%esp),%xmm4
1120.byte 102,15,56,220,209
1121 pxor 48(%esp),%xmm5
1122 pxor 64(%esp),%xmm6
1123.byte 102,15,56,220,217
1124 pxor %xmm0,%xmm7
1125 movups 32(%ebp),%xmm0
1126.byte 102,15,56,220,225
1127.byte 102,15,56,220,233
1128.byte 102,15,56,220,241
1129.byte 102,15,56,220,249
1130 call L_aesni_encrypt6_enter
1131 movdqa 80(%esp),%xmm1
1132 pxor %xmm0,%xmm0
1133 xorps (%esp),%xmm2
1134 pcmpgtd %xmm1,%xmm0
1135 xorps 16(%esp),%xmm3
1136 movups %xmm2,(%edi)
1137 xorps 32(%esp),%xmm4
1138 movups %xmm3,16(%edi)
1139 xorps 48(%esp),%xmm5
1140 movups %xmm4,32(%edi)
1141 xorps 64(%esp),%xmm6
1142 movups %xmm5,48(%edi)
1143 xorps %xmm1,%xmm7
1144 movups %xmm6,64(%edi)
1145 pshufd $19,%xmm0,%xmm2
1146 movups %xmm7,80(%edi)
1147 leal 96(%edi),%edi
1148 movdqa 96(%esp),%xmm3
1149 pxor %xmm0,%xmm0
1150 paddq %xmm1,%xmm1
1151 pand %xmm3,%xmm2
1152 pcmpgtd %xmm1,%xmm0
1153 pxor %xmm2,%xmm1
1154 subl $96,%eax
1155 jnc L048xts_enc_loop6
1156 movl 240(%ebp),%ecx
1157 movl %ebp,%edx
1158 movl %ecx,%ebx
1159L047xts_enc_short:
1160 addl $96,%eax
1161 jz L049xts_enc_done6x
1162 movdqa %xmm1,%xmm5
1163 cmpl $32,%eax
1164 jb L050xts_enc_one
1165 pshufd $19,%xmm0,%xmm2
1166 pxor %xmm0,%xmm0
1167 paddq %xmm1,%xmm1
1168 pand %xmm3,%xmm2
1169 pcmpgtd %xmm1,%xmm0
1170 pxor %xmm2,%xmm1
1171 je L051xts_enc_two
1172 pshufd $19,%xmm0,%xmm2
1173 pxor %xmm0,%xmm0
1174 movdqa %xmm1,%xmm6
1175 paddq %xmm1,%xmm1
1176 pand %xmm3,%xmm2
1177 pcmpgtd %xmm1,%xmm0
1178 pxor %xmm2,%xmm1
1179 cmpl $64,%eax
1180 jb L052xts_enc_three
1181 pshufd $19,%xmm0,%xmm2
1182 pxor %xmm0,%xmm0
1183 movdqa %xmm1,%xmm7
1184 paddq %xmm1,%xmm1
1185 pand %xmm3,%xmm2
1186 pcmpgtd %xmm1,%xmm0
1187 pxor %xmm2,%xmm1
1188 movdqa %xmm5,(%esp)
1189 movdqa %xmm6,16(%esp)
1190 je L053xts_enc_four
1191 movdqa %xmm7,32(%esp)
1192 pshufd $19,%xmm0,%xmm7
1193 movdqa %xmm1,48(%esp)
1194 paddq %xmm1,%xmm1
1195 pand %xmm3,%xmm7
1196 pxor %xmm1,%xmm7
1197 movdqu (%esi),%xmm2
1198 movdqu 16(%esi),%xmm3
1199 movdqu 32(%esi),%xmm4
1200 pxor (%esp),%xmm2
1201 movdqu 48(%esi),%xmm5
1202 pxor 16(%esp),%xmm3
1203 movdqu 64(%esi),%xmm6
1204 pxor 32(%esp),%xmm4
1205 leal 80(%esi),%esi
1206 pxor 48(%esp),%xmm5
1207 movdqa %xmm7,64(%esp)
1208 pxor %xmm7,%xmm6
1209 call __aesni_encrypt6
1210 movaps 64(%esp),%xmm1
1211 xorps (%esp),%xmm2
1212 xorps 16(%esp),%xmm3
1213 xorps 32(%esp),%xmm4
1214 movups %xmm2,(%edi)
1215 xorps 48(%esp),%xmm5
1216 movups %xmm3,16(%edi)
1217 xorps %xmm1,%xmm6
1218 movups %xmm4,32(%edi)
1219 movups %xmm5,48(%edi)
1220 movups %xmm6,64(%edi)
1221 leal 80(%edi),%edi
1222 jmp L054xts_enc_done
1223.align 4,0x90
1224L050xts_enc_one:
1225 movups (%esi),%xmm2
1226 leal 16(%esi),%esi
1227 xorps %xmm5,%xmm2
1228 movups (%edx),%xmm0
1229 movups 16(%edx),%xmm1
1230 leal 32(%edx),%edx
1231 xorps %xmm0,%xmm2
1232L055enc1_loop_9:
1233.byte 102,15,56,220,209
1234 decl %ecx
1235 movups (%edx),%xmm1
1236 leal 16(%edx),%edx
1237 jnz L055enc1_loop_9
1238.byte 102,15,56,221,209
1239 xorps %xmm5,%xmm2
1240 movups %xmm2,(%edi)
1241 leal 16(%edi),%edi
1242 movdqa %xmm5,%xmm1
1243 jmp L054xts_enc_done
1244.align 4,0x90
1245L051xts_enc_two:
1246 movaps %xmm1,%xmm6
1247 movups (%esi),%xmm2
1248 movups 16(%esi),%xmm3
1249 leal 32(%esi),%esi
1250 xorps %xmm5,%xmm2
1251 xorps %xmm6,%xmm3
1252 call __aesni_encrypt2
1253 xorps %xmm5,%xmm2
1254 xorps %xmm6,%xmm3
1255 movups %xmm2,(%edi)
1256 movups %xmm3,16(%edi)
1257 leal 32(%edi),%edi
1258 movdqa %xmm6,%xmm1
1259 jmp L054xts_enc_done
1260.align 4,0x90
1261L052xts_enc_three:
1262 movaps %xmm1,%xmm7
1263 movups (%esi),%xmm2
1264 movups 16(%esi),%xmm3
1265 movups 32(%esi),%xmm4
1266 leal 48(%esi),%esi
1267 xorps %xmm5,%xmm2
1268 xorps %xmm6,%xmm3
1269 xorps %xmm7,%xmm4
1270 call __aesni_encrypt3
1271 xorps %xmm5,%xmm2
1272 xorps %xmm6,%xmm3
1273 xorps %xmm7,%xmm4
1274 movups %xmm2,(%edi)
1275 movups %xmm3,16(%edi)
1276 movups %xmm4,32(%edi)
1277 leal 48(%edi),%edi
1278 movdqa %xmm7,%xmm1
1279 jmp L054xts_enc_done
1280.align 4,0x90
1281L053xts_enc_four:
1282 movaps %xmm1,%xmm6
1283 movups (%esi),%xmm2
1284 movups 16(%esi),%xmm3
1285 movups 32(%esi),%xmm4
1286 xorps (%esp),%xmm2
1287 movups 48(%esi),%xmm5
1288 leal 64(%esi),%esi
1289 xorps 16(%esp),%xmm3
1290 xorps %xmm7,%xmm4
1291 xorps %xmm6,%xmm5
1292 call __aesni_encrypt4
1293 xorps (%esp),%xmm2
1294 xorps 16(%esp),%xmm3
1295 xorps %xmm7,%xmm4
1296 movups %xmm2,(%edi)
1297 xorps %xmm6,%xmm5
1298 movups %xmm3,16(%edi)
1299 movups %xmm4,32(%edi)
1300 movups %xmm5,48(%edi)
1301 leal 64(%edi),%edi
1302 movdqa %xmm6,%xmm1
1303 jmp L054xts_enc_done
1304.align 4,0x90
1305L049xts_enc_done6x:
1306 movl 112(%esp),%eax
1307 andl $15,%eax
1308 jz L056xts_enc_ret
1309 movdqa %xmm1,%xmm5
1310 movl %eax,112(%esp)
1311 jmp L057xts_enc_steal
1312.align 4,0x90
1313L054xts_enc_done:
1314 movl 112(%esp),%eax
1315 pxor %xmm0,%xmm0
1316 andl $15,%eax
1317 jz L056xts_enc_ret
1318 pcmpgtd %xmm1,%xmm0
1319 movl %eax,112(%esp)
1320 pshufd $19,%xmm0,%xmm5
1321 paddq %xmm1,%xmm1
1322 pand 96(%esp),%xmm5
1323 pxor %xmm1,%xmm5
1324L057xts_enc_steal:
1325 movzbl (%esi),%ecx
1326 movzbl -16(%edi),%edx
1327 leal 1(%esi),%esi
1328 movb %cl,-16(%edi)
1329 movb %dl,(%edi)
1330 leal 1(%edi),%edi
1331 subl $1,%eax
1332 jnz L057xts_enc_steal
1333 subl 112(%esp),%edi
1334 movl %ebp,%edx
1335 movl %ebx,%ecx
1336 movups -16(%edi),%xmm2
1337 xorps %xmm5,%xmm2
1338 movups (%edx),%xmm0
1339 movups 16(%edx),%xmm1
1340 leal 32(%edx),%edx
1341 xorps %xmm0,%xmm2
1342L058enc1_loop_10:
1343.byte 102,15,56,220,209
1344 decl %ecx
1345 movups (%edx),%xmm1
1346 leal 16(%edx),%edx
1347 jnz L058enc1_loop_10
1348.byte 102,15,56,221,209
1349 xorps %xmm5,%xmm2
1350 movups %xmm2,-16(%edi)
1351L056xts_enc_ret:
1352 pxor %xmm0,%xmm0
1353 pxor %xmm1,%xmm1
1354 pxor %xmm2,%xmm2
1355 movdqa %xmm0,(%esp)
1356 pxor %xmm3,%xmm3
1357 movdqa %xmm0,16(%esp)
1358 pxor %xmm4,%xmm4
1359 movdqa %xmm0,32(%esp)
1360 pxor %xmm5,%xmm5
1361 movdqa %xmm0,48(%esp)
1362 pxor %xmm6,%xmm6
1363 movdqa %xmm0,64(%esp)
1364 pxor %xmm7,%xmm7
1365 movdqa %xmm0,80(%esp)
1366 movl 116(%esp),%esp
1367 popl %edi
1368 popl %esi
1369 popl %ebx
1370 popl %ebp
1371 ret
1372.globl _aesni_xts_decrypt
1373.align 4
1374_aesni_xts_decrypt:
1375L_aesni_xts_decrypt_begin:
1376 pushl %ebp
1377 pushl %ebx
1378 pushl %esi
1379 pushl %edi
1380 movl 36(%esp),%edx
1381 movl 40(%esp),%esi
1382 movl 240(%edx),%ecx
1383 movups (%esi),%xmm2
1384 movups (%edx),%xmm0
1385 movups 16(%edx),%xmm1
1386 leal 32(%edx),%edx
1387 xorps %xmm0,%xmm2
1388L059enc1_loop_11:
1389.byte 102,15,56,220,209
1390 decl %ecx
1391 movups (%edx),%xmm1
1392 leal 16(%edx),%edx
1393 jnz L059enc1_loop_11
1394.byte 102,15,56,221,209
1395 movl 20(%esp),%esi
1396 movl 24(%esp),%edi
1397 movl 28(%esp),%eax
1398 movl 32(%esp),%edx
1399 movl %esp,%ebp
1400 subl $120,%esp
1401 andl $-16,%esp
1402 xorl %ebx,%ebx
1403 testl $15,%eax
1404 setnz %bl
1405 shll $4,%ebx
1406 subl %ebx,%eax
1407 movl $135,96(%esp)
1408 movl $0,100(%esp)
1409 movl $1,104(%esp)
1410 movl $0,108(%esp)
1411 movl %eax,112(%esp)
1412 movl %ebp,116(%esp)
1413 movl 240(%edx),%ecx
1414 movl %edx,%ebp
1415 movl %ecx,%ebx
1416 movdqa %xmm2,%xmm1
1417 pxor %xmm0,%xmm0
1418 movdqa 96(%esp),%xmm3
1419 pcmpgtd %xmm1,%xmm0
1420 andl $-16,%eax
1421 subl $96,%eax
1422 jc L060xts_dec_short
1423 shll $4,%ecx
1424 movl $16,%ebx
1425 subl %ecx,%ebx
1426 leal 32(%edx,%ecx,1),%edx
1427 jmp L061xts_dec_loop6
1428.align 4,0x90
1429L061xts_dec_loop6:
1430 pshufd $19,%xmm0,%xmm2
1431 pxor %xmm0,%xmm0
1432 movdqa %xmm1,(%esp)
1433 paddq %xmm1,%xmm1
1434 pand %xmm3,%xmm2
1435 pcmpgtd %xmm1,%xmm0
1436 pxor %xmm2,%xmm1
1437 pshufd $19,%xmm0,%xmm2
1438 pxor %xmm0,%xmm0
1439 movdqa %xmm1,16(%esp)
1440 paddq %xmm1,%xmm1
1441 pand %xmm3,%xmm2
1442 pcmpgtd %xmm1,%xmm0
1443 pxor %xmm2,%xmm1
1444 pshufd $19,%xmm0,%xmm2
1445 pxor %xmm0,%xmm0
1446 movdqa %xmm1,32(%esp)
1447 paddq %xmm1,%xmm1
1448 pand %xmm3,%xmm2
1449 pcmpgtd %xmm1,%xmm0
1450 pxor %xmm2,%xmm1
1451 pshufd $19,%xmm0,%xmm2
1452 pxor %xmm0,%xmm0
1453 movdqa %xmm1,48(%esp)
1454 paddq %xmm1,%xmm1
1455 pand %xmm3,%xmm2
1456 pcmpgtd %xmm1,%xmm0
1457 pxor %xmm2,%xmm1
1458 pshufd $19,%xmm0,%xmm7
1459 movdqa %xmm1,64(%esp)
1460 paddq %xmm1,%xmm1
1461 movups (%ebp),%xmm0
1462 pand %xmm3,%xmm7
1463 movups (%esi),%xmm2
1464 pxor %xmm1,%xmm7
1465 movl %ebx,%ecx
1466 movdqu 16(%esi),%xmm3
1467 xorps %xmm0,%xmm2
1468 movdqu 32(%esi),%xmm4
1469 pxor %xmm0,%xmm3
1470 movdqu 48(%esi),%xmm5
1471 pxor %xmm0,%xmm4
1472 movdqu 64(%esi),%xmm6
1473 pxor %xmm0,%xmm5
1474 movdqu 80(%esi),%xmm1
1475 pxor %xmm0,%xmm6
1476 leal 96(%esi),%esi
1477 pxor (%esp),%xmm2
1478 movdqa %xmm7,80(%esp)
1479 pxor %xmm1,%xmm7
1480 movups 16(%ebp),%xmm1
1481 pxor 16(%esp),%xmm3
1482 pxor 32(%esp),%xmm4
1483.byte 102,15,56,222,209
1484 pxor 48(%esp),%xmm5
1485 pxor 64(%esp),%xmm6
1486.byte 102,15,56,222,217
1487 pxor %xmm0,%xmm7
1488 movups 32(%ebp),%xmm0
1489.byte 102,15,56,222,225
1490.byte 102,15,56,222,233
1491.byte 102,15,56,222,241
1492.byte 102,15,56,222,249
1493 call L_aesni_decrypt6_enter
1494 movdqa 80(%esp),%xmm1
1495 pxor %xmm0,%xmm0
1496 xorps (%esp),%xmm2
1497 pcmpgtd %xmm1,%xmm0
1498 xorps 16(%esp),%xmm3
1499 movups %xmm2,(%edi)
1500 xorps 32(%esp),%xmm4
1501 movups %xmm3,16(%edi)
1502 xorps 48(%esp),%xmm5
1503 movups %xmm4,32(%edi)
1504 xorps 64(%esp),%xmm6
1505 movups %xmm5,48(%edi)
1506 xorps %xmm1,%xmm7
1507 movups %xmm6,64(%edi)
1508 pshufd $19,%xmm0,%xmm2
1509 movups %xmm7,80(%edi)
1510 leal 96(%edi),%edi
1511 movdqa 96(%esp),%xmm3
1512 pxor %xmm0,%xmm0
1513 paddq %xmm1,%xmm1
1514 pand %xmm3,%xmm2
1515 pcmpgtd %xmm1,%xmm0
1516 pxor %xmm2,%xmm1
1517 subl $96,%eax
1518 jnc L061xts_dec_loop6
1519 movl 240(%ebp),%ecx
1520 movl %ebp,%edx
1521 movl %ecx,%ebx
1522L060xts_dec_short:
1523 addl $96,%eax
1524 jz L062xts_dec_done6x
1525 movdqa %xmm1,%xmm5
1526 cmpl $32,%eax
1527 jb L063xts_dec_one
1528 pshufd $19,%xmm0,%xmm2
1529 pxor %xmm0,%xmm0
1530 paddq %xmm1,%xmm1
1531 pand %xmm3,%xmm2
1532 pcmpgtd %xmm1,%xmm0
1533 pxor %xmm2,%xmm1
1534 je L064xts_dec_two
1535 pshufd $19,%xmm0,%xmm2
1536 pxor %xmm0,%xmm0
1537 movdqa %xmm1,%xmm6
1538 paddq %xmm1,%xmm1
1539 pand %xmm3,%xmm2
1540 pcmpgtd %xmm1,%xmm0
1541 pxor %xmm2,%xmm1
1542 cmpl $64,%eax
1543 jb L065xts_dec_three
1544 pshufd $19,%xmm0,%xmm2
1545 pxor %xmm0,%xmm0
1546 movdqa %xmm1,%xmm7
1547 paddq %xmm1,%xmm1
1548 pand %xmm3,%xmm2
1549 pcmpgtd %xmm1,%xmm0
1550 pxor %xmm2,%xmm1
1551 movdqa %xmm5,(%esp)
1552 movdqa %xmm6,16(%esp)
1553 je L066xts_dec_four
1554 movdqa %xmm7,32(%esp)
1555 pshufd $19,%xmm0,%xmm7
1556 movdqa %xmm1,48(%esp)
1557 paddq %xmm1,%xmm1
1558 pand %xmm3,%xmm7
1559 pxor %xmm1,%xmm7
1560 movdqu (%esi),%xmm2
1561 movdqu 16(%esi),%xmm3
1562 movdqu 32(%esi),%xmm4
1563 pxor (%esp),%xmm2
1564 movdqu 48(%esi),%xmm5
1565 pxor 16(%esp),%xmm3
1566 movdqu 64(%esi),%xmm6
1567 pxor 32(%esp),%xmm4
1568 leal 80(%esi),%esi
1569 pxor 48(%esp),%xmm5
1570 movdqa %xmm7,64(%esp)
1571 pxor %xmm7,%xmm6
1572 call __aesni_decrypt6
1573 movaps 64(%esp),%xmm1
1574 xorps (%esp),%xmm2
1575 xorps 16(%esp),%xmm3
1576 xorps 32(%esp),%xmm4
1577 movups %xmm2,(%edi)
1578 xorps 48(%esp),%xmm5
1579 movups %xmm3,16(%edi)
1580 xorps %xmm1,%xmm6
1581 movups %xmm4,32(%edi)
1582 movups %xmm5,48(%edi)
1583 movups %xmm6,64(%edi)
1584 leal 80(%edi),%edi
1585 jmp L067xts_dec_done
1586.align 4,0x90
1587L063xts_dec_one:
1588 movups (%esi),%xmm2
1589 leal 16(%esi),%esi
1590 xorps %xmm5,%xmm2
1591 movups (%edx),%xmm0
1592 movups 16(%edx),%xmm1
1593 leal 32(%edx),%edx
1594 xorps %xmm0,%xmm2
1595L068dec1_loop_12:
1596.byte 102,15,56,222,209
1597 decl %ecx
1598 movups (%edx),%xmm1
1599 leal 16(%edx),%edx
1600 jnz L068dec1_loop_12
1601.byte 102,15,56,223,209
1602 xorps %xmm5,%xmm2
1603 movups %xmm2,(%edi)
1604 leal 16(%edi),%edi
1605 movdqa %xmm5,%xmm1
1606 jmp L067xts_dec_done
1607.align 4,0x90
1608L064xts_dec_two:
1609 movaps %xmm1,%xmm6
1610 movups (%esi),%xmm2
1611 movups 16(%esi),%xmm3
1612 leal 32(%esi),%esi
1613 xorps %xmm5,%xmm2
1614 xorps %xmm6,%xmm3
1615 call __aesni_decrypt2
1616 xorps %xmm5,%xmm2
1617 xorps %xmm6,%xmm3
1618 movups %xmm2,(%edi)
1619 movups %xmm3,16(%edi)
1620 leal 32(%edi),%edi
1621 movdqa %xmm6,%xmm1
1622 jmp L067xts_dec_done
1623.align 4,0x90
1624L065xts_dec_three:
1625 movaps %xmm1,%xmm7
1626 movups (%esi),%xmm2
1627 movups 16(%esi),%xmm3
1628 movups 32(%esi),%xmm4
1629 leal 48(%esi),%esi
1630 xorps %xmm5,%xmm2
1631 xorps %xmm6,%xmm3
1632 xorps %xmm7,%xmm4
1633 call __aesni_decrypt3
1634 xorps %xmm5,%xmm2
1635 xorps %xmm6,%xmm3
1636 xorps %xmm7,%xmm4
1637 movups %xmm2,(%edi)
1638 movups %xmm3,16(%edi)
1639 movups %xmm4,32(%edi)
1640 leal 48(%edi),%edi
1641 movdqa %xmm7,%xmm1
1642 jmp L067xts_dec_done
1643.align 4,0x90
1644L066xts_dec_four:
1645 movaps %xmm1,%xmm6
1646 movups (%esi),%xmm2
1647 movups 16(%esi),%xmm3
1648 movups 32(%esi),%xmm4
1649 xorps (%esp),%xmm2
1650 movups 48(%esi),%xmm5
1651 leal 64(%esi),%esi
1652 xorps 16(%esp),%xmm3
1653 xorps %xmm7,%xmm4
1654 xorps %xmm6,%xmm5
1655 call __aesni_decrypt4
1656 xorps (%esp),%xmm2
1657 xorps 16(%esp),%xmm3
1658 xorps %xmm7,%xmm4
1659 movups %xmm2,(%edi)
1660 xorps %xmm6,%xmm5
1661 movups %xmm3,16(%edi)
1662 movups %xmm4,32(%edi)
1663 movups %xmm5,48(%edi)
1664 leal 64(%edi),%edi
1665 movdqa %xmm6,%xmm1
1666 jmp L067xts_dec_done
1667.align 4,0x90
1668L062xts_dec_done6x:
1669 movl 112(%esp),%eax
1670 andl $15,%eax
1671 jz L069xts_dec_ret
1672 movl %eax,112(%esp)
1673 jmp L070xts_dec_only_one_more
1674.align 4,0x90
1675L067xts_dec_done:
1676 movl 112(%esp),%eax
1677 pxor %xmm0,%xmm0
1678 andl $15,%eax
1679 jz L069xts_dec_ret
1680 pcmpgtd %xmm1,%xmm0
1681 movl %eax,112(%esp)
1682 pshufd $19,%xmm0,%xmm2
1683 pxor %xmm0,%xmm0
1684 movdqa 96(%esp),%xmm3
1685 paddq %xmm1,%xmm1
1686 pand %xmm3,%xmm2
1687 pcmpgtd %xmm1,%xmm0
1688 pxor %xmm2,%xmm1
1689L070xts_dec_only_one_more:
1690 pshufd $19,%xmm0,%xmm5
1691 movdqa %xmm1,%xmm6
1692 paddq %xmm1,%xmm1
1693 pand %xmm3,%xmm5
1694 pxor %xmm1,%xmm5
1695 movl %ebp,%edx
1696 movl %ebx,%ecx
1697 movups (%esi),%xmm2
1698 xorps %xmm5,%xmm2
1699 movups (%edx),%xmm0
1700 movups 16(%edx),%xmm1
1701 leal 32(%edx),%edx
1702 xorps %xmm0,%xmm2
1703L071dec1_loop_13:
1704.byte 102,15,56,222,209
1705 decl %ecx
1706 movups (%edx),%xmm1
1707 leal 16(%edx),%edx
1708 jnz L071dec1_loop_13
1709.byte 102,15,56,223,209
1710 xorps %xmm5,%xmm2
1711 movups %xmm2,(%edi)
1712L072xts_dec_steal:
1713 movzbl 16(%esi),%ecx
1714 movzbl (%edi),%edx
1715 leal 1(%esi),%esi
1716 movb %cl,(%edi)
1717 movb %dl,16(%edi)
1718 leal 1(%edi),%edi
1719 subl $1,%eax
1720 jnz L072xts_dec_steal
1721 subl 112(%esp),%edi
1722 movl %ebp,%edx
1723 movl %ebx,%ecx
1724 movups (%edi),%xmm2
1725 xorps %xmm6,%xmm2
1726 movups (%edx),%xmm0
1727 movups 16(%edx),%xmm1
1728 leal 32(%edx),%edx
1729 xorps %xmm0,%xmm2
1730L073dec1_loop_14:
1731.byte 102,15,56,222,209
1732 decl %ecx
1733 movups (%edx),%xmm1
1734 leal 16(%edx),%edx
1735 jnz L073dec1_loop_14
1736.byte 102,15,56,223,209
1737 xorps %xmm6,%xmm2
1738 movups %xmm2,(%edi)
1739L069xts_dec_ret:
1740 pxor %xmm0,%xmm0
1741 pxor %xmm1,%xmm1
1742 pxor %xmm2,%xmm2
1743 movdqa %xmm0,(%esp)
1744 pxor %xmm3,%xmm3
1745 movdqa %xmm0,16(%esp)
1746 pxor %xmm4,%xmm4
1747 movdqa %xmm0,32(%esp)
1748 pxor %xmm5,%xmm5
1749 movdqa %xmm0,48(%esp)
1750 pxor %xmm6,%xmm6
1751 movdqa %xmm0,64(%esp)
1752 pxor %xmm7,%xmm7
1753 movdqa %xmm0,80(%esp)
1754 movl 116(%esp),%esp
1755 popl %edi
1756 popl %esi
1757 popl %ebx
1758 popl %ebp
1759 ret
1760.globl _aesni_ocb_encrypt
1761.align 4
1762_aesni_ocb_encrypt:
1763L_aesni_ocb_encrypt_begin:
1764 pushl %ebp
1765 pushl %ebx
1766 pushl %esi
1767 pushl %edi
1768 movl 40(%esp),%ecx
1769 movl 48(%esp),%ebx
1770 movl 20(%esp),%esi
1771 movl 24(%esp),%edi
1772 movl 28(%esp),%eax
1773 movl 32(%esp),%edx
1774 movdqu (%ecx),%xmm0
1775 movl 36(%esp),%ebp
1776 movdqu (%ebx),%xmm1
1777 movl 44(%esp),%ebx
1778 movl %esp,%ecx
1779 subl $132,%esp
1780 andl $-16,%esp
1781 subl %esi,%edi
1782 shll $4,%eax
1783 leal -96(%esi,%eax,1),%eax
1784 movl %edi,120(%esp)
1785 movl %eax,124(%esp)
1786 movl %ecx,128(%esp)
1787 movl 240(%edx),%ecx
1788 testl $1,%ebp
1789 jnz L074odd
1790 bsfl %ebp,%eax
1791 addl $1,%ebp
1792 shll $4,%eax
1793 movdqu (%ebx,%eax,1),%xmm7
1794 movl %edx,%eax
1795 movdqu (%esi),%xmm2
1796 leal 16(%esi),%esi
1797 pxor %xmm0,%xmm7
1798 pxor %xmm2,%xmm1
1799 pxor %xmm7,%xmm2
1800 movdqa %xmm1,%xmm6
1801 movups (%edx),%xmm0
1802 movups 16(%edx),%xmm1
1803 leal 32(%edx),%edx
1804 xorps %xmm0,%xmm2
1805L075enc1_loop_15:
1806.byte 102,15,56,220,209
1807 decl %ecx
1808 movups (%edx),%xmm1
1809 leal 16(%edx),%edx
1810 jnz L075enc1_loop_15
1811.byte 102,15,56,221,209
1812 xorps %xmm7,%xmm2
1813 movdqa %xmm7,%xmm0
1814 movdqa %xmm6,%xmm1
1815 movups %xmm2,-16(%edi,%esi,1)
1816 movl 240(%eax),%ecx
1817 movl %eax,%edx
1818 movl 124(%esp),%eax
1819L074odd:
1820 shll $4,%ecx
1821 movl $16,%edi
1822 subl %ecx,%edi
1823 movl %edx,112(%esp)
1824 leal 32(%edx,%ecx,1),%edx
1825 movl %edi,116(%esp)
1826 cmpl %eax,%esi
1827 ja L076short
1828 jmp L077grandloop
1829.align 5,0x90
1830L077grandloop:
1831 leal 1(%ebp),%ecx
1832 leal 3(%ebp),%eax
1833 leal 5(%ebp),%edi
1834 addl $6,%ebp
1835 bsfl %ecx,%ecx
1836 bsfl %eax,%eax
1837 bsfl %edi,%edi
1838 shll $4,%ecx
1839 shll $4,%eax
1840 shll $4,%edi
1841 movdqu (%ebx),%xmm2
1842 movdqu (%ebx,%ecx,1),%xmm3
1843 movl 116(%esp),%ecx
1844 movdqa %xmm2,%xmm4
1845 movdqu (%ebx,%eax,1),%xmm5
1846 movdqa %xmm2,%xmm6
1847 movdqu (%ebx,%edi,1),%xmm7
1848 pxor %xmm0,%xmm2
1849 pxor %xmm2,%xmm3
1850 movdqa %xmm2,(%esp)
1851 pxor %xmm3,%xmm4
1852 movdqa %xmm3,16(%esp)
1853 pxor %xmm4,%xmm5
1854 movdqa %xmm4,32(%esp)
1855 pxor %xmm5,%xmm6
1856 movdqa %xmm5,48(%esp)
1857 pxor %xmm6,%xmm7
1858 movdqa %xmm6,64(%esp)
1859 movdqa %xmm7,80(%esp)
1860 movups -48(%edx,%ecx,1),%xmm0
1861 movdqu (%esi),%xmm2
1862 movdqu 16(%esi),%xmm3
1863 movdqu 32(%esi),%xmm4
1864 movdqu 48(%esi),%xmm5
1865 movdqu 64(%esi),%xmm6
1866 movdqu 80(%esi),%xmm7
1867 leal 96(%esi),%esi
1868 pxor %xmm2,%xmm1
1869 pxor %xmm0,%xmm2
1870 pxor %xmm3,%xmm1
1871 pxor %xmm0,%xmm3
1872 pxor %xmm4,%xmm1
1873 pxor %xmm0,%xmm4
1874 pxor %xmm5,%xmm1
1875 pxor %xmm0,%xmm5
1876 pxor %xmm6,%xmm1
1877 pxor %xmm0,%xmm6
1878 pxor %xmm7,%xmm1
1879 pxor %xmm0,%xmm7
1880 movdqa %xmm1,96(%esp)
1881 movups -32(%edx,%ecx,1),%xmm1
1882 pxor (%esp),%xmm2
1883 pxor 16(%esp),%xmm3
1884 pxor 32(%esp),%xmm4
1885 pxor 48(%esp),%xmm5
1886 pxor 64(%esp),%xmm6
1887 pxor 80(%esp),%xmm7
1888 movups -16(%edx,%ecx,1),%xmm0
1889.byte 102,15,56,220,209
1890.byte 102,15,56,220,217
1891.byte 102,15,56,220,225
1892.byte 102,15,56,220,233
1893.byte 102,15,56,220,241
1894.byte 102,15,56,220,249
1895 movl 120(%esp),%edi
1896 movl 124(%esp),%eax
1897 call L_aesni_encrypt6_enter
1898 movdqa 80(%esp),%xmm0
1899 pxor (%esp),%xmm2
1900 pxor 16(%esp),%xmm3
1901 pxor 32(%esp),%xmm4
1902 pxor 48(%esp),%xmm5
1903 pxor 64(%esp),%xmm6
1904 pxor %xmm0,%xmm7
1905 movdqa 96(%esp),%xmm1
1906 movdqu %xmm2,-96(%edi,%esi,1)
1907 movdqu %xmm3,-80(%edi,%esi,1)
1908 movdqu %xmm4,-64(%edi,%esi,1)
1909 movdqu %xmm5,-48(%edi,%esi,1)
1910 movdqu %xmm6,-32(%edi,%esi,1)
1911 movdqu %xmm7,-16(%edi,%esi,1)
1912 cmpl %eax,%esi
1913 jb L077grandloop
1914L076short:
1915 addl $96,%eax
1916 subl %esi,%eax
1917 jz L078done
1918 cmpl $32,%eax
1919 jb L079one
1920 je L080two
1921 cmpl $64,%eax
1922 jb L081three
1923 je L082four
1924 leal 1(%ebp),%ecx
1925 leal 3(%ebp),%eax
1926 bsfl %ecx,%ecx
1927 bsfl %eax,%eax
1928 shll $4,%ecx
1929 shll $4,%eax
1930 movdqu (%ebx),%xmm2
1931 movdqu (%ebx,%ecx,1),%xmm3
1932 movl 116(%esp),%ecx
1933 movdqa %xmm2,%xmm4
1934 movdqu (%ebx,%eax,1),%xmm5
1935 movdqa %xmm2,%xmm6
1936 pxor %xmm0,%xmm2
1937 pxor %xmm2,%xmm3
1938 movdqa %xmm2,(%esp)
1939 pxor %xmm3,%xmm4
1940 movdqa %xmm3,16(%esp)
1941 pxor %xmm4,%xmm5
1942 movdqa %xmm4,32(%esp)
1943 pxor %xmm5,%xmm6
1944 movdqa %xmm5,48(%esp)
1945 pxor %xmm6,%xmm7
1946 movdqa %xmm6,64(%esp)
1947 movups -48(%edx,%ecx,1),%xmm0
1948 movdqu (%esi),%xmm2
1949 movdqu 16(%esi),%xmm3
1950 movdqu 32(%esi),%xmm4
1951 movdqu 48(%esi),%xmm5
1952 movdqu 64(%esi),%xmm6
1953 pxor %xmm7,%xmm7
1954 pxor %xmm2,%xmm1
1955 pxor %xmm0,%xmm2
1956 pxor %xmm3,%xmm1
1957 pxor %xmm0,%xmm3
1958 pxor %xmm4,%xmm1
1959 pxor %xmm0,%xmm4
1960 pxor %xmm5,%xmm1
1961 pxor %xmm0,%xmm5
1962 pxor %xmm6,%xmm1
1963 pxor %xmm0,%xmm6
1964 movdqa %xmm1,96(%esp)
1965 movups -32(%edx,%ecx,1),%xmm1
1966 pxor (%esp),%xmm2
1967 pxor 16(%esp),%xmm3
1968 pxor 32(%esp),%xmm4
1969 pxor 48(%esp),%xmm5
1970 pxor 64(%esp),%xmm6
1971 movups -16(%edx,%ecx,1),%xmm0
1972.byte 102,15,56,220,209
1973.byte 102,15,56,220,217
1974.byte 102,15,56,220,225
1975.byte 102,15,56,220,233
1976.byte 102,15,56,220,241
1977.byte 102,15,56,220,249
1978 movl 120(%esp),%edi
1979 call L_aesni_encrypt6_enter
1980 movdqa 64(%esp),%xmm0
1981 pxor (%esp),%xmm2
1982 pxor 16(%esp),%xmm3
1983 pxor 32(%esp),%xmm4
1984 pxor 48(%esp),%xmm5
1985 pxor %xmm0,%xmm6
1986 movdqa 96(%esp),%xmm1
1987 movdqu %xmm2,(%edi,%esi,1)
1988 movdqu %xmm3,16(%edi,%esi,1)
1989 movdqu %xmm4,32(%edi,%esi,1)
1990 movdqu %xmm5,48(%edi,%esi,1)
1991 movdqu %xmm6,64(%edi,%esi,1)
1992 jmp L078done
1993.align 4,0x90
1994L079one:
1995 movdqu (%ebx),%xmm7
1996 movl 112(%esp),%edx
1997 movdqu (%esi),%xmm2
1998 movl 240(%edx),%ecx
1999 pxor %xmm0,%xmm7
2000 pxor %xmm2,%xmm1
2001 pxor %xmm7,%xmm2
2002 movdqa %xmm1,%xmm6
2003 movl 120(%esp),%edi
2004 movups (%edx),%xmm0
2005 movups 16(%edx),%xmm1
2006 leal 32(%edx),%edx
2007 xorps %xmm0,%xmm2
2008L083enc1_loop_16:
2009.byte 102,15,56,220,209
2010 decl %ecx
2011 movups (%edx),%xmm1
2012 leal 16(%edx),%edx
2013 jnz L083enc1_loop_16
2014.byte 102,15,56,221,209
2015 xorps %xmm7,%xmm2
2016 movdqa %xmm7,%xmm0
2017 movdqa %xmm6,%xmm1
2018 movups %xmm2,(%edi,%esi,1)
2019 jmp L078done
2020.align 4,0x90
2021L080two:
2022 leal 1(%ebp),%ecx
2023 movl 112(%esp),%edx
2024 bsfl %ecx,%ecx
2025 shll $4,%ecx
2026 movdqu (%ebx),%xmm6
2027 movdqu (%ebx,%ecx,1),%xmm7
2028 movdqu (%esi),%xmm2
2029 movdqu 16(%esi),%xmm3
2030 movl 240(%edx),%ecx
2031 pxor %xmm0,%xmm6
2032 pxor %xmm6,%xmm7
2033 pxor %xmm2,%xmm1
2034 pxor %xmm6,%xmm2
2035 pxor %xmm3,%xmm1
2036 pxor %xmm7,%xmm3
2037 movdqa %xmm1,%xmm5
2038 movl 120(%esp),%edi
2039 call __aesni_encrypt2
2040 xorps %xmm6,%xmm2
2041 xorps %xmm7,%xmm3
2042 movdqa %xmm7,%xmm0
2043 movdqa %xmm5,%xmm1
2044 movups %xmm2,(%edi,%esi,1)
2045 movups %xmm3,16(%edi,%esi,1)
2046 jmp L078done
2047.align 4,0x90
2048L081three:
2049 leal 1(%ebp),%ecx
2050 movl 112(%esp),%edx
2051 bsfl %ecx,%ecx
2052 shll $4,%ecx
2053 movdqu (%ebx),%xmm5
2054 movdqu (%ebx,%ecx,1),%xmm6
2055 movdqa %xmm5,%xmm7
2056 movdqu (%esi),%xmm2
2057 movdqu 16(%esi),%xmm3
2058 movdqu 32(%esi),%xmm4
2059 movl 240(%edx),%ecx
2060 pxor %xmm0,%xmm5
2061 pxor %xmm5,%xmm6
2062 pxor %xmm6,%xmm7
2063 pxor %xmm2,%xmm1
2064 pxor %xmm5,%xmm2
2065 pxor %xmm3,%xmm1
2066 pxor %xmm6,%xmm3
2067 pxor %xmm4,%xmm1
2068 pxor %xmm7,%xmm4
2069 movdqa %xmm1,96(%esp)
2070 movl 120(%esp),%edi
2071 call __aesni_encrypt3
2072 xorps %xmm5,%xmm2
2073 xorps %xmm6,%xmm3
2074 xorps %xmm7,%xmm4
2075 movdqa %xmm7,%xmm0
2076 movdqa 96(%esp),%xmm1
2077 movups %xmm2,(%edi,%esi,1)
2078 movups %xmm3,16(%edi,%esi,1)
2079 movups %xmm4,32(%edi,%esi,1)
2080 jmp L078done
2081.align 4,0x90
2082L082four:
2083 leal 1(%ebp),%ecx
2084 leal 3(%ebp),%eax
2085 bsfl %ecx,%ecx
2086 bsfl %eax,%eax
2087 movl 112(%esp),%edx
2088 shll $4,%ecx
2089 shll $4,%eax
2090 movdqu (%ebx),%xmm4
2091 movdqu (%ebx,%ecx,1),%xmm5
2092 movdqa %xmm4,%xmm6
2093 movdqu (%ebx,%eax,1),%xmm7
2094 pxor %xmm0,%xmm4
2095 movdqu (%esi),%xmm2
2096 pxor %xmm4,%xmm5
2097 movdqu 16(%esi),%xmm3
2098 pxor %xmm5,%xmm6
2099 movdqa %xmm4,(%esp)
2100 pxor %xmm6,%xmm7
2101 movdqa %xmm5,16(%esp)
2102 movdqu 32(%esi),%xmm4
2103 movdqu 48(%esi),%xmm5
2104 movl 240(%edx),%ecx
2105 pxor %xmm2,%xmm1
2106 pxor (%esp),%xmm2
2107 pxor %xmm3,%xmm1
2108 pxor 16(%esp),%xmm3
2109 pxor %xmm4,%xmm1
2110 pxor %xmm6,%xmm4
2111 pxor %xmm5,%xmm1
2112 pxor %xmm7,%xmm5
2113 movdqa %xmm1,96(%esp)
2114 movl 120(%esp),%edi
2115 call __aesni_encrypt4
2116 xorps (%esp),%xmm2
2117 xorps 16(%esp),%xmm3
2118 xorps %xmm6,%xmm4
2119 movups %xmm2,(%edi,%esi,1)
2120 xorps %xmm7,%xmm5
2121 movups %xmm3,16(%edi,%esi,1)
2122 movdqa %xmm7,%xmm0
2123 movups %xmm4,32(%edi,%esi,1)
2124 movdqa 96(%esp),%xmm1
2125 movups %xmm5,48(%edi,%esi,1)
2126L078done:
2127 movl 128(%esp),%edx
2128 pxor %xmm2,%xmm2
2129 pxor %xmm3,%xmm3
2130 movdqa %xmm2,(%esp)
2131 pxor %xmm4,%xmm4
2132 movdqa %xmm2,16(%esp)
2133 pxor %xmm5,%xmm5
2134 movdqa %xmm2,32(%esp)
2135 pxor %xmm6,%xmm6
2136 movdqa %xmm2,48(%esp)
2137 pxor %xmm7,%xmm7
2138 movdqa %xmm2,64(%esp)
2139 movdqa %xmm2,80(%esp)
2140 movdqa %xmm2,96(%esp)
2141 leal (%edx),%esp
2142 movl 40(%esp),%ecx
2143 movl 48(%esp),%ebx
2144 movdqu %xmm0,(%ecx)
2145 pxor %xmm0,%xmm0
2146 movdqu %xmm1,(%ebx)
2147 pxor %xmm1,%xmm1
2148 popl %edi
2149 popl %esi
2150 popl %ebx
2151 popl %ebp
2152 ret
2153.globl _aesni_ocb_decrypt
2154.align 4
2155_aesni_ocb_decrypt:
2156L_aesni_ocb_decrypt_begin:
2157 pushl %ebp
2158 pushl %ebx
2159 pushl %esi
2160 pushl %edi
2161 movl 40(%esp),%ecx
2162 movl 48(%esp),%ebx
2163 movl 20(%esp),%esi
2164 movl 24(%esp),%edi
2165 movl 28(%esp),%eax
2166 movl 32(%esp),%edx
2167 movdqu (%ecx),%xmm0
2168 movl 36(%esp),%ebp
2169 movdqu (%ebx),%xmm1
2170 movl 44(%esp),%ebx
2171 movl %esp,%ecx
2172 subl $132,%esp
2173 andl $-16,%esp
2174 subl %esi,%edi
2175 shll $4,%eax
2176 leal -96(%esi,%eax,1),%eax
2177 movl %edi,120(%esp)
2178 movl %eax,124(%esp)
2179 movl %ecx,128(%esp)
2180 movl 240(%edx),%ecx
2181 testl $1,%ebp
2182 jnz L084odd
2183 bsfl %ebp,%eax
2184 addl $1,%ebp
2185 shll $4,%eax
2186 movdqu (%ebx,%eax,1),%xmm7
2187 movl %edx,%eax
2188 movdqu (%esi),%xmm2
2189 leal 16(%esi),%esi
2190 pxor %xmm0,%xmm7
2191 pxor %xmm7,%xmm2
2192 movdqa %xmm1,%xmm6
2193 movups (%edx),%xmm0
2194 movups 16(%edx),%xmm1
2195 leal 32(%edx),%edx
2196 xorps %xmm0,%xmm2
2197L085dec1_loop_17:
2198.byte 102,15,56,222,209
2199 decl %ecx
2200 movups (%edx),%xmm1
2201 leal 16(%edx),%edx
2202 jnz L085dec1_loop_17
2203.byte 102,15,56,223,209
2204 xorps %xmm7,%xmm2
2205 movaps %xmm6,%xmm1
2206 movdqa %xmm7,%xmm0
2207 xorps %xmm2,%xmm1
2208 movups %xmm2,-16(%edi,%esi,1)
2209 movl 240(%eax),%ecx
2210 movl %eax,%edx
2211 movl 124(%esp),%eax
2212L084odd:
2213 shll $4,%ecx
2214 movl $16,%edi
2215 subl %ecx,%edi
2216 movl %edx,112(%esp)
2217 leal 32(%edx,%ecx,1),%edx
2218 movl %edi,116(%esp)
2219 cmpl %eax,%esi
2220 ja L086short
2221 jmp L087grandloop
2222.align 5,0x90
2223L087grandloop:
2224 leal 1(%ebp),%ecx
2225 leal 3(%ebp),%eax
2226 leal 5(%ebp),%edi
2227 addl $6,%ebp
2228 bsfl %ecx,%ecx
2229 bsfl %eax,%eax
2230 bsfl %edi,%edi
2231 shll $4,%ecx
2232 shll $4,%eax
2233 shll $4,%edi
2234 movdqu (%ebx),%xmm2
2235 movdqu (%ebx,%ecx,1),%xmm3
2236 movl 116(%esp),%ecx
2237 movdqa %xmm2,%xmm4
2238 movdqu (%ebx,%eax,1),%xmm5
2239 movdqa %xmm2,%xmm6
2240 movdqu (%ebx,%edi,1),%xmm7
2241 pxor %xmm0,%xmm2
2242 pxor %xmm2,%xmm3
2243 movdqa %xmm2,(%esp)
2244 pxor %xmm3,%xmm4
2245 movdqa %xmm3,16(%esp)
2246 pxor %xmm4,%xmm5
2247 movdqa %xmm4,32(%esp)
2248 pxor %xmm5,%xmm6
2249 movdqa %xmm5,48(%esp)
2250 pxor %xmm6,%xmm7
2251 movdqa %xmm6,64(%esp)
2252 movdqa %xmm7,80(%esp)
2253 movups -48(%edx,%ecx,1),%xmm0
2254 movdqu (%esi),%xmm2
2255 movdqu 16(%esi),%xmm3
2256 movdqu 32(%esi),%xmm4
2257 movdqu 48(%esi),%xmm5
2258 movdqu 64(%esi),%xmm6
2259 movdqu 80(%esi),%xmm7
2260 leal 96(%esi),%esi
2261 movdqa %xmm1,96(%esp)
2262 pxor %xmm0,%xmm2
2263 pxor %xmm0,%xmm3
2264 pxor %xmm0,%xmm4
2265 pxor %xmm0,%xmm5
2266 pxor %xmm0,%xmm6
2267 pxor %xmm0,%xmm7
2268 movups -32(%edx,%ecx,1),%xmm1
2269 pxor (%esp),%xmm2
2270 pxor 16(%esp),%xmm3
2271 pxor 32(%esp),%xmm4
2272 pxor 48(%esp),%xmm5
2273 pxor 64(%esp),%xmm6
2274 pxor 80(%esp),%xmm7
2275 movups -16(%edx,%ecx,1),%xmm0
2276.byte 102,15,56,222,209
2277.byte 102,15,56,222,217
2278.byte 102,15,56,222,225
2279.byte 102,15,56,222,233
2280.byte 102,15,56,222,241
2281.byte 102,15,56,222,249
2282 movl 120(%esp),%edi
2283 movl 124(%esp),%eax
2284 call L_aesni_decrypt6_enter
2285 movdqa 80(%esp),%xmm0
2286 pxor (%esp),%xmm2
2287 movdqa 96(%esp),%xmm1
2288 pxor 16(%esp),%xmm3
2289 pxor 32(%esp),%xmm4
2290 pxor 48(%esp),%xmm5
2291 pxor 64(%esp),%xmm6
2292 pxor %xmm0,%xmm7
2293 pxor %xmm2,%xmm1
2294 movdqu %xmm2,-96(%edi,%esi,1)
2295 pxor %xmm3,%xmm1
2296 movdqu %xmm3,-80(%edi,%esi,1)
2297 pxor %xmm4,%xmm1
2298 movdqu %xmm4,-64(%edi,%esi,1)
2299 pxor %xmm5,%xmm1
2300 movdqu %xmm5,-48(%edi,%esi,1)
2301 pxor %xmm6,%xmm1
2302 movdqu %xmm6,-32(%edi,%esi,1)
2303 pxor %xmm7,%xmm1
2304 movdqu %xmm7,-16(%edi,%esi,1)
2305 cmpl %eax,%esi
2306 jb L087grandloop
2307L086short:
2308 addl $96,%eax
2309 subl %esi,%eax
2310 jz L088done
2311 cmpl $32,%eax
2312 jb L089one
2313 je L090two
2314 cmpl $64,%eax
2315 jb L091three
2316 je L092four
2317 leal 1(%ebp),%ecx
2318 leal 3(%ebp),%eax
2319 bsfl %ecx,%ecx
2320 bsfl %eax,%eax
2321 shll $4,%ecx
2322 shll $4,%eax
2323 movdqu (%ebx),%xmm2
2324 movdqu (%ebx,%ecx,1),%xmm3
2325 movl 116(%esp),%ecx
2326 movdqa %xmm2,%xmm4
2327 movdqu (%ebx,%eax,1),%xmm5
2328 movdqa %xmm2,%xmm6
2329 pxor %xmm0,%xmm2
2330 pxor %xmm2,%xmm3
2331 movdqa %xmm2,(%esp)
2332 pxor %xmm3,%xmm4
2333 movdqa %xmm3,16(%esp)
2334 pxor %xmm4,%xmm5
2335 movdqa %xmm4,32(%esp)
2336 pxor %xmm5,%xmm6
2337 movdqa %xmm5,48(%esp)
2338 pxor %xmm6,%xmm7
2339 movdqa %xmm6,64(%esp)
2340 movups -48(%edx,%ecx,1),%xmm0
2341 movdqu (%esi),%xmm2
2342 movdqu 16(%esi),%xmm3
2343 movdqu 32(%esi),%xmm4
2344 movdqu 48(%esi),%xmm5
2345 movdqu 64(%esi),%xmm6
2346 pxor %xmm7,%xmm7
2347 movdqa %xmm1,96(%esp)
2348 pxor %xmm0,%xmm2
2349 pxor %xmm0,%xmm3
2350 pxor %xmm0,%xmm4
2351 pxor %xmm0,%xmm5
2352 pxor %xmm0,%xmm6
2353 movups -32(%edx,%ecx,1),%xmm1
2354 pxor (%esp),%xmm2
2355 pxor 16(%esp),%xmm3
2356 pxor 32(%esp),%xmm4
2357 pxor 48(%esp),%xmm5
2358 pxor 64(%esp),%xmm6
2359 movups -16(%edx,%ecx,1),%xmm0
2360.byte 102,15,56,222,209
2361.byte 102,15,56,222,217
2362.byte 102,15,56,222,225
2363.byte 102,15,56,222,233
2364.byte 102,15,56,222,241
2365.byte 102,15,56,222,249
2366 movl 120(%esp),%edi
2367 call L_aesni_decrypt6_enter
2368 movdqa 64(%esp),%xmm0
2369 pxor (%esp),%xmm2
2370 movdqa 96(%esp),%xmm1
2371 pxor 16(%esp),%xmm3
2372 pxor 32(%esp),%xmm4
2373 pxor 48(%esp),%xmm5
2374 pxor %xmm0,%xmm6
2375 pxor %xmm2,%xmm1
2376 movdqu %xmm2,(%edi,%esi,1)
2377 pxor %xmm3,%xmm1
2378 movdqu %xmm3,16(%edi,%esi,1)
2379 pxor %xmm4,%xmm1
2380 movdqu %xmm4,32(%edi,%esi,1)
2381 pxor %xmm5,%xmm1
2382 movdqu %xmm5,48(%edi,%esi,1)
2383 pxor %xmm6,%xmm1
2384 movdqu %xmm6,64(%edi,%esi,1)
2385 jmp L088done
2386.align 4,0x90
2387L089one:
2388 movdqu (%ebx),%xmm7
2389 movl 112(%esp),%edx
2390 movdqu (%esi),%xmm2
2391 movl 240(%edx),%ecx
2392 pxor %xmm0,%xmm7
2393 pxor %xmm7,%xmm2
2394 movdqa %xmm1,%xmm6
2395 movl 120(%esp),%edi
2396 movups (%edx),%xmm0
2397 movups 16(%edx),%xmm1
2398 leal 32(%edx),%edx
2399 xorps %xmm0,%xmm2
2400L093dec1_loop_18:
2401.byte 102,15,56,222,209
2402 decl %ecx
2403 movups (%edx),%xmm1
2404 leal 16(%edx),%edx
2405 jnz L093dec1_loop_18
2406.byte 102,15,56,223,209
2407 xorps %xmm7,%xmm2
2408 movaps %xmm6,%xmm1
2409 movdqa %xmm7,%xmm0
2410 xorps %xmm2,%xmm1
2411 movups %xmm2,(%edi,%esi,1)
2412 jmp L088done
2413.align 4,0x90
2414L090two:
2415 leal 1(%ebp),%ecx
2416 movl 112(%esp),%edx
2417 bsfl %ecx,%ecx
2418 shll $4,%ecx
2419 movdqu (%ebx),%xmm6
2420 movdqu (%ebx,%ecx,1),%xmm7
2421 movdqu (%esi),%xmm2
2422 movdqu 16(%esi),%xmm3
2423 movl 240(%edx),%ecx
2424 movdqa %xmm1,%xmm5
2425 pxor %xmm0,%xmm6
2426 pxor %xmm6,%xmm7
2427 pxor %xmm6,%xmm2
2428 pxor %xmm7,%xmm3
2429 movl 120(%esp),%edi
2430 call __aesni_decrypt2
2431 xorps %xmm6,%xmm2
2432 xorps %xmm7,%xmm3
2433 movdqa %xmm7,%xmm0
2434 xorps %xmm2,%xmm5
2435 movups %xmm2,(%edi,%esi,1)
2436 xorps %xmm3,%xmm5
2437 movups %xmm3,16(%edi,%esi,1)
2438 movaps %xmm5,%xmm1
2439 jmp L088done
2440.align 4,0x90
2441L091three:
2442 leal 1(%ebp),%ecx
2443 movl 112(%esp),%edx
2444 bsfl %ecx,%ecx
2445 shll $4,%ecx
2446 movdqu (%ebx),%xmm5
2447 movdqu (%ebx,%ecx,1),%xmm6
2448 movdqa %xmm5,%xmm7
2449 movdqu (%esi),%xmm2
2450 movdqu 16(%esi),%xmm3
2451 movdqu 32(%esi),%xmm4
2452 movl 240(%edx),%ecx
2453 movdqa %xmm1,96(%esp)
2454 pxor %xmm0,%xmm5
2455 pxor %xmm5,%xmm6
2456 pxor %xmm6,%xmm7
2457 pxor %xmm5,%xmm2
2458 pxor %xmm6,%xmm3
2459 pxor %xmm7,%xmm4
2460 movl 120(%esp),%edi
2461 call __aesni_decrypt3
2462 movdqa 96(%esp),%xmm1
2463 xorps %xmm5,%xmm2
2464 xorps %xmm6,%xmm3
2465 xorps %xmm7,%xmm4
2466 movups %xmm2,(%edi,%esi,1)
2467 pxor %xmm2,%xmm1
2468 movdqa %xmm7,%xmm0
2469 movups %xmm3,16(%edi,%esi,1)
2470 pxor %xmm3,%xmm1
2471 movups %xmm4,32(%edi,%esi,1)
2472 pxor %xmm4,%xmm1
2473 jmp L088done
2474.align 4,0x90
2475L092four:
2476 leal 1(%ebp),%ecx
2477 leal 3(%ebp),%eax
2478 bsfl %ecx,%ecx
2479 bsfl %eax,%eax
2480 movl 112(%esp),%edx
2481 shll $4,%ecx
2482 shll $4,%eax
2483 movdqu (%ebx),%xmm4
2484 movdqu (%ebx,%ecx,1),%xmm5
2485 movdqa %xmm4,%xmm6
2486 movdqu (%ebx,%eax,1),%xmm7
2487 pxor %xmm0,%xmm4
2488 movdqu (%esi),%xmm2
2489 pxor %xmm4,%xmm5
2490 movdqu 16(%esi),%xmm3
2491 pxor %xmm5,%xmm6
2492 movdqa %xmm4,(%esp)
2493 pxor %xmm6,%xmm7
2494 movdqa %xmm5,16(%esp)
2495 movdqu 32(%esi),%xmm4
2496 movdqu 48(%esi),%xmm5
2497 movl 240(%edx),%ecx
2498 movdqa %xmm1,96(%esp)
2499 pxor (%esp),%xmm2
2500 pxor 16(%esp),%xmm3
2501 pxor %xmm6,%xmm4
2502 pxor %xmm7,%xmm5
2503 movl 120(%esp),%edi
2504 call __aesni_decrypt4
2505 movdqa 96(%esp),%xmm1
2506 xorps (%esp),%xmm2
2507 xorps 16(%esp),%xmm3
2508 xorps %xmm6,%xmm4
2509 movups %xmm2,(%edi,%esi,1)
2510 pxor %xmm2,%xmm1
2511 xorps %xmm7,%xmm5
2512 movups %xmm3,16(%edi,%esi,1)
2513 pxor %xmm3,%xmm1
2514 movdqa %xmm7,%xmm0
2515 movups %xmm4,32(%edi,%esi,1)
2516 pxor %xmm4,%xmm1
2517 movups %xmm5,48(%edi,%esi,1)
2518 pxor %xmm5,%xmm1
2519L088done:
2520 movl 128(%esp),%edx
2521 pxor %xmm2,%xmm2
2522 pxor %xmm3,%xmm3
2523 movdqa %xmm2,(%esp)
2524 pxor %xmm4,%xmm4
2525 movdqa %xmm2,16(%esp)
2526 pxor %xmm5,%xmm5
2527 movdqa %xmm2,32(%esp)
2528 pxor %xmm6,%xmm6
2529 movdqa %xmm2,48(%esp)
2530 pxor %xmm7,%xmm7
2531 movdqa %xmm2,64(%esp)
2532 movdqa %xmm2,80(%esp)
2533 movdqa %xmm2,96(%esp)
2534 leal (%edx),%esp
2535 movl 40(%esp),%ecx
2536 movl 48(%esp),%ebx
2537 movdqu %xmm0,(%ecx)
2538 pxor %xmm0,%xmm0
2539 movdqu %xmm1,(%ebx)
2540 pxor %xmm1,%xmm1
2541 popl %edi
2542 popl %esi
2543 popl %ebx
2544 popl %ebp
2545 ret
2546.globl _aesni_cbc_encrypt
2547.align 4
2548_aesni_cbc_encrypt:
2549L_aesni_cbc_encrypt_begin:
2550 pushl %ebp
2551 pushl %ebx
2552 pushl %esi
2553 pushl %edi
2554 movl 20(%esp),%esi
2555 movl %esp,%ebx
2556 movl 24(%esp),%edi
2557 subl $24,%ebx
2558 movl 28(%esp),%eax
2559 andl $-16,%ebx
2560 movl 32(%esp),%edx
2561 movl 36(%esp),%ebp
2562 testl %eax,%eax
2563 jz L094cbc_abort
2564 cmpl $0,40(%esp)
2565 xchgl %esp,%ebx
2566 movups (%ebp),%xmm7
2567 movl 240(%edx),%ecx
2568 movl %edx,%ebp
2569 movl %ebx,16(%esp)
2570 movl %ecx,%ebx
2571 je L095cbc_decrypt
2572 movaps %xmm7,%xmm2
2573 cmpl $16,%eax
2574 jb L096cbc_enc_tail
2575 subl $16,%eax
2576 jmp L097cbc_enc_loop
2577.align 4,0x90
2578L097cbc_enc_loop:
2579 movups (%esi),%xmm7
2580 leal 16(%esi),%esi
2581 movups (%edx),%xmm0
2582 movups 16(%edx),%xmm1
2583 xorps %xmm0,%xmm7
2584 leal 32(%edx),%edx
2585 xorps %xmm7,%xmm2
2586L098enc1_loop_19:
2587.byte 102,15,56,220,209
2588 decl %ecx
2589 movups (%edx),%xmm1
2590 leal 16(%edx),%edx
2591 jnz L098enc1_loop_19
2592.byte 102,15,56,221,209
2593 movl %ebx,%ecx
2594 movl %ebp,%edx
2595 movups %xmm2,(%edi)
2596 leal 16(%edi),%edi
2597 subl $16,%eax
2598 jnc L097cbc_enc_loop
2599 addl $16,%eax
2600 jnz L096cbc_enc_tail
2601 movaps %xmm2,%xmm7
2602 pxor %xmm2,%xmm2
2603 jmp L099cbc_ret
2604L096cbc_enc_tail:
2605 movl %eax,%ecx
2606.long 2767451785
2607 movl $16,%ecx
2608 subl %eax,%ecx
2609 xorl %eax,%eax
2610.long 2868115081
2611 leal -16(%edi),%edi
2612 movl %ebx,%ecx
2613 movl %edi,%esi
2614 movl %ebp,%edx
2615 jmp L097cbc_enc_loop
2616.align 4,0x90
2617L095cbc_decrypt:
2618 cmpl $80,%eax
2619 jbe L100cbc_dec_tail
2620 movaps %xmm7,(%esp)
2621 subl $80,%eax
2622 jmp L101cbc_dec_loop6_enter
2623.align 4,0x90
2624L102cbc_dec_loop6:
2625 movaps %xmm0,(%esp)
2626 movups %xmm7,(%edi)
2627 leal 16(%edi),%edi
2628L101cbc_dec_loop6_enter:
2629 movdqu (%esi),%xmm2
2630 movdqu 16(%esi),%xmm3
2631 movdqu 32(%esi),%xmm4
2632 movdqu 48(%esi),%xmm5
2633 movdqu 64(%esi),%xmm6
2634 movdqu 80(%esi),%xmm7
2635 call __aesni_decrypt6
2636 movups (%esi),%xmm1
2637 movups 16(%esi),%xmm0
2638 xorps (%esp),%xmm2
2639 xorps %xmm1,%xmm3
2640 movups 32(%esi),%xmm1
2641 xorps %xmm0,%xmm4
2642 movups 48(%esi),%xmm0
2643 xorps %xmm1,%xmm5
2644 movups 64(%esi),%xmm1
2645 xorps %xmm0,%xmm6
2646 movups 80(%esi),%xmm0
2647 xorps %xmm1,%xmm7
2648 movups %xmm2,(%edi)
2649 movups %xmm3,16(%edi)
2650 leal 96(%esi),%esi
2651 movups %xmm4,32(%edi)
2652 movl %ebx,%ecx
2653 movups %xmm5,48(%edi)
2654 movl %ebp,%edx
2655 movups %xmm6,64(%edi)
2656 leal 80(%edi),%edi
2657 subl $96,%eax
2658 ja L102cbc_dec_loop6
2659 movaps %xmm7,%xmm2
2660 movaps %xmm0,%xmm7
2661 addl $80,%eax
2662 jle L103cbc_dec_clear_tail_collected
2663 movups %xmm2,(%edi)
2664 leal 16(%edi),%edi
2665L100cbc_dec_tail:
2666 movups (%esi),%xmm2
2667 movaps %xmm2,%xmm6
2668 cmpl $16,%eax
2669 jbe L104cbc_dec_one
2670 movups 16(%esi),%xmm3
2671 movaps %xmm3,%xmm5
2672 cmpl $32,%eax
2673 jbe L105cbc_dec_two
2674 movups 32(%esi),%xmm4
2675 cmpl $48,%eax
2676 jbe L106cbc_dec_three
2677 movups 48(%esi),%xmm5
2678 cmpl $64,%eax
2679 jbe L107cbc_dec_four
2680 movups 64(%esi),%xmm6
2681 movaps %xmm7,(%esp)
2682 movups (%esi),%xmm2
2683 xorps %xmm7,%xmm7
2684 call __aesni_decrypt6
2685 movups (%esi),%xmm1
2686 movups 16(%esi),%xmm0
2687 xorps (%esp),%xmm2
2688 xorps %xmm1,%xmm3
2689 movups 32(%esi),%xmm1
2690 xorps %xmm0,%xmm4
2691 movups 48(%esi),%xmm0
2692 xorps %xmm1,%xmm5
2693 movups 64(%esi),%xmm7
2694 xorps %xmm0,%xmm6
2695 movups %xmm2,(%edi)
2696 movups %xmm3,16(%edi)
2697 pxor %xmm3,%xmm3
2698 movups %xmm4,32(%edi)
2699 pxor %xmm4,%xmm4
2700 movups %xmm5,48(%edi)
2701 pxor %xmm5,%xmm5
2702 leal 64(%edi),%edi
2703 movaps %xmm6,%xmm2
2704 pxor %xmm6,%xmm6
2705 subl $80,%eax
2706 jmp L108cbc_dec_tail_collected
2707.align 4,0x90
2708L104cbc_dec_one:
2709 movups (%edx),%xmm0
2710 movups 16(%edx),%xmm1
2711 leal 32(%edx),%edx
2712 xorps %xmm0,%xmm2
2713L109dec1_loop_20:
2714.byte 102,15,56,222,209
2715 decl %ecx
2716 movups (%edx),%xmm1
2717 leal 16(%edx),%edx
2718 jnz L109dec1_loop_20
2719.byte 102,15,56,223,209
2720 xorps %xmm7,%xmm2
2721 movaps %xmm6,%xmm7
2722 subl $16,%eax
2723 jmp L108cbc_dec_tail_collected
2724.align 4,0x90
2725L105cbc_dec_two:
2726 call __aesni_decrypt2
2727 xorps %xmm7,%xmm2
2728 xorps %xmm6,%xmm3
2729 movups %xmm2,(%edi)
2730 movaps %xmm3,%xmm2
2731 pxor %xmm3,%xmm3
2732 leal 16(%edi),%edi
2733 movaps %xmm5,%xmm7
2734 subl $32,%eax
2735 jmp L108cbc_dec_tail_collected
2736.align 4,0x90
2737L106cbc_dec_three:
2738 call __aesni_decrypt3
2739 xorps %xmm7,%xmm2
2740 xorps %xmm6,%xmm3
2741 xorps %xmm5,%xmm4
2742 movups %xmm2,(%edi)
2743 movaps %xmm4,%xmm2
2744 pxor %xmm4,%xmm4
2745 movups %xmm3,16(%edi)
2746 pxor %xmm3,%xmm3
2747 leal 32(%edi),%edi
2748 movups 32(%esi),%xmm7
2749 subl $48,%eax
2750 jmp L108cbc_dec_tail_collected
2751.align 4,0x90
2752L107cbc_dec_four:
2753 call __aesni_decrypt4
2754 movups 16(%esi),%xmm1
2755 movups 32(%esi),%xmm0
2756 xorps %xmm7,%xmm2
2757 movups 48(%esi),%xmm7
2758 xorps %xmm6,%xmm3
2759 movups %xmm2,(%edi)
2760 xorps %xmm1,%xmm4
2761 movups %xmm3,16(%edi)
2762 pxor %xmm3,%xmm3
2763 xorps %xmm0,%xmm5
2764 movups %xmm4,32(%edi)
2765 pxor %xmm4,%xmm4
2766 leal 48(%edi),%edi
2767 movaps %xmm5,%xmm2
2768 pxor %xmm5,%xmm5
2769 subl $64,%eax
2770 jmp L108cbc_dec_tail_collected
2771.align 4,0x90
2772L103cbc_dec_clear_tail_collected:
2773 pxor %xmm3,%xmm3
2774 pxor %xmm4,%xmm4
2775 pxor %xmm5,%xmm5
2776 pxor %xmm6,%xmm6
2777L108cbc_dec_tail_collected:
2778 andl $15,%eax
2779 jnz L110cbc_dec_tail_partial
2780 movups %xmm2,(%edi)
2781 pxor %xmm0,%xmm0
2782 jmp L099cbc_ret
2783.align 4,0x90
2784L110cbc_dec_tail_partial:
2785 movaps %xmm2,(%esp)
2786 pxor %xmm0,%xmm0
2787 movl $16,%ecx
2788 movl %esp,%esi
2789 subl %eax,%ecx
2790.long 2767451785
2791 movdqa %xmm2,(%esp)
2792L099cbc_ret:
2793 movl 16(%esp),%esp
2794 movl 36(%esp),%ebp
2795 pxor %xmm2,%xmm2
2796 pxor %xmm1,%xmm1
2797 movups %xmm7,(%ebp)
2798 pxor %xmm7,%xmm7
2799L094cbc_abort:
2800 popl %edi
2801 popl %esi
2802 popl %ebx
2803 popl %ebp
2804 ret
2805.align 4
2806__aesni_set_encrypt_key:
2807 pushl %ebp
2808 pushl %ebx
2809 testl %eax,%eax
2810 jz L111bad_pointer
2811 testl %edx,%edx
2812 jz L111bad_pointer
2813 call L112pic
2814L112pic:
2815 popl %ebx
2816 leal Lkey_const-L112pic(%ebx),%ebx
2817 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-Lkey_const(%ebx),%ebp
2818 movups (%eax),%xmm0
2819 xorps %xmm4,%xmm4
2820 movl 4(%ebp),%ebp
2821 leal 16(%edx),%edx
2822 andl $268437504,%ebp
2823 cmpl $256,%ecx
2824 je L11314rounds
2825 cmpl $192,%ecx
2826 je L11412rounds
2827 cmpl $128,%ecx
2828 jne L115bad_keybits
2829.align 4,0x90
2830L11610rounds:
2831 cmpl $268435456,%ebp
2832 je L11710rounds_alt
2833 movl $9,%ecx
2834 movups %xmm0,-16(%edx)
2835.byte 102,15,58,223,200,1
2836 call L118key_128_cold
2837.byte 102,15,58,223,200,2
2838 call L119key_128
2839.byte 102,15,58,223,200,4
2840 call L119key_128
2841.byte 102,15,58,223,200,8
2842 call L119key_128
2843.byte 102,15,58,223,200,16
2844 call L119key_128
2845.byte 102,15,58,223,200,32
2846 call L119key_128
2847.byte 102,15,58,223,200,64
2848 call L119key_128
2849.byte 102,15,58,223,200,128
2850 call L119key_128
2851.byte 102,15,58,223,200,27
2852 call L119key_128
2853.byte 102,15,58,223,200,54
2854 call L119key_128
2855 movups %xmm0,(%edx)
2856 movl %ecx,80(%edx)
2857 jmp L120good_key
2858.align 4,0x90
2859L119key_128:
2860 movups %xmm0,(%edx)
2861 leal 16(%edx),%edx
2862L118key_128_cold:
2863 shufps $16,%xmm0,%xmm4
2864 xorps %xmm4,%xmm0
2865 shufps $140,%xmm0,%xmm4
2866 xorps %xmm4,%xmm0
2867 shufps $255,%xmm1,%xmm1
2868 xorps %xmm1,%xmm0
2869 ret
2870.align 4,0x90
2871L11710rounds_alt:
2872 movdqa (%ebx),%xmm5
2873 movl $8,%ecx
2874 movdqa 32(%ebx),%xmm4
2875 movdqa %xmm0,%xmm2
2876 movdqu %xmm0,-16(%edx)
2877L121loop_key128:
2878.byte 102,15,56,0,197
2879.byte 102,15,56,221,196
2880 pslld $1,%xmm4
2881 leal 16(%edx),%edx
2882 movdqa %xmm2,%xmm3
2883 pslldq $4,%xmm2
2884 pxor %xmm2,%xmm3
2885 pslldq $4,%xmm2
2886 pxor %xmm2,%xmm3
2887 pslldq $4,%xmm2
2888 pxor %xmm3,%xmm2
2889 pxor %xmm2,%xmm0
2890 movdqu %xmm0,-16(%edx)
2891 movdqa %xmm0,%xmm2
2892 decl %ecx
2893 jnz L121loop_key128
2894 movdqa 48(%ebx),%xmm4
2895.byte 102,15,56,0,197
2896.byte 102,15,56,221,196
2897 pslld $1,%xmm4
2898 movdqa %xmm2,%xmm3
2899 pslldq $4,%xmm2
2900 pxor %xmm2,%xmm3
2901 pslldq $4,%xmm2
2902 pxor %xmm2,%xmm3
2903 pslldq $4,%xmm2
2904 pxor %xmm3,%xmm2
2905 pxor %xmm2,%xmm0
2906 movdqu %xmm0,(%edx)
2907 movdqa %xmm0,%xmm2
2908.byte 102,15,56,0,197
2909.byte 102,15,56,221,196
2910 movdqa %xmm2,%xmm3
2911 pslldq $4,%xmm2
2912 pxor %xmm2,%xmm3
2913 pslldq $4,%xmm2
2914 pxor %xmm2,%xmm3
2915 pslldq $4,%xmm2
2916 pxor %xmm3,%xmm2
2917 pxor %xmm2,%xmm0
2918 movdqu %xmm0,16(%edx)
2919 movl $9,%ecx
2920 movl %ecx,96(%edx)
2921 jmp L120good_key
2922.align 4,0x90
2923L11412rounds:
2924 movq 16(%eax),%xmm2
2925 cmpl $268435456,%ebp
2926 je L12212rounds_alt
2927 movl $11,%ecx
2928 movups %xmm0,-16(%edx)
2929.byte 102,15,58,223,202,1
2930 call L123key_192a_cold
2931.byte 102,15,58,223,202,2
2932 call L124key_192b
2933.byte 102,15,58,223,202,4
2934 call L125key_192a
2935.byte 102,15,58,223,202,8
2936 call L124key_192b
2937.byte 102,15,58,223,202,16
2938 call L125key_192a
2939.byte 102,15,58,223,202,32
2940 call L124key_192b
2941.byte 102,15,58,223,202,64
2942 call L125key_192a
2943.byte 102,15,58,223,202,128
2944 call L124key_192b
2945 movups %xmm0,(%edx)
2946 movl %ecx,48(%edx)
2947 jmp L120good_key
2948.align 4,0x90
2949L125key_192a:
2950 movups %xmm0,(%edx)
2951 leal 16(%edx),%edx
2952.align 4,0x90
2953L123key_192a_cold:
2954 movaps %xmm2,%xmm5
2955L126key_192b_warm:
2956 shufps $16,%xmm0,%xmm4
2957 movdqa %xmm2,%xmm3
2958 xorps %xmm4,%xmm0
2959 shufps $140,%xmm0,%xmm4
2960 pslldq $4,%xmm3
2961 xorps %xmm4,%xmm0
2962 pshufd $85,%xmm1,%xmm1
2963 pxor %xmm3,%xmm2
2964 pxor %xmm1,%xmm0
2965 pshufd $255,%xmm0,%xmm3
2966 pxor %xmm3,%xmm2
2967 ret
2968.align 4,0x90
2969L124key_192b:
2970 movaps %xmm0,%xmm3
2971 shufps $68,%xmm0,%xmm5
2972 movups %xmm5,(%edx)
2973 shufps $78,%xmm2,%xmm3
2974 movups %xmm3,16(%edx)
2975 leal 32(%edx),%edx
2976 jmp L126key_192b_warm
2977.align 4,0x90
2978L12212rounds_alt:
2979 movdqa 16(%ebx),%xmm5
2980 movdqa 32(%ebx),%xmm4
2981 movl $8,%ecx
2982 movdqu %xmm0,-16(%edx)
2983L127loop_key192:
2984 movq %xmm2,(%edx)
2985 movdqa %xmm2,%xmm1
2986.byte 102,15,56,0,213
2987.byte 102,15,56,221,212
2988 pslld $1,%xmm4
2989 leal 24(%edx),%edx
2990 movdqa %xmm0,%xmm3
2991 pslldq $4,%xmm0
2992 pxor %xmm0,%xmm3
2993 pslldq $4,%xmm0
2994 pxor %xmm0,%xmm3
2995 pslldq $4,%xmm0
2996 pxor %xmm3,%xmm0
2997 pshufd $255,%xmm0,%xmm3
2998 pxor %xmm1,%xmm3
2999 pslldq $4,%xmm1
3000 pxor %xmm1,%xmm3
3001 pxor %xmm2,%xmm0
3002 pxor %xmm3,%xmm2
3003 movdqu %xmm0,-16(%edx)
3004 decl %ecx
3005 jnz L127loop_key192
3006 movl $11,%ecx
3007 movl %ecx,32(%edx)
3008 jmp L120good_key
3009.align 4,0x90
3010L11314rounds:
3011 movups 16(%eax),%xmm2
3012 leal 16(%edx),%edx
3013 cmpl $268435456,%ebp
3014 je L12814rounds_alt
3015 movl $13,%ecx
3016 movups %xmm0,-32(%edx)
3017 movups %xmm2,-16(%edx)
3018.byte 102,15,58,223,202,1
3019 call L129key_256a_cold
3020.byte 102,15,58,223,200,1
3021 call L130key_256b
3022.byte 102,15,58,223,202,2
3023 call L131key_256a
3024.byte 102,15,58,223,200,2
3025 call L130key_256b
3026.byte 102,15,58,223,202,4
3027 call L131key_256a
3028.byte 102,15,58,223,200,4
3029 call L130key_256b
3030.byte 102,15,58,223,202,8
3031 call L131key_256a
3032.byte 102,15,58,223,200,8
3033 call L130key_256b
3034.byte 102,15,58,223,202,16
3035 call L131key_256a
3036.byte 102,15,58,223,200,16
3037 call L130key_256b
3038.byte 102,15,58,223,202,32
3039 call L131key_256a
3040.byte 102,15,58,223,200,32
3041 call L130key_256b
3042.byte 102,15,58,223,202,64
3043 call L131key_256a
3044 movups %xmm0,(%edx)
3045 movl %ecx,16(%edx)
3046 xorl %eax,%eax
3047 jmp L120good_key
3048.align 4,0x90
3049L131key_256a:
3050 movups %xmm2,(%edx)
3051 leal 16(%edx),%edx
3052L129key_256a_cold:
3053 shufps $16,%xmm0,%xmm4
3054 xorps %xmm4,%xmm0
3055 shufps $140,%xmm0,%xmm4
3056 xorps %xmm4,%xmm0
3057 shufps $255,%xmm1,%xmm1
3058 xorps %xmm1,%xmm0
3059 ret
3060.align 4,0x90
3061L130key_256b:
3062 movups %xmm0,(%edx)
3063 leal 16(%edx),%edx
3064 shufps $16,%xmm2,%xmm4
3065 xorps %xmm4,%xmm2
3066 shufps $140,%xmm2,%xmm4
3067 xorps %xmm4,%xmm2
3068 shufps $170,%xmm1,%xmm1
3069 xorps %xmm1,%xmm2
3070 ret
3071.align 4,0x90
3072L12814rounds_alt:
3073 movdqa (%ebx),%xmm5
3074 movdqa 32(%ebx),%xmm4
3075 movl $7,%ecx
3076 movdqu %xmm0,-32(%edx)
3077 movdqa %xmm2,%xmm1
3078 movdqu %xmm2,-16(%edx)
3079L132loop_key256:
3080.byte 102,15,56,0,213
3081.byte 102,15,56,221,212
3082 movdqa %xmm0,%xmm3
3083 pslldq $4,%xmm0
3084 pxor %xmm0,%xmm3
3085 pslldq $4,%xmm0
3086 pxor %xmm0,%xmm3
3087 pslldq $4,%xmm0
3088 pxor %xmm3,%xmm0
3089 pslld $1,%xmm4
3090 pxor %xmm2,%xmm0
3091 movdqu %xmm0,(%edx)
3092 decl %ecx
3093 jz L133done_key256
3094 pshufd $255,%xmm0,%xmm2
3095 pxor %xmm3,%xmm3
3096.byte 102,15,56,221,211
3097 movdqa %xmm1,%xmm3
3098 pslldq $4,%xmm1
3099 pxor %xmm1,%xmm3
3100 pslldq $4,%xmm1
3101 pxor %xmm1,%xmm3
3102 pslldq $4,%xmm1
3103 pxor %xmm3,%xmm1
3104 pxor %xmm1,%xmm2
3105 movdqu %xmm2,16(%edx)
3106 leal 32(%edx),%edx
3107 movdqa %xmm2,%xmm1
3108 jmp L132loop_key256
3109L133done_key256:
3110 movl $13,%ecx
3111 movl %ecx,16(%edx)
3112L120good_key:
3113 pxor %xmm0,%xmm0
3114 pxor %xmm1,%xmm1
3115 pxor %xmm2,%xmm2
3116 pxor %xmm3,%xmm3
3117 pxor %xmm4,%xmm4
3118 pxor %xmm5,%xmm5
3119 xorl %eax,%eax
3120 popl %ebx
3121 popl %ebp
3122 ret
3123.align 2,0x90
3124L111bad_pointer:
3125 movl $-1,%eax
3126 popl %ebx
3127 popl %ebp
3128 ret
3129.align 2,0x90
3130L115bad_keybits:
3131 pxor %xmm0,%xmm0
3132 movl $-2,%eax
3133 popl %ebx
3134 popl %ebp
3135 ret
3136.globl _aesni_set_encrypt_key
3137.align 4
3138_aesni_set_encrypt_key:
3139L_aesni_set_encrypt_key_begin:
3140 movl 4(%esp),%eax
3141 movl 8(%esp),%ecx
3142 movl 12(%esp),%edx
3143 call __aesni_set_encrypt_key
3144 ret
3145.globl _aesni_set_decrypt_key
3146.align 4
3147_aesni_set_decrypt_key:
3148L_aesni_set_decrypt_key_begin:
3149 movl 4(%esp),%eax
3150 movl 8(%esp),%ecx
3151 movl 12(%esp),%edx
3152 call __aesni_set_encrypt_key
3153 movl 12(%esp),%edx
3154 shll $4,%ecx
3155 testl %eax,%eax
3156 jnz L134dec_key_ret
3157 leal 16(%edx,%ecx,1),%eax
3158 movups (%edx),%xmm0
3159 movups (%eax),%xmm1
3160 movups %xmm0,(%eax)
3161 movups %xmm1,(%edx)
3162 leal 16(%edx),%edx
3163 leal -16(%eax),%eax
3164L135dec_key_inverse:
3165 movups (%edx),%xmm0
3166 movups (%eax),%xmm1
3167.byte 102,15,56,219,192
3168.byte 102,15,56,219,201
3169 leal 16(%edx),%edx
3170 leal -16(%eax),%eax
3171 movups %xmm0,16(%eax)
3172 movups %xmm1,-16(%edx)
3173 cmpl %edx,%eax
3174 ja L135dec_key_inverse
3175 movups (%edx),%xmm0
3176.byte 102,15,56,219,192
3177 movups %xmm0,(%edx)
3178 pxor %xmm0,%xmm0
3179 pxor %xmm1,%xmm1
3180 xorl %eax,%eax
3181L134dec_key_ret:
3182 ret
3183.align 6,0x90
3184Lkey_const:
3185.long 202313229,202313229,202313229,202313229
3186.long 67569157,67569157,67569157,67569157
3187.long 1,1,1,1
3188.long 27,27,27,27
3189.byte 65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69
3190.byte 83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83
3191.byte 32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
3192.byte 115,108,46,111,114,103,62,0
3193.section __IMPORT,__pointers,non_lazy_symbol_pointers
3194L_OPENSSL_ia32cap_P$non_lazy_ptr:
3195.indirect_symbol _OPENSSL_ia32cap_P
3196.long 0
3197.comm _OPENSSL_ia32cap_P,16,2
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette