1 #include <machine/asm.h>
3 .globl gcm_gmult_4bit_x86
4 .type gcm_gmult_4bit_x86,@function
7 .L_gcm_gmult_4bit_x86_begin:
20 movl $471859200,20(%esp)
21 movl $943718400,24(%esp)
22 movl $610271232,28(%esp)
23 movl $1887436800,32(%esp)
24 movl $1822425088,36(%esp)
25 movl $1220542464,40(%esp)
26 movl $1423966208,44(%esp)
27 movl $3774873600,48(%esp)
28 movl $4246732800,52(%esp)
29 movl $3644850176,56(%esp)
30 movl $3311403008,60(%esp)
31 movl $2441084928,64(%esp)
32 movl $2376073216,68(%esp)
33 movl $2847932416,72(%esp)
34 movl $3051356160,76(%esp)
41 movl 4(%esi,%ebx,1),%ebp
42 movl (%esi,%ebx,1),%edx
43 movl 12(%esi,%ebx,1),%ecx
44 movl 8(%esi,%ebx,1),%ebx
56 xorl 16(%esp,%eax,4),%ebp
57 movb (%esp,%edi,1),%al
59 xorl 8(%esi,%eax,1),%ebx
60 xorl 12(%esi,%eax,1),%ecx
61 xorl (%esi,%eax,1),%edx
62 xorl 4(%esi,%eax,1),%ebp
71 xorl 16(%esp,%eax,4),%ebp
72 movb (%esp,%edi,1),%al
74 xorl 8(%esi,%eax,1),%ebx
75 xorl 12(%esi,%eax,1),%ecx
76 xorl (%esi,%eax,1),%edx
77 xorl 4(%esi,%eax,1),%ebp
96 .size gcm_gmult_4bit_x86,.-.L_gcm_gmult_4bit_x86_begin
97 .globl gcm_ghash_4bit_x86
98 .type gcm_ghash_4bit_x86,@function
101 .L_gcm_ghash_4bit_x86_begin:
118 movl $471859200,20(%esp)
119 movl $943718400,24(%esp)
120 movl $610271232,28(%esp)
121 movl $1887436800,32(%esp)
122 movl $1822425088,36(%esp)
123 movl $1220542464,40(%esp)
124 movl $1423966208,44(%esp)
125 movl $3774873600,48(%esp)
126 movl $4246732800,52(%esp)
127 movl $3644850176,56(%esp)
128 movl $3311403008,60(%esp)
129 movl $2441084928,64(%esp)
130 movl $2376073216,68(%esp)
131 movl $2847932416,72(%esp)
132 movl $3051356160,76(%esp)
145 movl 4(%esi,%ebx,1),%ebp
146 movl (%esi,%ebx,1),%edx
147 movl 12(%esi,%ebx,1),%ecx
148 movl 8(%esi,%ebx,1),%ebx
160 xorl 16(%esp,%eax,4),%ebp
161 movb (%esp,%edi,1),%al
163 xorl 8(%esi,%eax,1),%ebx
164 xorl 12(%esi,%eax,1),%ecx
165 xorl (%esi,%eax,1),%edx
166 xorl 4(%esi,%eax,1),%ebp
175 xorl 16(%esp,%eax,4),%ebp
176 movb (%esp,%edi,1),%al
178 xorl 8(%esi,%eax,1),%ebx
179 xorl 12(%esi,%eax,1),%ecx
180 xorl (%esi,%eax,1),%edx
181 xorl 4(%esi,%eax,1),%ebp
193 jb .L002x86_outer_loop
205 .size gcm_ghash_4bit_x86,.-.L_gcm_ghash_4bit_x86_begin
206 .globl gcm_gmult_4bit_mmx
207 .type gcm_gmult_4bit_mmx,@function
210 .L_gcm_gmult_4bit_mmx_begin:
220 leal .Lrem_4bit-.L005pic_point(%eax),%eax
228 movq 8(%esi,%ecx,1),%mm0
229 movq (%esi,%ecx,1),%mm1
238 pxor 8(%esi,%edx,1),%mm0
239 movb (%edi,%ebp,1),%cl
241 pxor (%eax,%ebx,8),%mm1
244 pxor (%esi,%edx,1),%mm1
254 pxor 8(%esi,%ecx,1),%mm0
256 pxor (%eax,%ebx,8),%mm1
258 pxor (%esi,%ecx,1),%mm1
269 pxor 8(%esi,%ecx,1),%mm0
271 pxor (%eax,%ebx,8),%mm1
273 pxor (%esi,%ecx,1),%mm1
279 pxor 8(%esi,%edx,1),%mm0
281 pxor (%eax,%ebx,8),%mm1
283 pxor (%esi,%edx,1),%mm1
304 .size gcm_gmult_4bit_mmx,.-.L_gcm_gmult_4bit_mmx_begin
305 .globl gcm_ghash_4bit_mmx
306 .type gcm_ghash_4bit_mmx,@function
309 .L_gcm_ghash_4bit_mmx_begin:
322 leal .Lrem_8bit-.L008pic_point(%esi),%esi
579 movq 16(%esp,%eax,8),%mm7
580 movq 144(%esp,%eax,8),%mm6
587 pxor 272(%esp,%ebp,8),%mm7
591 pxor 16(%esp,%eax,8),%mm7
593 pxor 144(%esp,%eax,8),%mm6
595 pxor 400(%esp,%ebp,8),%mm6
596 xorb (%esp,%ebp,1),%bl
604 pxor 272(%esp,%edi,8),%mm7
608 pinsrw $2,(%esi,%ebx,2),%mm2
609 pxor 16(%esp,%eax,8),%mm7
611 pxor 144(%esp,%eax,8),%mm6
613 pxor 400(%esp,%edi,8),%mm6
614 xorb (%esp,%edi,1),%cl
623 pxor 272(%esp,%ebp,8),%mm7
628 pinsrw $2,(%esi,%ecx,2),%mm1
629 pxor 16(%esp,%eax,8),%mm7
631 pxor 144(%esp,%eax,8),%mm6
633 pxor 400(%esp,%ebp,8),%mm6
634 xorb (%esp,%ebp,1),%bl
642 pxor 272(%esp,%edi,8),%mm7
647 pinsrw $2,(%esi,%ebx,2),%mm0
648 pxor 16(%esp,%eax,8),%mm7
650 pxor 144(%esp,%eax,8),%mm6
652 pxor 400(%esp,%edi,8),%mm6
653 xorb (%esp,%edi,1),%cl
661 pxor 272(%esp,%ebp,8),%mm7
666 pinsrw $2,(%esi,%ecx,2),%mm2
667 pxor 16(%esp,%eax,8),%mm7
669 pxor 144(%esp,%eax,8),%mm6
671 pxor 400(%esp,%ebp,8),%mm6
672 xorb (%esp,%ebp,1),%bl
680 pxor 272(%esp,%edi,8),%mm7
685 pinsrw $2,(%esi,%ebx,2),%mm1
686 pxor 16(%esp,%eax,8),%mm7
688 pxor 144(%esp,%eax,8),%mm6
690 pxor 400(%esp,%edi,8),%mm6
691 xorb (%esp,%edi,1),%cl
700 pxor 272(%esp,%ebp,8),%mm7
705 pinsrw $2,(%esi,%ecx,2),%mm0
706 pxor 16(%esp,%eax,8),%mm7
708 pxor 144(%esp,%eax,8),%mm6
710 pxor 400(%esp,%ebp,8),%mm6
711 xorb (%esp,%ebp,1),%bl
719 pxor 272(%esp,%edi,8),%mm7
724 pinsrw $2,(%esi,%ebx,2),%mm2
725 pxor 16(%esp,%eax,8),%mm7
727 pxor 144(%esp,%eax,8),%mm6
729 pxor 400(%esp,%edi,8),%mm6
730 xorb (%esp,%edi,1),%cl
738 pxor 272(%esp,%ebp,8),%mm7
743 pinsrw $2,(%esi,%ecx,2),%mm1
744 pxor 16(%esp,%eax,8),%mm7
746 pxor 144(%esp,%eax,8),%mm6
748 pxor 400(%esp,%ebp,8),%mm6
749 xorb (%esp,%ebp,1),%bl
757 pxor 272(%esp,%edi,8),%mm7
762 pinsrw $2,(%esi,%ebx,2),%mm0
763 pxor 16(%esp,%eax,8),%mm7
765 pxor 144(%esp,%eax,8),%mm6
767 pxor 400(%esp,%edi,8),%mm6
768 xorb (%esp,%edi,1),%cl
777 pxor 272(%esp,%ebp,8),%mm7
782 pinsrw $2,(%esi,%ecx,2),%mm2
783 pxor 16(%esp,%eax,8),%mm7
785 pxor 144(%esp,%eax,8),%mm6
787 pxor 400(%esp,%ebp,8),%mm6
788 xorb (%esp,%ebp,1),%bl
796 pxor 272(%esp,%edi,8),%mm7
801 pinsrw $2,(%esi,%ebx,2),%mm1
802 pxor 16(%esp,%eax,8),%mm7
804 pxor 144(%esp,%eax,8),%mm6
806 pxor 400(%esp,%edi,8),%mm6
807 xorb (%esp,%edi,1),%cl
815 pxor 272(%esp,%ebp,8),%mm7
820 pinsrw $2,(%esi,%ecx,2),%mm0
821 pxor 16(%esp,%eax,8),%mm7
823 pxor 144(%esp,%eax,8),%mm6
825 pxor 400(%esp,%ebp,8),%mm6
826 xorb (%esp,%ebp,1),%bl
834 pxor 272(%esp,%edi,8),%mm7
839 pinsrw $2,(%esi,%ebx,2),%mm2
840 pxor 16(%esp,%eax,8),%mm7
842 pxor 144(%esp,%eax,8),%mm6
844 pxor 400(%esp,%edi,8),%mm6
845 xorb (%esp,%edi,1),%cl
854 pxor 272(%esp,%ebp,8),%mm7
859 pinsrw $2,(%esi,%ecx,2),%mm1
860 pxor 16(%esp,%eax,8),%mm7
861 pxor 144(%esp,%eax,8),%mm6
862 xorb (%esp,%ebp,1),%bl
864 pxor 400(%esp,%ebp,8),%mm6
873 pxor 16(%esp,%edi,8),%mm7
877 pxor 144(%esp,%edi,8),%mm6
878 pinsrw $2,(%esi,%ebx,2),%mm0
881 pinsrw $3,(%esi,%ecx,2),%mm2
908 .size gcm_ghash_4bit_mmx,.-.L_gcm_ghash_4bit_mmx_begin
909 .globl gcm_init_clmul
910 .type gcm_init_clmul,@function
913 .L_gcm_init_clmul_begin:
919 leal .Lbswap-.L010pic(%ecx),%ecx
921 pshufd $78,%xmm2,%xmm2
922 pshufd $255,%xmm2,%xmm4
934 pshufd $78,%xmm0,%xmm3
935 pshufd $78,%xmm2,%xmm4
938 .byte 102,15,58,68,194,0
939 .byte 102,15,58,68,202,17
940 .byte 102,15,58,68,220,0
968 movdqu %xmm0,16(%edx)
970 .size gcm_init_clmul,.-.L_gcm_init_clmul_begin
971 .globl gcm_gmult_clmul
972 .type gcm_gmult_clmul,@function
975 .L_gcm_gmult_clmul_begin:
981 leal .Lbswap-.L011pic(%ecx),%ecx
985 .byte 102,15,56,0,197
987 pshufd $78,%xmm0,%xmm3
988 pshufd $78,%xmm2,%xmm4
991 .byte 102,15,58,68,194,0
992 .byte 102,15,58,68,202,17
993 .byte 102,15,58,68,220,0
1020 .byte 102,15,56,0,197
1023 .size gcm_gmult_clmul,.-.L_gcm_gmult_clmul_begin
1024 .globl gcm_ghash_clmul
1025 .type gcm_ghash_clmul,@function
1028 .L_gcm_ghash_clmul_begin:
1040 leal .Lbswap-.L012pic(%ecx),%ecx
1044 .byte 102,15,56,0,197
1048 movdqu 16(%esi),%xmm6
1049 .byte 102,15,56,0,221
1050 .byte 102,15,56,0,245
1053 pshufd $78,%xmm6,%xmm3
1054 pshufd $78,%xmm2,%xmm4
1057 .byte 102,15,58,68,242,0
1058 .byte 102,15,58,68,250,17
1059 .byte 102,15,58,68,220,0
1067 movups 16(%edx),%xmm2
1073 pshufd $78,%xmm0,%xmm3
1074 pshufd $78,%xmm2,%xmm4
1077 .byte 102,15,58,68,194,0
1078 .byte 102,15,58,68,202,17
1079 .byte 102,15,58,68,220,0
1091 movdqu 16(%esi),%xmm6
1092 .byte 102,15,56,0,221
1093 .byte 102,15,56,0,245
1102 .byte 102,15,58,68,242,0
1108 pshufd $78,%xmm5,%xmm3
1111 pshufd $78,%xmm2,%xmm5
1113 .byte 102,15,58,68,250,17
1122 .byte 102,15,58,68,221,0
1123 movups 16(%edx),%xmm2
1137 pshufd $78,%xmm0,%xmm3
1138 pshufd $78,%xmm2,%xmm4
1141 .byte 102,15,58,68,194,0
1142 .byte 102,15,58,68,202,17
1143 .byte 102,15,58,68,220,0
1177 .byte 102,15,56,0,221
1180 pshufd $78,%xmm0,%xmm3
1181 pshufd $78,%xmm2,%xmm4
1184 .byte 102,15,58,68,194,0
1185 .byte 102,15,58,68,202,17
1186 .byte 102,15,58,68,220,0
1214 .byte 102,15,56,0,197
1221 .size gcm_ghash_clmul,.-.L_gcm_ghash_clmul_begin
1224 .byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
1225 .byte 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,194
1228 .long 0,0,0,471859200,0,943718400,0,610271232
1229 .long 0,1887436800,0,1822425088,0,1220542464,0,1423966208
1230 .long 0,3774873600,0,4246732800,0,3644850176,0,3311403008
1231 .long 0,2441084928,0,2376073216,0,2847932416,0,3051356160
1234 .value 0,450,900,582,1800,1738,1164,1358
1235 .value 3600,4050,3476,3158,2328,2266,2716,2910
1236 .value 7200,7650,8100,7782,6952,6890,6316,6510
1237 .value 4656,5106,4532,4214,5432,5370,5820,6014
1238 .value 14400,14722,15300,14854,16200,16010,15564,15630
1239 .value 13904,14226,13780,13334,12632,12442,13020,13086
1240 .value 9312,9634,10212,9766,9064,8874,8428,8494
1241 .value 10864,11186,10740,10294,11640,11450,12028,12094
1242 .value 28800,28994,29444,29382,30600,30282,29708,30158
1243 .value 32400,32594,32020,31958,31128,30810,31260,31710
1244 .value 27808,28002,28452,28390,27560,27242,26668,27118
1245 .value 25264,25458,24884,24822,26040,25722,26172,26622
1246 .value 18624,18690,19268,19078,20424,19978,19532,19854
1247 .value 18128,18194,17748,17558,16856,16410,16988,17310
1248 .value 21728,21794,22372,22182,21480,21034,20588,20910
1249 .value 23280,23346,22900,22710,24056,23610,24188,24510
1250 .value 57600,57538,57988,58182,58888,59338,58764,58446
1251 .value 61200,61138,60564,60758,59416,59866,60316,59998
1252 .value 64800,64738,65188,65382,64040,64490,63916,63598
1253 .value 62256,62194,61620,61814,62520,62970,63420,63102
1254 .value 55616,55426,56004,56070,56904,57226,56780,56334
1255 .value 55120,54930,54484,54550,53336,53658,54236,53790
1256 .value 50528,50338,50916,50982,49768,50090,49644,49198
1257 .value 52080,51890,51444,51510,52344,52666,53244,52798
1258 .value 37248,36930,37380,37830,38536,38730,38156,38094
1259 .value 40848,40530,39956,40406,39064,39258,39708,39646
1260 .value 36256,35938,36388,36838,35496,35690,35116,35054
1261 .value 33712,33394,32820,33270,33976,34170,34620,34558
1262 .value 43456,43010,43588,43910,44744,44810,44364,44174
1263 .value 42960,42514,42068,42390,41176,41242,41820,41630
1264 .value 46560,46114,46692,47014,45800,45866,45420,45230
1265 .value 48112,47666,47220,47542,48376,48442,49020,48830
1266 .byte 71,72,65,83,72,32,102,111,114,32,120,56,54,44,32,67
1267 .byte 82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112
1268 .byte 112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62