1 #include <machine/asm.h>
4 .type aesni_encrypt,@function
14 .byte 102,15,56,220,209
19 .byte 102,15,56,221,209
22 .size aesni_encrypt,.-aesni_encrypt
25 .type aesni_decrypt,@function
35 .byte 102,15,56,222,209
40 .byte 102,15,56,223,209
43 .size aesni_decrypt, .-aesni_decrypt
44 .type _aesni_encrypt3,@function
57 .byte 102,15,56,220,209
58 .byte 102,15,56,220,217
60 .byte 102,15,56,220,225
62 .byte 102,15,56,220,208
63 .byte 102,15,56,220,216
65 .byte 102,15,56,220,224
69 .byte 102,15,56,220,209
70 .byte 102,15,56,220,217
71 .byte 102,15,56,220,225
72 .byte 102,15,56,221,208
73 .byte 102,15,56,221,216
74 .byte 102,15,56,221,224
76 .size _aesni_encrypt3,.-_aesni_encrypt3
77 .type _aesni_decrypt3,@function
90 .byte 102,15,56,222,209
91 .byte 102,15,56,222,217
93 .byte 102,15,56,222,225
95 .byte 102,15,56,222,208
96 .byte 102,15,56,222,216
98 .byte 102,15,56,222,224
102 .byte 102,15,56,222,209
103 .byte 102,15,56,222,217
104 .byte 102,15,56,222,225
105 .byte 102,15,56,223,208
106 .byte 102,15,56,223,216
107 .byte 102,15,56,223,224
109 .size _aesni_decrypt3,.-_aesni_decrypt3
110 .type _aesni_encrypt4,@function
115 movups 16(%rcx),%xmm1
124 .byte 102,15,56,220,209
125 .byte 102,15,56,220,217
127 .byte 102,15,56,220,225
128 .byte 102,15,56,220,233
129 movups 16(%rcx),%xmm1
130 .byte 102,15,56,220,208
131 .byte 102,15,56,220,216
133 .byte 102,15,56,220,224
134 .byte 102,15,56,220,232
138 .byte 102,15,56,220,209
139 .byte 102,15,56,220,217
140 .byte 102,15,56,220,225
141 .byte 102,15,56,220,233
142 .byte 102,15,56,221,208
143 .byte 102,15,56,221,216
144 .byte 102,15,56,221,224
145 .byte 102,15,56,221,232
147 .size _aesni_encrypt4,.-_aesni_encrypt4
148 .type _aesni_decrypt4,@function
153 movups 16(%rcx),%xmm1
162 .byte 102,15,56,222,209
163 .byte 102,15,56,222,217
165 .byte 102,15,56,222,225
166 .byte 102,15,56,222,233
167 movups 16(%rcx),%xmm1
168 .byte 102,15,56,222,208
169 .byte 102,15,56,222,216
171 .byte 102,15,56,222,224
172 .byte 102,15,56,222,232
176 .byte 102,15,56,222,209
177 .byte 102,15,56,222,217
178 .byte 102,15,56,222,225
179 .byte 102,15,56,222,233
180 .byte 102,15,56,223,208
181 .byte 102,15,56,223,216
182 .byte 102,15,56,223,224
183 .byte 102,15,56,223,232
185 .size _aesni_decrypt4,.-_aesni_decrypt4
186 .type _aesni_encrypt6,@function
191 movups 16(%rcx),%xmm1
195 .byte 102,15,56,220,209
197 .byte 102,15,56,220,217
199 .byte 102,15,56,220,225
201 .byte 102,15,56,220,233
204 .byte 102,15,56,220,241
206 .byte 102,15,56,220,249
207 jmp .Lenc_loop6_enter
210 .byte 102,15,56,220,209
211 .byte 102,15,56,220,217
213 .byte 102,15,56,220,225
214 .byte 102,15,56,220,233
215 .byte 102,15,56,220,241
216 .byte 102,15,56,220,249
218 movups 16(%rcx),%xmm1
219 .byte 102,15,56,220,208
220 .byte 102,15,56,220,216
222 .byte 102,15,56,220,224
223 .byte 102,15,56,220,232
224 .byte 102,15,56,220,240
225 .byte 102,15,56,220,248
229 .byte 102,15,56,220,209
230 .byte 102,15,56,220,217
231 .byte 102,15,56,220,225
232 .byte 102,15,56,220,233
233 .byte 102,15,56,220,241
234 .byte 102,15,56,220,249
235 .byte 102,15,56,221,208
236 .byte 102,15,56,221,216
237 .byte 102,15,56,221,224
238 .byte 102,15,56,221,232
239 .byte 102,15,56,221,240
240 .byte 102,15,56,221,248
242 .size _aesni_encrypt6,.-_aesni_encrypt6
243 .type _aesni_decrypt6,@function
248 movups 16(%rcx),%xmm1
252 .byte 102,15,56,222,209
254 .byte 102,15,56,222,217
256 .byte 102,15,56,222,225
258 .byte 102,15,56,222,233
261 .byte 102,15,56,222,241
263 .byte 102,15,56,222,249
264 jmp .Ldec_loop6_enter
267 .byte 102,15,56,222,209
268 .byte 102,15,56,222,217
270 .byte 102,15,56,222,225
271 .byte 102,15,56,222,233
272 .byte 102,15,56,222,241
273 .byte 102,15,56,222,249
275 movups 16(%rcx),%xmm1
276 .byte 102,15,56,222,208
277 .byte 102,15,56,222,216
279 .byte 102,15,56,222,224
280 .byte 102,15,56,222,232
281 .byte 102,15,56,222,240
282 .byte 102,15,56,222,248
286 .byte 102,15,56,222,209
287 .byte 102,15,56,222,217
288 .byte 102,15,56,222,225
289 .byte 102,15,56,222,233
290 .byte 102,15,56,222,241
291 .byte 102,15,56,222,249
292 .byte 102,15,56,223,208
293 .byte 102,15,56,223,216
294 .byte 102,15,56,223,224
295 .byte 102,15,56,223,232
296 .byte 102,15,56,223,240
297 .byte 102,15,56,223,248
299 .size _aesni_decrypt6,.-_aesni_decrypt6
300 .type _aesni_encrypt8,@function
305 movups 16(%rcx),%xmm1
309 .byte 102,15,56,220,209
311 .byte 102,15,56,220,217
313 .byte 102,15,56,220,225
315 .byte 102,15,56,220,233
318 .byte 102,15,56,220,241
320 .byte 102,15,56,220,249
323 .byte 102,68,15,56,220,193
324 .byte 102,68,15,56,220,201
325 movups 16(%rcx),%xmm1
326 jmp .Lenc_loop8_enter
329 .byte 102,15,56,220,209
330 .byte 102,15,56,220,217
332 .byte 102,15,56,220,225
333 .byte 102,15,56,220,233
334 .byte 102,15,56,220,241
335 .byte 102,15,56,220,249
336 .byte 102,68,15,56,220,193
337 .byte 102,68,15,56,220,201
338 movups 16(%rcx),%xmm1
340 .byte 102,15,56,220,208
341 .byte 102,15,56,220,216
343 .byte 102,15,56,220,224
344 .byte 102,15,56,220,232
345 .byte 102,15,56,220,240
346 .byte 102,15,56,220,248
347 .byte 102,68,15,56,220,192
348 .byte 102,68,15,56,220,200
352 .byte 102,15,56,220,209
353 .byte 102,15,56,220,217
354 .byte 102,15,56,220,225
355 .byte 102,15,56,220,233
356 .byte 102,15,56,220,241
357 .byte 102,15,56,220,249
358 .byte 102,68,15,56,220,193
359 .byte 102,68,15,56,220,201
360 .byte 102,15,56,221,208
361 .byte 102,15,56,221,216
362 .byte 102,15,56,221,224
363 .byte 102,15,56,221,232
364 .byte 102,15,56,221,240
365 .byte 102,15,56,221,248
366 .byte 102,68,15,56,221,192
367 .byte 102,68,15,56,221,200
369 .size _aesni_encrypt8,.-_aesni_encrypt8
370 .type _aesni_decrypt8,@function
375 movups 16(%rcx),%xmm1
379 .byte 102,15,56,222,209
381 .byte 102,15,56,222,217
383 .byte 102,15,56,222,225
385 .byte 102,15,56,222,233
388 .byte 102,15,56,222,241
390 .byte 102,15,56,222,249
393 .byte 102,68,15,56,222,193
394 .byte 102,68,15,56,222,201
395 movups 16(%rcx),%xmm1
396 jmp .Ldec_loop8_enter
399 .byte 102,15,56,222,209
400 .byte 102,15,56,222,217
402 .byte 102,15,56,222,225
403 .byte 102,15,56,222,233
404 .byte 102,15,56,222,241
405 .byte 102,15,56,222,249
406 .byte 102,68,15,56,222,193
407 .byte 102,68,15,56,222,201
408 movups 16(%rcx),%xmm1
410 .byte 102,15,56,222,208
411 .byte 102,15,56,222,216
413 .byte 102,15,56,222,224
414 .byte 102,15,56,222,232
415 .byte 102,15,56,222,240
416 .byte 102,15,56,222,248
417 .byte 102,68,15,56,222,192
418 .byte 102,68,15,56,222,200
422 .byte 102,15,56,222,209
423 .byte 102,15,56,222,217
424 .byte 102,15,56,222,225
425 .byte 102,15,56,222,233
426 .byte 102,15,56,222,241
427 .byte 102,15,56,222,249
428 .byte 102,68,15,56,222,193
429 .byte 102,68,15,56,222,201
430 .byte 102,15,56,223,208
431 .byte 102,15,56,223,216
432 .byte 102,15,56,223,224
433 .byte 102,15,56,223,232
434 .byte 102,15,56,223,240
435 .byte 102,15,56,223,248
436 .byte 102,68,15,56,223,192
437 .byte 102,68,15,56,223,200
439 .size _aesni_decrypt8,.-_aesni_decrypt8
440 .globl aesni_ecb_encrypt
441 .type aesni_ecb_encrypt,@function
458 movdqu 16(%rdi),%xmm3
459 movdqu 32(%rdi),%xmm4
460 movdqu 48(%rdi),%xmm5
461 movdqu 64(%rdi),%xmm6
462 movdqu 80(%rdi),%xmm7
463 movdqu 96(%rdi),%xmm8
464 movdqu 112(%rdi),%xmm9
467 jmp .Lecb_enc_loop8_enter
474 movups %xmm3,16(%rsi)
475 movdqu 16(%rdi),%xmm3
476 movups %xmm4,32(%rsi)
477 movdqu 32(%rdi),%xmm4
478 movups %xmm5,48(%rsi)
479 movdqu 48(%rdi),%xmm5
480 movups %xmm6,64(%rsi)
481 movdqu 64(%rdi),%xmm6
482 movups %xmm7,80(%rsi)
483 movdqu 80(%rdi),%xmm7
484 movups %xmm8,96(%rsi)
485 movdqu 96(%rdi),%xmm8
486 movups %xmm9,112(%rsi)
488 movdqu 112(%rdi),%xmm9
490 .Lecb_enc_loop8_enter:
499 movups %xmm3,16(%rsi)
501 movups %xmm4,32(%rsi)
502 movups %xmm5,48(%rsi)
503 movups %xmm6,64(%rsi)
504 movups %xmm7,80(%rsi)
505 movups %xmm8,96(%rsi)
506 movups %xmm9,112(%rsi)
515 movups 16(%rdi),%xmm3
517 movups 32(%rdi),%xmm4
520 movups 48(%rdi),%xmm5
522 movups 64(%rdi),%xmm6
525 movups 80(%rdi),%xmm7
527 movdqu 96(%rdi),%xmm8
530 movups %xmm3,16(%rsi)
531 movups %xmm4,32(%rsi)
532 movups %xmm5,48(%rsi)
533 movups %xmm6,64(%rsi)
534 movups %xmm7,80(%rsi)
535 movups %xmm8,96(%rsi)
540 movups 16(%rcx),%xmm1
544 .byte 102,15,56,220,209
549 .byte 102,15,56,221,209
557 movups %xmm3,16(%rsi)
563 movups %xmm3,16(%rsi)
564 movups %xmm4,32(%rsi)
570 movups %xmm3,16(%rsi)
571 movups %xmm4,32(%rsi)
572 movups %xmm5,48(%rsi)
579 movups %xmm3,16(%rsi)
580 movups %xmm4,32(%rsi)
581 movups %xmm5,48(%rsi)
582 movups %xmm6,64(%rsi)
588 movups %xmm3,16(%rsi)
589 movups %xmm4,32(%rsi)
590 movups %xmm5,48(%rsi)
591 movups %xmm6,64(%rsi)
592 movups %xmm7,80(%rsi)
601 movdqu 16(%rdi),%xmm3
602 movdqu 32(%rdi),%xmm4
603 movdqu 48(%rdi),%xmm5
604 movdqu 64(%rdi),%xmm6
605 movdqu 80(%rdi),%xmm7
606 movdqu 96(%rdi),%xmm8
607 movdqu 112(%rdi),%xmm9
610 jmp .Lecb_dec_loop8_enter
617 movups %xmm3,16(%rsi)
618 movdqu 16(%rdi),%xmm3
619 movups %xmm4,32(%rsi)
620 movdqu 32(%rdi),%xmm4
621 movups %xmm5,48(%rsi)
622 movdqu 48(%rdi),%xmm5
623 movups %xmm6,64(%rsi)
624 movdqu 64(%rdi),%xmm6
625 movups %xmm7,80(%rsi)
626 movdqu 80(%rdi),%xmm7
627 movups %xmm8,96(%rsi)
628 movdqu 96(%rdi),%xmm8
629 movups %xmm9,112(%rsi)
631 movdqu 112(%rdi),%xmm9
633 .Lecb_dec_loop8_enter:
643 movups %xmm3,16(%rsi)
645 movups %xmm4,32(%rsi)
646 movups %xmm5,48(%rsi)
647 movups %xmm6,64(%rsi)
648 movups %xmm7,80(%rsi)
649 movups %xmm8,96(%rsi)
650 movups %xmm9,112(%rsi)
659 movups 16(%rdi),%xmm3
661 movups 32(%rdi),%xmm4
664 movups 48(%rdi),%xmm5
666 movups 64(%rdi),%xmm6
669 movups 80(%rdi),%xmm7
671 movups 96(%rdi),%xmm8
675 movups %xmm3,16(%rsi)
676 movups %xmm4,32(%rsi)
677 movups %xmm5,48(%rsi)
678 movups %xmm6,64(%rsi)
679 movups %xmm7,80(%rsi)
680 movups %xmm8,96(%rsi)
685 movups 16(%rcx),%xmm1
689 .byte 102,15,56,222,209
694 .byte 102,15,56,223,209
702 movups %xmm3,16(%rsi)
708 movups %xmm3,16(%rsi)
709 movups %xmm4,32(%rsi)
715 movups %xmm3,16(%rsi)
716 movups %xmm4,32(%rsi)
717 movups %xmm5,48(%rsi)
724 movups %xmm3,16(%rsi)
725 movups %xmm4,32(%rsi)
726 movups %xmm5,48(%rsi)
727 movups %xmm6,64(%rsi)
733 movups %xmm3,16(%rsi)
734 movups %xmm4,32(%rsi)
735 movups %xmm5,48(%rsi)
736 movups %xmm6,64(%rsi)
737 movups %xmm7,80(%rsi)
741 .size aesni_ecb_encrypt,.-aesni_ecb_encrypt
742 .globl aesni_ccm64_encrypt_blocks
743 .type aesni_ccm64_encrypt_blocks,@function
745 aesni_ccm64_encrypt_blocks:
748 movdqa .Lincrement64(%rip),%xmm6
749 movdqa .Lbswap_mask(%rip),%xmm7
756 .byte 102,68,15,56,0,207
757 jmp .Lccm64_enc_outer
765 movups 16(%r11),%xmm1
772 .byte 102,15,56,220,209
774 .byte 102,15,56,220,217
775 movups 16(%rcx),%xmm1
776 .byte 102,15,56,220,208
778 .byte 102,15,56,220,216
780 jnz .Lccm64_enc2_loop
781 .byte 102,15,56,220,209
782 .byte 102,15,56,220,217
784 .byte 102,15,56,221,208
785 .byte 102,15,56,221,216
793 .byte 102,15,56,0,215
794 jnz .Lccm64_enc_outer
798 .size aesni_ccm64_encrypt_blocks,.-aesni_ccm64_encrypt_blocks
799 .globl aesni_ccm64_decrypt_blocks
800 .type aesni_ccm64_decrypt_blocks,@function
802 aesni_ccm64_decrypt_blocks:
806 movdqa .Lincrement64(%rip),%xmm6
807 movdqa .Lbswap_mask(%rip),%xmm7
812 .byte 102,68,15,56,0,207
814 movups 16(%rcx),%xmm1
818 .byte 102,15,56,220,209
823 .byte 102,15,56,221,209
827 jmp .Lccm64_dec_outer
835 .byte 102,15,56,0,215
842 movups 16(%r11),%xmm1
850 .byte 102,15,56,220,209
852 .byte 102,15,56,220,217
853 movups 16(%rcx),%xmm1
854 .byte 102,15,56,220,208
856 .byte 102,15,56,220,216
858 jnz .Lccm64_dec2_loop
861 .byte 102,15,56,220,209
862 .byte 102,15,56,220,217
864 .byte 102,15,56,221,208
865 .byte 102,15,56,221,216
866 jmp .Lccm64_dec_outer
872 movups 16(%r11),%xmm1
877 .byte 102,15,56,220,217
882 .byte 102,15,56,221,217
885 .size aesni_ccm64_decrypt_blocks,.-aesni_ccm64_decrypt_blocks
886 .globl aesni_ctr32_encrypt_blocks
887 .type aesni_ctr32_encrypt_blocks,@function
889 aesni_ctr32_encrypt_blocks:
891 je .Lctr32_one_shortcut
894 movdqa .Lbswap_mask(%rip),%xmm15
896 .byte 102,69,15,58,22,242,3
897 .byte 102,68,15,58,34,240,3
903 .byte 102,69,15,58,34,226,0
905 .byte 102,69,15,58,34,235,0
907 .byte 102,69,15,58,34,226,1
909 .byte 102,69,15,58,34,235,1
911 .byte 102,69,15,58,34,226,2
913 .byte 102,69,15,58,34,235,2
914 movdqa %xmm12,-40(%rsp)
915 .byte 102,69,15,56,0,231
916 movdqa %xmm13,-24(%rsp)
917 .byte 102,69,15,56,0,239
919 pshufd $192,%xmm12,%xmm2
920 pshufd $128,%xmm12,%xmm3
921 pshufd $64,%xmm12,%xmm4
932 pshufd $192,%xmm13,%xmm5
935 pshufd $128,%xmm13,%xmm6
937 movups 16(%r11),%xmm1
938 pshufd $64,%xmm13,%xmm7
949 .byte 102,15,56,220,209
952 .byte 102,15,56,220,217
953 movdqa .Lincrement32(%rip),%xmm13
955 .byte 102,15,56,220,225
956 movdqa -40(%rsp),%xmm12
958 .byte 102,15,56,220,233
962 .byte 102,15,56,220,241
963 .byte 102,15,56,220,249
964 jmp .Lctr32_enc_loop6_enter
967 .byte 102,15,56,220,209
968 .byte 102,15,56,220,217
970 .byte 102,15,56,220,225
971 .byte 102,15,56,220,233
972 .byte 102,15,56,220,241
973 .byte 102,15,56,220,249
974 .Lctr32_enc_loop6_enter:
975 movups 16(%rcx),%xmm1
976 .byte 102,15,56,220,208
977 .byte 102,15,56,220,216
979 .byte 102,15,56,220,224
980 .byte 102,15,56,220,232
981 .byte 102,15,56,220,240
982 .byte 102,15,56,220,248
984 jnz .Lctr32_enc_loop6
986 .byte 102,15,56,220,209
988 .byte 102,15,56,220,217
989 paddd -24(%rsp),%xmm13
990 .byte 102,15,56,220,225
991 movdqa %xmm12,-40(%rsp)
992 .byte 102,15,56,220,233
993 movdqa %xmm13,-24(%rsp)
994 .byte 102,15,56,220,241
995 .byte 102,69,15,56,0,231
996 .byte 102,15,56,220,249
997 .byte 102,69,15,56,0,239
999 .byte 102,15,56,221,208
1001 .byte 102,15,56,221,216
1002 movups 16(%rdi),%xmm9
1003 .byte 102,15,56,221,224
1004 movups 32(%rdi),%xmm10
1005 .byte 102,15,56,221,232
1006 movups 48(%rdi),%xmm11
1007 .byte 102,15,56,221,240
1008 movups 64(%rdi),%xmm1
1009 .byte 102,15,56,221,248
1010 movups 80(%rdi),%xmm0
1014 pshufd $192,%xmm12,%xmm2
1016 pshufd $128,%xmm12,%xmm3
1019 pshufd $64,%xmm12,%xmm4
1020 movups %xmm9,16(%rsi)
1022 movups %xmm10,32(%rsi)
1024 movups %xmm11,48(%rsi)
1026 movups %xmm1,64(%rsi)
1027 movups %xmm0,80(%rsi)
1036 leal 1(%rax,%rax,1),%eax
1045 movups 16(%rdi),%xmm9
1048 pshufd $192,%xmm13,%xmm5
1050 movups 32(%rdi),%xmm10
1054 pshufd $128,%xmm13,%xmm6
1056 movups 48(%rdi),%xmm11
1062 call _aesni_encrypt6
1064 movups 64(%rdi),%xmm1
1069 movups %xmm9,16(%rsi)
1071 movups %xmm10,32(%rsi)
1073 movups %xmm11,48(%rsi)
1074 movups %xmm1,64(%rsi)
1078 .Lctr32_one_shortcut:
1084 movups 16(%rcx),%xmm1
1088 .byte 102,15,56,220,209
1093 .byte 102,15,56,221,209
1101 call _aesni_encrypt3
1105 movups %xmm9,16(%rsi)
1110 call _aesni_encrypt3
1115 movups %xmm9,16(%rsi)
1116 movups %xmm10,32(%rsi)
1121 call _aesni_encrypt4
1126 movups %xmm9,16(%rsi)
1128 movups %xmm10,32(%rsi)
1129 movups %xmm11,48(%rsi)
1133 .size aesni_ctr32_encrypt_blocks,.-aesni_ctr32_encrypt_blocks
1134 .globl aesni_xts_encrypt
1135 .type aesni_xts_encrypt,@function
1138 leaq -104(%rsp),%rsp
1141 movl 240(%rcx),%r10d
1143 movups 16(%r8),%xmm1
1147 .byte 102,68,15,56,220,249
1152 .byte 102,68,15,56,221,249
1158 movdqa .Lxts_magic(%rip),%xmm8
1160 pcmpgtd %xmm15,%xmm14
1161 pshufd $19,%xmm14,%xmm9
1163 movdqa %xmm15,%xmm10
1166 pcmpgtd %xmm15,%xmm14
1168 pshufd $19,%xmm14,%xmm9
1170 movdqa %xmm15,%xmm11
1173 pcmpgtd %xmm15,%xmm14
1175 pshufd $19,%xmm14,%xmm9
1177 movdqa %xmm15,%xmm12
1180 pcmpgtd %xmm15,%xmm14
1182 pshufd $19,%xmm14,%xmm9
1184 movdqa %xmm15,%xmm13
1187 pcmpgtd %xmm15,%xmm14
1195 jmp .Lxts_enc_grandloop
1198 .Lxts_enc_grandloop:
1199 pshufd $19,%xmm14,%xmm9
1200 movdqa %xmm15,%xmm14
1202 movdqu 0(%rdi),%xmm2
1204 movdqu 16(%rdi),%xmm3
1207 movdqu 32(%rdi),%xmm4
1209 movdqu 48(%rdi),%xmm5
1211 movdqu 64(%rdi),%xmm6
1213 movdqu 80(%rdi),%xmm7
1222 movups 16(%r11),%xmm1
1225 movdqa %xmm10,0(%rsp)
1226 .byte 102,15,56,220,209
1229 movdqa %xmm11,16(%rsp)
1230 .byte 102,15,56,220,217
1232 movdqa %xmm12,32(%rsp)
1233 .byte 102,15,56,220,225
1235 movdqa %xmm13,48(%rsp)
1236 .byte 102,15,56,220,233
1240 movdqa %xmm14,64(%rsp)
1241 .byte 102,15,56,220,241
1242 movdqa %xmm15,80(%rsp)
1243 .byte 102,15,56,220,249
1245 pcmpgtd %xmm15,%xmm14
1246 jmp .Lxts_enc_loop6_enter
1250 .byte 102,15,56,220,209
1251 .byte 102,15,56,220,217
1253 .byte 102,15,56,220,225
1254 .byte 102,15,56,220,233
1255 .byte 102,15,56,220,241
1256 .byte 102,15,56,220,249
1257 .Lxts_enc_loop6_enter:
1258 movups 16(%rcx),%xmm1
1259 .byte 102,15,56,220,208
1260 .byte 102,15,56,220,216
1262 .byte 102,15,56,220,224
1263 .byte 102,15,56,220,232
1264 .byte 102,15,56,220,240
1265 .byte 102,15,56,220,248
1269 pshufd $19,%xmm14,%xmm9
1272 .byte 102,15,56,220,209
1274 .byte 102,15,56,220,217
1275 pcmpgtd %xmm15,%xmm14
1276 .byte 102,15,56,220,225
1278 .byte 102,15,56,220,233
1279 .byte 102,15,56,220,241
1280 .byte 102,15,56,220,249
1281 movups 16(%rcx),%xmm1
1283 pshufd $19,%xmm14,%xmm9
1285 movdqa %xmm15,%xmm10
1287 .byte 102,15,56,220,208
1289 .byte 102,15,56,220,216
1290 pcmpgtd %xmm15,%xmm14
1291 .byte 102,15,56,220,224
1293 .byte 102,15,56,220,232
1294 .byte 102,15,56,220,240
1295 .byte 102,15,56,220,248
1296 movups 32(%rcx),%xmm0
1298 pshufd $19,%xmm14,%xmm9
1300 movdqa %xmm15,%xmm11
1302 .byte 102,15,56,220,209
1304 .byte 102,15,56,220,217
1305 pcmpgtd %xmm15,%xmm14
1306 .byte 102,15,56,220,225
1308 .byte 102,15,56,220,233
1309 .byte 102,15,56,220,241
1310 .byte 102,15,56,220,249
1312 pshufd $19,%xmm14,%xmm9
1314 movdqa %xmm15,%xmm12
1316 .byte 102,15,56,221,208
1318 .byte 102,15,56,221,216
1319 pcmpgtd %xmm15,%xmm14
1320 .byte 102,15,56,221,224
1322 .byte 102,15,56,221,232
1323 .byte 102,15,56,221,240
1324 .byte 102,15,56,221,248
1326 pshufd $19,%xmm14,%xmm9
1328 movdqa %xmm15,%xmm13
1332 xorps 16(%rsp),%xmm3
1333 pcmpgtd %xmm15,%xmm14
1336 xorps 32(%rsp),%xmm4
1337 movups %xmm2,0(%rsi)
1338 xorps 48(%rsp),%xmm5
1339 movups %xmm3,16(%rsi)
1340 xorps 64(%rsp),%xmm6
1341 movups %xmm4,32(%rsi)
1342 xorps 80(%rsp),%xmm7
1343 movups %xmm5,48(%rsi)
1345 movups %xmm6,64(%rsi)
1346 movups %xmm7,80(%rsi)
1349 jnc .Lxts_enc_grandloop
1351 leal 3(%rax,%rax,1),%eax
1367 pshufd $19,%xmm14,%xmm9
1368 movdqa %xmm15,%xmm14
1372 movdqu 16(%rdi),%xmm3
1375 movdqu 32(%rdi),%xmm4
1377 movdqu 48(%rdi),%xmm5
1379 movdqu 64(%rdi),%xmm6
1385 call _aesni_encrypt6
1388 movdqa %xmm15,%xmm10
1393 movdqu %xmm3,16(%rsi)
1395 movdqu %xmm4,32(%rsi)
1396 movdqu %xmm5,48(%rsi)
1397 movdqu %xmm6,64(%rsi)
1407 movups 16(%rcx),%xmm1
1411 .byte 102,15,56,220,209
1416 .byte 102,15,56,221,209
1418 movdqa %xmm11,%xmm10
1426 movups 16(%rdi),%xmm3
1431 call _aesni_encrypt3
1434 movdqa %xmm12,%xmm10
1437 movups %xmm3,16(%rsi)
1444 movups 16(%rdi),%xmm3
1445 movups 32(%rdi),%xmm4
1451 call _aesni_encrypt3
1454 movdqa %xmm13,%xmm10
1458 movups %xmm3,16(%rsi)
1459 movups %xmm4,32(%rsi)
1466 movups 16(%rdi),%xmm3
1467 movups 32(%rdi),%xmm4
1469 movups 48(%rdi),%xmm5
1475 call _aesni_encrypt4
1478 movdqa %xmm15,%xmm10
1483 movups %xmm3,16(%rsi)
1484 movups %xmm4,32(%rsi)
1485 movups %xmm5,48(%rsi)
1497 movzbl -16(%rsi),%ecx
1509 movups -16(%rsi),%xmm2
1512 movups 16(%rcx),%xmm1
1516 .byte 102,15,56,220,209
1521 .byte 102,15,56,221,209
1523 movups %xmm2,-16(%rsi)
1529 .size aesni_xts_encrypt,.-aesni_xts_encrypt
1530 .globl aesni_xts_decrypt
1531 .type aesni_xts_decrypt,@function
1534 leaq -104(%rsp),%rsp
1537 movl 240(%rcx),%r10d
1539 movups 16(%r8),%xmm1
1543 .byte 102,68,15,56,220,249
1548 .byte 102,68,15,56,221,249
1560 movdqa .Lxts_magic(%rip),%xmm8
1562 pcmpgtd %xmm15,%xmm14
1563 pshufd $19,%xmm14,%xmm9
1565 movdqa %xmm15,%xmm10
1568 pcmpgtd %xmm15,%xmm14
1570 pshufd $19,%xmm14,%xmm9
1572 movdqa %xmm15,%xmm11
1575 pcmpgtd %xmm15,%xmm14
1577 pshufd $19,%xmm14,%xmm9
1579 movdqa %xmm15,%xmm12
1582 pcmpgtd %xmm15,%xmm14
1584 pshufd $19,%xmm14,%xmm9
1586 movdqa %xmm15,%xmm13
1589 pcmpgtd %xmm15,%xmm14
1597 jmp .Lxts_dec_grandloop
1600 .Lxts_dec_grandloop:
1601 pshufd $19,%xmm14,%xmm9
1602 movdqa %xmm15,%xmm14
1604 movdqu 0(%rdi),%xmm2
1606 movdqu 16(%rdi),%xmm3
1609 movdqu 32(%rdi),%xmm4
1611 movdqu 48(%rdi),%xmm5
1613 movdqu 64(%rdi),%xmm6
1615 movdqu 80(%rdi),%xmm7
1624 movups 16(%r11),%xmm1
1627 movdqa %xmm10,0(%rsp)
1628 .byte 102,15,56,222,209
1631 movdqa %xmm11,16(%rsp)
1632 .byte 102,15,56,222,217
1634 movdqa %xmm12,32(%rsp)
1635 .byte 102,15,56,222,225
1637 movdqa %xmm13,48(%rsp)
1638 .byte 102,15,56,222,233
1642 movdqa %xmm14,64(%rsp)
1643 .byte 102,15,56,222,241
1644 movdqa %xmm15,80(%rsp)
1645 .byte 102,15,56,222,249
1647 pcmpgtd %xmm15,%xmm14
1648 jmp .Lxts_dec_loop6_enter
1652 .byte 102,15,56,222,209
1653 .byte 102,15,56,222,217
1655 .byte 102,15,56,222,225
1656 .byte 102,15,56,222,233
1657 .byte 102,15,56,222,241
1658 .byte 102,15,56,222,249
1659 .Lxts_dec_loop6_enter:
1660 movups 16(%rcx),%xmm1
1661 .byte 102,15,56,222,208
1662 .byte 102,15,56,222,216
1664 .byte 102,15,56,222,224
1665 .byte 102,15,56,222,232
1666 .byte 102,15,56,222,240
1667 .byte 102,15,56,222,248
1671 pshufd $19,%xmm14,%xmm9
1674 .byte 102,15,56,222,209
1676 .byte 102,15,56,222,217
1677 pcmpgtd %xmm15,%xmm14
1678 .byte 102,15,56,222,225
1680 .byte 102,15,56,222,233
1681 .byte 102,15,56,222,241
1682 .byte 102,15,56,222,249
1683 movups 16(%rcx),%xmm1
1685 pshufd $19,%xmm14,%xmm9
1687 movdqa %xmm15,%xmm10
1689 .byte 102,15,56,222,208
1691 .byte 102,15,56,222,216
1692 pcmpgtd %xmm15,%xmm14
1693 .byte 102,15,56,222,224
1695 .byte 102,15,56,222,232
1696 .byte 102,15,56,222,240
1697 .byte 102,15,56,222,248
1698 movups 32(%rcx),%xmm0
1700 pshufd $19,%xmm14,%xmm9
1702 movdqa %xmm15,%xmm11
1704 .byte 102,15,56,222,209
1706 .byte 102,15,56,222,217
1707 pcmpgtd %xmm15,%xmm14
1708 .byte 102,15,56,222,225
1710 .byte 102,15,56,222,233
1711 .byte 102,15,56,222,241
1712 .byte 102,15,56,222,249
1714 pshufd $19,%xmm14,%xmm9
1716 movdqa %xmm15,%xmm12
1718 .byte 102,15,56,223,208
1720 .byte 102,15,56,223,216
1721 pcmpgtd %xmm15,%xmm14
1722 .byte 102,15,56,223,224
1724 .byte 102,15,56,223,232
1725 .byte 102,15,56,223,240
1726 .byte 102,15,56,223,248
1728 pshufd $19,%xmm14,%xmm9
1730 movdqa %xmm15,%xmm13
1734 xorps 16(%rsp),%xmm3
1735 pcmpgtd %xmm15,%xmm14
1738 xorps 32(%rsp),%xmm4
1739 movups %xmm2,0(%rsi)
1740 xorps 48(%rsp),%xmm5
1741 movups %xmm3,16(%rsi)
1742 xorps 64(%rsp),%xmm6
1743 movups %xmm4,32(%rsi)
1744 xorps 80(%rsp),%xmm7
1745 movups %xmm5,48(%rsi)
1747 movups %xmm6,64(%rsi)
1748 movups %xmm7,80(%rsi)
1751 jnc .Lxts_dec_grandloop
1753 leal 3(%rax,%rax,1),%eax
1769 pshufd $19,%xmm14,%xmm9
1770 movdqa %xmm15,%xmm14
1774 movdqu 16(%rdi),%xmm3
1777 movdqu 32(%rdi),%xmm4
1779 movdqu 48(%rdi),%xmm5
1781 movdqu 64(%rdi),%xmm6
1787 call _aesni_decrypt6
1794 movdqu %xmm3,16(%rsi)
1796 movdqu %xmm4,32(%rsi)
1798 movdqu %xmm5,48(%rsi)
1799 pcmpgtd %xmm15,%xmm14
1800 movdqu %xmm6,64(%rsi)
1802 pshufd $19,%xmm14,%xmm11
1806 movdqa %xmm15,%xmm10
1818 movups 16(%rcx),%xmm1
1822 .byte 102,15,56,222,209
1827 .byte 102,15,56,223,209
1829 movdqa %xmm11,%xmm10
1831 movdqa %xmm12,%xmm11
1838 movups 16(%rdi),%xmm3
1843 call _aesni_decrypt3
1846 movdqa %xmm12,%xmm10
1848 movdqa %xmm13,%xmm11
1850 movups %xmm3,16(%rsi)
1857 movups 16(%rdi),%xmm3
1858 movups 32(%rdi),%xmm4
1864 call _aesni_decrypt3
1867 movdqa %xmm13,%xmm10
1869 movdqa %xmm15,%xmm11
1872 movups %xmm3,16(%rsi)
1873 movups %xmm4,32(%rsi)
1879 pshufd $19,%xmm14,%xmm9
1880 movdqa %xmm15,%xmm14
1884 movups 16(%rdi),%xmm3
1887 movups 32(%rdi),%xmm4
1889 movups 48(%rdi),%xmm5
1895 call _aesni_decrypt4
1898 movdqa %xmm14,%xmm10
1900 movdqa %xmm15,%xmm11
1904 movups %xmm3,16(%rsi)
1905 movups %xmm4,32(%rsi)
1906 movups %xmm5,48(%rsi)
1922 movups 16(%rcx),%xmm1
1926 .byte 102,15,56,222,209
1931 .byte 102,15,56,223,209
1936 movzbl 16(%rdi),%eax
1952 movups 16(%rcx),%xmm1
1956 .byte 102,15,56,222,209
1961 .byte 102,15,56,223,209
1969 .size aesni_xts_decrypt,.-aesni_xts_decrypt
1970 .globl aesni_cbc_encrypt
1971 .type aesni_cbc_encrypt,@function
1977 movl 240(%rcx),%r10d
1994 movups 16(%rcx),%xmm1
1999 .byte 102,15,56,220,209
2004 .byte 102,15,56,221,209
2007 movups %xmm2,0(%rsi)
2040 movaps %xmm9,-24(%rsp)
2041 jmp .Lcbc_dec_loop8_enter
2044 movaps %xmm0,-24(%rsp)
2047 .Lcbc_dec_loop8_enter:
2050 movups 16(%rdi),%xmm3
2051 movups 16(%rcx),%xmm1
2054 movdqu 32(%rdi),%xmm4
2056 movdqu 48(%rdi),%xmm5
2058 movdqu 64(%rdi),%xmm6
2059 .byte 102,15,56,222,209
2061 movdqu 80(%rdi),%xmm7
2062 .byte 102,15,56,222,217
2064 movdqu 96(%rdi),%xmm8
2065 .byte 102,15,56,222,225
2067 movdqu 112(%rdi),%xmm9
2068 .byte 102,15,56,222,233
2071 .byte 102,15,56,222,241
2073 .byte 102,15,56,222,249
2076 .byte 102,68,15,56,222,193
2077 .byte 102,68,15,56,222,201
2078 movups 16(%rcx),%xmm1
2080 call .Ldec_loop8_enter
2083 movups 16(%rdi),%xmm0
2084 xorps -24(%rsp),%xmm2
2086 movups 32(%rdi),%xmm1
2088 movups 48(%rdi),%xmm0
2090 movups 64(%rdi),%xmm1
2092 movups 80(%rdi),%xmm0
2094 movups 96(%rdi),%xmm1
2096 movups 112(%rdi),%xmm0
2099 movups %xmm3,16(%rsi)
2100 movups %xmm4,32(%rsi)
2101 movups %xmm5,48(%rsi)
2103 movups %xmm6,64(%rsi)
2105 movups %xmm7,80(%rsi)
2107 movups %xmm8,96(%rsi)
2115 jle .Lcbc_dec_tail_collected
2117 leal 1(%r10,%r10,1),%eax
2125 movups 16(%rdi),%xmm3
2130 movups 32(%rdi),%xmm4
2135 movups 48(%rdi),%xmm5
2139 movups 64(%rdi),%xmm6
2143 movups 80(%rdi),%xmm7
2147 movups 96(%rdi),%xmm8
2148 movaps %xmm9,-24(%rsp)
2149 call _aesni_decrypt8
2151 movups 16(%rdi),%xmm0
2152 xorps -24(%rsp),%xmm2
2154 movups 32(%rdi),%xmm1
2156 movups 48(%rdi),%xmm0
2158 movups 64(%rdi),%xmm1
2160 movups 80(%rdi),%xmm0
2162 movups 96(%rdi),%xmm9
2165 movups %xmm3,16(%rsi)
2166 movups %xmm4,32(%rsi)
2167 movups %xmm5,48(%rsi)
2168 movups %xmm6,64(%rsi)
2169 movups %xmm7,80(%rsi)
2173 jmp .Lcbc_dec_tail_collected
2177 movups 16(%rcx),%xmm1
2181 .byte 102,15,56,222,209
2186 .byte 102,15,56,223,209
2190 jmp .Lcbc_dec_tail_collected
2194 call _aesni_decrypt3
2202 jmp .Lcbc_dec_tail_collected
2205 call _aesni_decrypt3
2210 movups %xmm3,16(%rsi)
2215 jmp .Lcbc_dec_tail_collected
2218 call _aesni_decrypt4
2220 movups 48(%rdi),%xmm9
2224 movups %xmm3,16(%rsi)
2226 movups %xmm4,32(%rsi)
2230 jmp .Lcbc_dec_tail_collected
2234 call _aesni_decrypt6
2235 movups 16(%rdi),%xmm1
2236 movups 32(%rdi),%xmm0
2240 movups 48(%rdi),%xmm1
2242 movups 64(%rdi),%xmm9
2245 movups %xmm3,16(%rsi)
2246 movups %xmm4,32(%rsi)
2247 movups %xmm5,48(%rsi)
2251 jmp .Lcbc_dec_tail_collected
2254 call _aesni_decrypt6
2255 movups 16(%rdi),%xmm1
2256 movups 32(%rdi),%xmm0
2260 movups 48(%rdi),%xmm1
2262 movups 64(%rdi),%xmm0
2264 movups 80(%rdi),%xmm9
2267 movups %xmm3,16(%rsi)
2268 movups %xmm4,32(%rsi)
2269 movups %xmm5,48(%rsi)
2270 movups %xmm6,64(%rsi)
2274 jmp .Lcbc_dec_tail_collected
2276 .Lcbc_dec_tail_collected:
2279 jnz .Lcbc_dec_tail_partial
2283 .Lcbc_dec_tail_partial:
2284 movaps %xmm2,-24(%rsp)
2294 .size aesni_cbc_encrypt,.-aesni_cbc_encrypt
2295 .globl aesni_set_decrypt_key
2296 .type aesni_set_decrypt_key,@function
2298 aesni_set_decrypt_key:
2299 .byte 0x48,0x83,0xEC,0x08
2300 call __aesni_set_encrypt_key
2304 leaq 16(%rdx,%rsi,1),%rdi
2316 .byte 102,15,56,219,192
2317 .byte 102,15,56,219,201
2320 movups %xmm0,16(%rdi)
2321 movups %xmm1,-16(%rdx)
2323 ja .Ldec_key_inverse
2326 .byte 102,15,56,219,192
2331 .LSEH_end_set_decrypt_key:
2332 .size aesni_set_decrypt_key,.-aesni_set_decrypt_key
2333 .globl aesni_set_encrypt_key
2334 .type aesni_set_encrypt_key,@function
2336 aesni_set_encrypt_key:
2337 __aesni_set_encrypt_key:
2338 .byte 0x48,0x83,0xEC,0x08
2358 .byte 102,15,58,223,200,1
2359 call .Lkey_expansion_128_cold
2360 .byte 102,15,58,223,200,2
2361 call .Lkey_expansion_128
2362 .byte 102,15,58,223,200,4
2363 call .Lkey_expansion_128
2364 .byte 102,15,58,223,200,8
2365 call .Lkey_expansion_128
2366 .byte 102,15,58,223,200,16
2367 call .Lkey_expansion_128
2368 .byte 102,15,58,223,200,32
2369 call .Lkey_expansion_128
2370 .byte 102,15,58,223,200,64
2371 call .Lkey_expansion_128
2372 .byte 102,15,58,223,200,128
2373 call .Lkey_expansion_128
2374 .byte 102,15,58,223,200,27
2375 call .Lkey_expansion_128
2376 .byte 102,15,58,223,200,54
2377 call .Lkey_expansion_128
2388 .byte 102,15,58,223,202,1
2389 call .Lkey_expansion_192a_cold
2390 .byte 102,15,58,223,202,2
2391 call .Lkey_expansion_192b
2392 .byte 102,15,58,223,202,4
2393 call .Lkey_expansion_192a
2394 .byte 102,15,58,223,202,8
2395 call .Lkey_expansion_192b
2396 .byte 102,15,58,223,202,16
2397 call .Lkey_expansion_192a
2398 .byte 102,15,58,223,202,32
2399 call .Lkey_expansion_192b
2400 .byte 102,15,58,223,202,64
2401 call .Lkey_expansion_192a
2402 .byte 102,15,58,223,202,128
2403 call .Lkey_expansion_192b
2411 movups 16(%rdi),%xmm2
2415 movups %xmm2,16(%rdx)
2416 .byte 102,15,58,223,202,1
2417 call .Lkey_expansion_256a_cold
2418 .byte 102,15,58,223,200,1
2419 call .Lkey_expansion_256b
2420 .byte 102,15,58,223,202,2
2421 call .Lkey_expansion_256a
2422 .byte 102,15,58,223,200,2
2423 call .Lkey_expansion_256b
2424 .byte 102,15,58,223,202,4
2425 call .Lkey_expansion_256a
2426 .byte 102,15,58,223,200,4
2427 call .Lkey_expansion_256b
2428 .byte 102,15,58,223,202,8
2429 call .Lkey_expansion_256a
2430 .byte 102,15,58,223,200,8
2431 call .Lkey_expansion_256b
2432 .byte 102,15,58,223,202,16
2433 call .Lkey_expansion_256a
2434 .byte 102,15,58,223,200,16
2435 call .Lkey_expansion_256b
2436 .byte 102,15,58,223,202,32
2437 call .Lkey_expansion_256a
2438 .byte 102,15,58,223,200,32
2439 call .Lkey_expansion_256b
2440 .byte 102,15,58,223,202,64
2441 call .Lkey_expansion_256a
2453 .LSEH_end_set_encrypt_key:
2456 .Lkey_expansion_128:
2459 .Lkey_expansion_128_cold:
2460 shufps $16,%xmm0,%xmm4
2462 shufps $140,%xmm0,%xmm4
2464 shufps $255,%xmm1,%xmm1
2469 .Lkey_expansion_192a:
2472 .Lkey_expansion_192a_cold:
2474 .Lkey_expansion_192b_warm:
2475 shufps $16,%xmm0,%xmm4
2478 shufps $140,%xmm0,%xmm4
2481 pshufd $85,%xmm1,%xmm1
2484 pshufd $255,%xmm0,%xmm3
2489 .Lkey_expansion_192b:
2491 shufps $68,%xmm0,%xmm5
2493 shufps $78,%xmm2,%xmm3
2494 movups %xmm3,16(%rax)
2496 jmp .Lkey_expansion_192b_warm
2499 .Lkey_expansion_256a:
2502 .Lkey_expansion_256a_cold:
2503 shufps $16,%xmm0,%xmm4
2505 shufps $140,%xmm0,%xmm4
2507 shufps $255,%xmm1,%xmm1
2512 .Lkey_expansion_256b:
2516 shufps $16,%xmm2,%xmm4
2518 shufps $140,%xmm2,%xmm4
2520 shufps $170,%xmm1,%xmm1
2523 .size aesni_set_encrypt_key,.-aesni_set_encrypt_key
2524 .size __aesni_set_encrypt_key,.-__aesni_set_encrypt_key
2527 .byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
2535 .byte 65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69,83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0