1# This file is generated from a similarly-named Perl script in the BoringSSL 2# source tree. Do not edit by hand. 3 4#if defined(__i386__) 5#if defined(BORINGSSL_PREFIX) 6#include <boringssl_prefix_symbols_asm.h> 7#endif 8.text 9.align 6,0x90 10L_vpaes_consts: 11.long 218628480,235210255,168496130,67568393 12.long 252381056,17041926,33884169,51187212 13.long 252645135,252645135,252645135,252645135 14.long 1512730624,3266504856,1377990664,3401244816 15.long 830229760,1275146365,2969422977,3447763452 16.long 3411033600,2979783055,338359620,2782886510 17.long 4209124096,907596821,221174255,1006095553 18.long 191964160,3799684038,3164090317,1589111125 19.long 182528256,1777043520,2877432650,3265356744 20.long 1874708224,3503451415,3305285752,363511674 21.long 1606117888,3487855781,1093350906,2384367825 22.long 197121,67569157,134941193,202313229 23.long 67569157,134941193,202313229,197121 24.long 134941193,202313229,197121,67569157 25.long 202313229,197121,67569157,134941193 26.long 33619971,100992007,168364043,235736079 27.long 235736079,33619971,100992007,168364043 28.long 168364043,235736079,33619971,100992007 29.long 100992007,168364043,235736079,33619971 30.long 50462976,117835012,185207048,252579084 31.long 252314880,51251460,117574920,184942860 32.long 184682752,252054788,50987272,118359308 33.long 118099200,185467140,251790600,50727180 34.long 2946363062,528716217,1300004225,1881839624 35.long 1532713819,1532713819,1532713819,1532713819 36.long 3602276352,4288629033,3737020424,4153884961 37.long 1354558464,32357713,2958822624,3775749553 38.long 1201988352,132424512,1572796698,503232858 39.long 2213177600,1597421020,4103937655,675398315 40.byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105 41.byte 111,110,32,65,69,83,32,102,111,114,32,120,56,54,47,83 42.byte 83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117 43.byte 114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105 44.byte 118,101,114,115,105,116,121,41,0 45.align 6,0x90 46.private_extern __vpaes_preheat 47.align 4 48__vpaes_preheat: 49 addl (%esp),%ebp 50 movdqa -48(%ebp),%xmm7 51 movdqa -16(%ebp),%xmm6 52 ret 53.private_extern __vpaes_encrypt_core 54.align 4 55__vpaes_encrypt_core: 56 movl $16,%ecx 57 movl 240(%edx),%eax 58 movdqa %xmm6,%xmm1 59 movdqa (%ebp),%xmm2 60 pandn %xmm0,%xmm1 61 pand %xmm6,%xmm0 62 movdqu (%edx),%xmm5 63.byte 102,15,56,0,208 64 movdqa 16(%ebp),%xmm0 65 pxor %xmm5,%xmm2 66 psrld $4,%xmm1 67 addl $16,%edx 68.byte 102,15,56,0,193 69 leal 192(%ebp),%ebx 70 pxor %xmm2,%xmm0 71 jmp L000enc_entry 72.align 4,0x90 73L001enc_loop: 74 movdqa 32(%ebp),%xmm4 75 movdqa 48(%ebp),%xmm0 76.byte 102,15,56,0,226 77.byte 102,15,56,0,195 78 pxor %xmm5,%xmm4 79 movdqa 64(%ebp),%xmm5 80 pxor %xmm4,%xmm0 81 movdqa -64(%ebx,%ecx,1),%xmm1 82.byte 102,15,56,0,234 83 movdqa 80(%ebp),%xmm2 84 movdqa (%ebx,%ecx,1),%xmm4 85.byte 102,15,56,0,211 86 movdqa %xmm0,%xmm3 87 pxor %xmm5,%xmm2 88.byte 102,15,56,0,193 89 addl $16,%edx 90 pxor %xmm2,%xmm0 91.byte 102,15,56,0,220 92 addl $16,%ecx 93 pxor %xmm0,%xmm3 94.byte 102,15,56,0,193 95 andl $48,%ecx 96 subl $1,%eax 97 pxor %xmm3,%xmm0 98L000enc_entry: 99 movdqa %xmm6,%xmm1 100 movdqa -32(%ebp),%xmm5 101 pandn %xmm0,%xmm1 102 psrld $4,%xmm1 103 pand %xmm6,%xmm0 104.byte 102,15,56,0,232 105 movdqa %xmm7,%xmm3 106 pxor %xmm1,%xmm0 107.byte 102,15,56,0,217 108 movdqa %xmm7,%xmm4 109 pxor %xmm5,%xmm3 110.byte 102,15,56,0,224 111 movdqa %xmm7,%xmm2 112 pxor %xmm5,%xmm4 113.byte 102,15,56,0,211 114 movdqa %xmm7,%xmm3 115 pxor %xmm0,%xmm2 116.byte 102,15,56,0,220 117 movdqu (%edx),%xmm5 118 pxor %xmm1,%xmm3 119 jnz L001enc_loop 120 movdqa 96(%ebp),%xmm4 121 movdqa 112(%ebp),%xmm0 122.byte 102,15,56,0,226 123 pxor %xmm5,%xmm4 124.byte 102,15,56,0,195 125 movdqa 64(%ebx,%ecx,1),%xmm1 126 pxor %xmm4,%xmm0 127.byte 102,15,56,0,193 128 ret 129.private_extern __vpaes_schedule_core 130.align 4 131__vpaes_schedule_core: 132 addl (%esp),%ebp 133 movdqu (%esi),%xmm0 134 movdqa 320(%ebp),%xmm2 135 movdqa %xmm0,%xmm3 136 leal (%ebp),%ebx 137 movdqa %xmm2,4(%esp) 138 call __vpaes_schedule_transform 139 movdqa %xmm0,%xmm7 140 testl %edi,%edi 141 jnz L002schedule_am_decrypting 142 movdqu %xmm0,(%edx) 143 jmp L003schedule_go 144L002schedule_am_decrypting: 145 movdqa 256(%ebp,%ecx,1),%xmm1 146.byte 102,15,56,0,217 147 movdqu %xmm3,(%edx) 148 xorl $48,%ecx 149L003schedule_go: 150 cmpl $192,%eax 151 ja L004schedule_256 152L005schedule_128: 153 movl $10,%eax 154L006loop_schedule_128: 155 call __vpaes_schedule_round 156 decl %eax 157 jz L007schedule_mangle_last 158 call __vpaes_schedule_mangle 159 jmp L006loop_schedule_128 160.align 4,0x90 161L004schedule_256: 162 movdqu 16(%esi),%xmm0 163 call __vpaes_schedule_transform 164 movl $7,%eax 165L008loop_schedule_256: 166 call __vpaes_schedule_mangle 167 movdqa %xmm0,%xmm6 168 call __vpaes_schedule_round 169 decl %eax 170 jz L007schedule_mangle_last 171 call __vpaes_schedule_mangle 172 pshufd $255,%xmm0,%xmm0 173 movdqa %xmm7,20(%esp) 174 movdqa %xmm6,%xmm7 175 call L_vpaes_schedule_low_round 176 movdqa 20(%esp),%xmm7 177 jmp L008loop_schedule_256 178.align 4,0x90 179L007schedule_mangle_last: 180 leal 384(%ebp),%ebx 181 testl %edi,%edi 182 jnz L009schedule_mangle_last_dec 183 movdqa 256(%ebp,%ecx,1),%xmm1 184.byte 102,15,56,0,193 185 leal 352(%ebp),%ebx 186 addl $32,%edx 187L009schedule_mangle_last_dec: 188 addl $-16,%edx 189 pxor 336(%ebp),%xmm0 190 call __vpaes_schedule_transform 191 movdqu %xmm0,(%edx) 192 pxor %xmm0,%xmm0 193 pxor %xmm1,%xmm1 194 pxor %xmm2,%xmm2 195 pxor %xmm3,%xmm3 196 pxor %xmm4,%xmm4 197 pxor %xmm5,%xmm5 198 pxor %xmm6,%xmm6 199 pxor %xmm7,%xmm7 200 ret 201.private_extern __vpaes_schedule_round 202.align 4 203__vpaes_schedule_round: 204 movdqa 8(%esp),%xmm2 205 pxor %xmm1,%xmm1 206.byte 102,15,58,15,202,15 207.byte 102,15,58,15,210,15 208 pxor %xmm1,%xmm7 209 pshufd $255,%xmm0,%xmm0 210.byte 102,15,58,15,192,1 211 movdqa %xmm2,8(%esp) 212L_vpaes_schedule_low_round: 213 movdqa %xmm7,%xmm1 214 pslldq $4,%xmm7 215 pxor %xmm1,%xmm7 216 movdqa %xmm7,%xmm1 217 pslldq $8,%xmm7 218 pxor %xmm1,%xmm7 219 pxor 336(%ebp),%xmm7 220 movdqa -16(%ebp),%xmm4 221 movdqa -48(%ebp),%xmm5 222 movdqa %xmm4,%xmm1 223 pandn %xmm0,%xmm1 224 psrld $4,%xmm1 225 pand %xmm4,%xmm0 226 movdqa -32(%ebp),%xmm2 227.byte 102,15,56,0,208 228 pxor %xmm1,%xmm0 229 movdqa %xmm5,%xmm3 230.byte 102,15,56,0,217 231 pxor %xmm2,%xmm3 232 movdqa %xmm5,%xmm4 233.byte 102,15,56,0,224 234 pxor %xmm2,%xmm4 235 movdqa %xmm5,%xmm2 236.byte 102,15,56,0,211 237 pxor %xmm0,%xmm2 238 movdqa %xmm5,%xmm3 239.byte 102,15,56,0,220 240 pxor %xmm1,%xmm3 241 movdqa 32(%ebp),%xmm4 242.byte 102,15,56,0,226 243 movdqa 48(%ebp),%xmm0 244.byte 102,15,56,0,195 245 pxor %xmm4,%xmm0 246 pxor %xmm7,%xmm0 247 movdqa %xmm0,%xmm7 248 ret 249.private_extern __vpaes_schedule_transform 250.align 4 251__vpaes_schedule_transform: 252 movdqa -16(%ebp),%xmm2 253 movdqa %xmm2,%xmm1 254 pandn %xmm0,%xmm1 255 psrld $4,%xmm1 256 pand %xmm2,%xmm0 257 movdqa (%ebx),%xmm2 258.byte 102,15,56,0,208 259 movdqa 16(%ebx),%xmm0 260.byte 102,15,56,0,193 261 pxor %xmm2,%xmm0 262 ret 263.private_extern __vpaes_schedule_mangle 264.align 4 265__vpaes_schedule_mangle: 266 movdqa %xmm0,%xmm4 267 movdqa 128(%ebp),%xmm5 268 testl %edi,%edi 269 jnz L010schedule_mangle_dec 270 addl $16,%edx 271 pxor 336(%ebp),%xmm4 272.byte 102,15,56,0,229 273 movdqa %xmm4,%xmm3 274.byte 102,15,56,0,229 275 pxor %xmm4,%xmm3 276.byte 102,15,56,0,229 277 pxor %xmm4,%xmm3 278 jmp L011schedule_mangle_both 279.align 4,0x90 280L010schedule_mangle_dec: 281 movdqa -16(%ebp),%xmm2 282 leal (%ebp),%esi 283 movdqa %xmm2,%xmm1 284 pandn %xmm4,%xmm1 285 psrld $4,%xmm1 286 pand %xmm2,%xmm4 287 movdqa (%esi),%xmm2 288.byte 102,15,56,0,212 289 movdqa 16(%esi),%xmm3 290.byte 102,15,56,0,217 291 pxor %xmm2,%xmm3 292.byte 102,15,56,0,221 293 movdqa 32(%esi),%xmm2 294.byte 102,15,56,0,212 295 pxor %xmm3,%xmm2 296 movdqa 48(%esi),%xmm3 297.byte 102,15,56,0,217 298 pxor %xmm2,%xmm3 299.byte 102,15,56,0,221 300 movdqa 64(%esi),%xmm2 301.byte 102,15,56,0,212 302 pxor %xmm3,%xmm2 303 movdqa 80(%esi),%xmm3 304.byte 102,15,56,0,217 305 pxor %xmm2,%xmm3 306.byte 102,15,56,0,221 307 movdqa 96(%esi),%xmm2 308.byte 102,15,56,0,212 309 pxor %xmm3,%xmm2 310 movdqa 112(%esi),%xmm3 311.byte 102,15,56,0,217 312 pxor %xmm2,%xmm3 313 addl $-16,%edx 314L011schedule_mangle_both: 315 movdqa 256(%ebp,%ecx,1),%xmm1 316.byte 102,15,56,0,217 317 addl $-16,%ecx 318 andl $48,%ecx 319 movdqu %xmm3,(%edx) 320 ret 321.globl _GFp_vpaes_set_encrypt_key 322.private_extern _GFp_vpaes_set_encrypt_key 323.align 4 324_GFp_vpaes_set_encrypt_key: 325L_GFp_vpaes_set_encrypt_key_begin: 326 pushl %ebp 327 pushl %ebx 328 pushl %esi 329 pushl %edi 330 movl 20(%esp),%esi 331 leal -56(%esp),%ebx 332 movl 24(%esp),%eax 333 andl $-16,%ebx 334 movl 28(%esp),%edx 335 xchgl %esp,%ebx 336 movl %ebx,48(%esp) 337 movl %eax,%ebx 338 shrl $5,%ebx 339 addl $5,%ebx 340 movl %ebx,240(%edx) 341 movl $48,%ecx 342 movl $0,%edi 343 leal L_vpaes_consts+0x30-L012pic_point,%ebp 344 call __vpaes_schedule_core 345L012pic_point: 346 movl 48(%esp),%esp 347 xorl %eax,%eax 348 popl %edi 349 popl %esi 350 popl %ebx 351 popl %ebp 352 ret 353.globl _GFp_vpaes_encrypt 354.private_extern _GFp_vpaes_encrypt 355.align 4 356_GFp_vpaes_encrypt: 357L_GFp_vpaes_encrypt_begin: 358 pushl %ebp 359 pushl %ebx 360 pushl %esi 361 pushl %edi 362 leal L_vpaes_consts+0x30-L013pic_point,%ebp 363 call __vpaes_preheat 364L013pic_point: 365 movl 20(%esp),%esi 366 leal -56(%esp),%ebx 367 movl 24(%esp),%edi 368 andl $-16,%ebx 369 movl 28(%esp),%edx 370 xchgl %esp,%ebx 371 movl %ebx,48(%esp) 372 movdqu (%esi),%xmm0 373 call __vpaes_encrypt_core 374 movdqu %xmm0,(%edi) 375 movl 48(%esp),%esp 376 popl %edi 377 popl %esi 378 popl %ebx 379 popl %ebp 380 ret 381#endif 382