1 #include <machine/asm.h>
19 .type _vpaes_encrypt_core,@function
26 movdqa .Lk_ipt(%rip),%xmm2
32 movdqa .Lk_ipt+16(%rip),%xmm0
37 leaq .Lk_mc_backward(%rip),%r10
51 movdqa -64(%r11,%r10,1),%xmm1
55 movdqa (%r11,%r10,1),%xmm4
93 movdqa -96(%r10),%xmm4
94 movdqa -80(%r10),%xmm0
98 movdqa 64(%r11,%r10,1),%xmm1
100 .byte 102,15,56,0,193
102 .size _vpaes_encrypt_core,.-_vpaes_encrypt_core
109 .type _vpaes_decrypt_core,@function
115 movdqa .Lk_dipt(%rip),%xmm2
122 .byte 102,15,56,0,208
123 movdqa .Lk_dipt+16(%rip),%xmm0
125 leaq .Lk_dsbd(%rip),%r10
126 .byte 102,15,56,0,193
129 movdqa .Lk_mc_forward+48(%rip),%xmm5
140 movdqa -32(%r10),%xmm4
141 .byte 102,15,56,0,226
143 movdqa -16(%r10),%xmm0
144 .byte 102,15,56,0,195
148 .byte 102,15,56,0,197
150 .byte 102,15,56,0,226
152 movdqa 16(%r10),%xmm0
153 .byte 102,15,56,0,195
157 .byte 102,15,56,0,197
158 movdqa 32(%r10),%xmm4
159 .byte 102,15,56,0,226
161 movdqa 48(%r10),%xmm0
162 .byte 102,15,56,0,195
165 .byte 102,15,56,0,197
166 movdqa 64(%r10),%xmm4
167 .byte 102,15,56,0,226
169 movdqa 80(%r10),%xmm0
170 .byte 102,15,56,0,195
173 .byte 102,15,58,15,237,12
182 .byte 102,15,56,0,208
185 .byte 102,15,56,0,217
188 .byte 102,15,56,0,224
191 .byte 102,15,56,0,211
194 .byte 102,15,56,0,220
200 movdqa 96(%r10),%xmm4
201 .byte 102,15,56,0,226
203 movdqa 112(%r10),%xmm0
204 movdqa -352(%r11),%xmm2
205 .byte 102,15,56,0,195
207 .byte 102,15,56,0,194
209 .size _vpaes_decrypt_core,.-_vpaes_decrypt_core
216 .type _vpaes_schedule_core,@function
218 _vpaes_schedule_core:
225 movdqa .Lk_rcon(%rip),%xmm8
230 leaq .Lk_ipt(%rip),%r11
231 call _vpaes_schedule_transform
234 leaq .Lk_sr(%rip),%r10
236 jnz .Lschedule_am_decrypting
242 .Lschedule_am_decrypting:
244 movdqa (%r8,%r10,1),%xmm1
245 .byte 102,15,56,0,217
267 call _vpaes_schedule_round
269 jz .Lschedule_mangle_last
270 call _vpaes_schedule_mangle
271 jmp .Loop_schedule_128
291 call _vpaes_schedule_transform
298 call _vpaes_schedule_round
299 .byte 102,15,58,15,198,8
300 call _vpaes_schedule_mangle
301 call _vpaes_schedule_192_smear
302 call _vpaes_schedule_mangle
303 call _vpaes_schedule_round
305 jz .Lschedule_mangle_last
306 call _vpaes_schedule_mangle
307 call _vpaes_schedule_192_smear
308 jmp .Loop_schedule_192
322 movdqu 16(%rdi),%xmm0
323 call _vpaes_schedule_transform
327 call _vpaes_schedule_mangle
331 call _vpaes_schedule_round
333 jz .Lschedule_mangle_last
334 call _vpaes_schedule_mangle
337 pshufd $255,%xmm0,%xmm0
340 call _vpaes_schedule_low_round
343 jmp .Loop_schedule_256
357 .Lschedule_mangle_last:
359 leaq .Lk_deskew(%rip),%r11
361 jnz .Lschedule_mangle_last_dec
364 movdqa (%r8,%r10,1),%xmm1
365 .byte 102,15,56,0,193
366 leaq .Lk_opt(%rip),%r11
369 .Lschedule_mangle_last_dec:
371 pxor .Lk_s63(%rip),%xmm0
372 call _vpaes_schedule_transform
385 .size _vpaes_schedule_core,.-_vpaes_schedule_core
401 .type _vpaes_schedule_192_smear,@function
403 _vpaes_schedule_192_smear:
404 pshufd $128,%xmm6,%xmm0
406 pshufd $254,%xmm7,%xmm0
412 .size _vpaes_schedule_192_smear,.-_vpaes_schedule_192_smear
432 .type _vpaes_schedule_round,@function
434 _vpaes_schedule_round:
437 .byte 102,65,15,58,15,200,15
438 .byte 102,69,15,58,15,192,15
442 pshufd $255,%xmm0,%xmm0
443 .byte 102,15,58,15,192,1
448 _vpaes_schedule_low_round:
456 pxor .Lk_s63(%rip),%xmm7
464 .byte 102,15,56,0,208
467 .byte 102,15,56,0,217
470 .byte 102,15,56,0,224
473 .byte 102,15,56,0,211
476 .byte 102,15,56,0,220
479 .byte 102,15,56,0,226
481 .byte 102,15,56,0,195
488 .size _vpaes_schedule_round,.-_vpaes_schedule_round
499 .type _vpaes_schedule_transform,@function
501 _vpaes_schedule_transform:
507 .byte 102,15,56,0,208
508 movdqa 16(%r11),%xmm0
509 .byte 102,15,56,0,193
512 .size _vpaes_schedule_transform,.-_vpaes_schedule_transform
537 .type _vpaes_schedule_mangle,@function
539 _vpaes_schedule_mangle:
541 movdqa .Lk_mc_forward(%rip),%xmm5
543 jnz .Lschedule_mangle_dec
547 pxor .Lk_s63(%rip),%xmm4
548 .byte 102,15,56,0,229
550 .byte 102,15,56,0,229
552 .byte 102,15,56,0,229
555 jmp .Lschedule_mangle_both
557 .Lschedule_mangle_dec:
559 leaq .Lk_dksd(%rip),%r11
566 .byte 102,15,56,0,212
567 movdqa 16(%r11),%xmm3
568 .byte 102,15,56,0,217
570 .byte 102,15,56,0,221
572 movdqa 32(%r11),%xmm2
573 .byte 102,15,56,0,212
575 movdqa 48(%r11),%xmm3
576 .byte 102,15,56,0,217
578 .byte 102,15,56,0,221
580 movdqa 64(%r11),%xmm2
581 .byte 102,15,56,0,212
583 movdqa 80(%r11),%xmm3
584 .byte 102,15,56,0,217
586 .byte 102,15,56,0,221
588 movdqa 96(%r11),%xmm2
589 .byte 102,15,56,0,212
591 movdqa 112(%r11),%xmm3
592 .byte 102,15,56,0,217
597 .Lschedule_mangle_both:
598 movdqa (%r8,%r10,1),%xmm1
599 .byte 102,15,56,0,217
604 .size _vpaes_schedule_mangle,.-_vpaes_schedule_mangle
609 .globl vpaes_set_encrypt_key
610 .type vpaes_set_encrypt_key,@function
612 vpaes_set_encrypt_key:
620 call _vpaes_schedule_core
623 .size vpaes_set_encrypt_key,.-vpaes_set_encrypt_key
625 .globl vpaes_set_decrypt_key
626 .type vpaes_set_decrypt_key,@function
628 vpaes_set_decrypt_key:
634 leaq 16(%rdx,%rax,1),%rdx
641 call _vpaes_schedule_core
644 .size vpaes_set_decrypt_key,.-vpaes_set_decrypt_key
647 .type vpaes_encrypt,@function
652 call _vpaes_encrypt_core
655 .size vpaes_encrypt,.-vpaes_encrypt
658 .type vpaes_decrypt,@function
663 call _vpaes_decrypt_core
666 .size vpaes_decrypt,.-vpaes_decrypt
667 .globl vpaes_cbc_encrypt
668 .type vpaes_cbc_encrypt,@function
684 call _vpaes_encrypt_core
686 movdqu %xmm0,(%rsi,%rdi,1)
695 call _vpaes_decrypt_core
698 movdqu %xmm0,(%rsi,%rdi,1)
706 .size vpaes_cbc_encrypt,.-vpaes_cbc_encrypt
713 .type _vpaes_preheat,@function
716 leaq .Lk_s0F(%rip),%r10
717 movdqa -32(%r10),%xmm10
718 movdqa -16(%r10),%xmm11
720 movdqa 48(%r10),%xmm13
721 movdqa 64(%r10),%xmm12
722 movdqa 80(%r10),%xmm15
723 movdqa 96(%r10),%xmm14
725 .size _vpaes_preheat,.-_vpaes_preheat
731 .type _vpaes_consts,@object
735 .quad 0x0E05060F0D080180, 0x040703090A0B0C02
736 .quad 0x01040A060F0B0780, 0x030D0E0C02050809
739 .quad 0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F
742 .quad 0xC2B2E8985A2A7000, 0xCABAE09052227808
743 .quad 0x4C01307D317C4D00, 0xCD80B1FCB0FDCC81
746 .quad 0xB19BE18FCB503E00, 0xA5DF7A6E142AF544
747 .quad 0x3618D415FAE22300, 0x3BF7CCC10D2ED9EF
749 .quad 0xE27A93C60B712400, 0x5EB7E955BC982FCD
750 .quad 0x69EB88400AE12900, 0xC2A163C8AB82234A
752 .quad 0xD0D26D176FBDC700, 0x15AABF7AC502A878
753 .quad 0xCFE474A55FBB6A00, 0x8E1E90D1412B35FA
756 .quad 0x0407060500030201, 0x0C0F0E0D080B0A09
757 .quad 0x080B0A0904070605, 0x000302010C0F0E0D
758 .quad 0x0C0F0E0D080B0A09, 0x0407060500030201
759 .quad 0x000302010C0F0E0D, 0x080B0A0904070605
762 .quad 0x0605040702010003, 0x0E0D0C0F0A09080B
763 .quad 0x020100030E0D0C0F, 0x0A09080B06050407
764 .quad 0x0E0D0C0F0A09080B, 0x0605040702010003
765 .quad 0x0A09080B06050407, 0x020100030E0D0C0F
768 .quad 0x0706050403020100, 0x0F0E0D0C0B0A0908
769 .quad 0x030E09040F0A0500, 0x0B06010C07020D08
770 .quad 0x0F060D040B020900, 0x070E050C030A0108
771 .quad 0x0B0E0104070A0D00, 0x0306090C0F020508
774 .quad 0x1F8391B9AF9DEEB6, 0x702A98084D7C7D81
777 .quad 0x5B5B5B5B5B5B5B5B, 0x5B5B5B5B5B5B5B5B
780 .quad 0xFF9F4929D6B66000, 0xF7974121DEBE6808
781 .quad 0x01EDBD5150BCEC00, 0xE10D5DB1B05C0CE0
784 .quad 0x07E4A34047A4E300, 0x1DFEB95A5DBEF91A
785 .quad 0x5F36B5DC83EA6900, 0x2841C2ABF49D1E77
792 .quad 0xFEB91A5DA3E44700, 0x0740E3A45A1DBEF9
793 .quad 0x41C277F4B5368300, 0x5FDC69EAAB289D1E
795 .quad 0x9A4FCA1F8550D500, 0x03D653861CC94C99
796 .quad 0x115BEDA7B6FC4A00, 0xD993256F7E3482C8
798 .quad 0xD5031CCA1FC9D600, 0x53859A4C994F5086
799 .quad 0xA23196054FDC7BE8, 0xCD5EF96A20B31487
801 .quad 0xB6116FC87ED9A700, 0x4AED933482255BFC
802 .quad 0x4576516227143300, 0x8BB89FACE9DAFDCE
809 .quad 0x0F505B040B545F00, 0x154A411E114E451A
810 .quad 0x86E383E660056500, 0x12771772F491F194
813 .quad 0x851C03539A86D600, 0xCAD51F504F994CC9
814 .quad 0xC03B1789ECD74900, 0x725E2C9EB2FBA565
816 .quad 0x7D57CCDFE6B1A200, 0xF56E9B13882A4439
817 .quad 0x3CE2FAF724C6CB00, 0x2931180D15DEEFD3
819 .quad 0xD022649296B44200, 0x602646F6B0F2D404
820 .quad 0xC19498A6CD596700, 0xF3FF0C3E3255AA6B
822 .quad 0x46F2929626D4D000, 0x2242600464B4F6B0
823 .quad 0x0C55A6CDFFAAC100, 0x9467F36B98593E32
825 .quad 0x1387EA537EF94000, 0xC7AA6DB9D4943E2D
826 .quad 0x12D7560F93441D00, 0xCA4B8159D8C58E9C
827 .byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0
829 .size _vpaes_consts,.-_vpaes_consts