OLD | NEW |
(Empty) | |
| 1 #if defined(__i386__) |
| 2 .file "vpaes-x86.S" |
| 3 .text |
| 4 .align 64 |
| 5 .L_vpaes_consts: |
| 6 .long 218628480,235210255,168496130,67568393 |
| 7 .long 252381056,17041926,33884169,51187212 |
| 8 .long 252645135,252645135,252645135,252645135 |
| 9 .long 1512730624,3266504856,1377990664,3401244816 |
| 10 .long 830229760,1275146365,2969422977,3447763452 |
| 11 .long 3411033600,2979783055,338359620,2782886510 |
| 12 .long 4209124096,907596821,221174255,1006095553 |
| 13 .long 191964160,3799684038,3164090317,1589111125 |
| 14 .long 182528256,1777043520,2877432650,3265356744 |
| 15 .long 1874708224,3503451415,3305285752,363511674 |
| 16 .long 1606117888,3487855781,1093350906,2384367825 |
| 17 .long 197121,67569157,134941193,202313229 |
| 18 .long 67569157,134941193,202313229,197121 |
| 19 .long 134941193,202313229,197121,67569157 |
| 20 .long 202313229,197121,67569157,134941193 |
| 21 .long 33619971,100992007,168364043,235736079 |
| 22 .long 235736079,33619971,100992007,168364043 |
| 23 .long 168364043,235736079,33619971,100992007 |
| 24 .long 100992007,168364043,235736079,33619971 |
| 25 .long 50462976,117835012,185207048,252579084 |
| 26 .long 252314880,51251460,117574920,184942860 |
| 27 .long 184682752,252054788,50987272,118359308 |
| 28 .long 118099200,185467140,251790600,50727180 |
| 29 .long 2946363062,528716217,1300004225,1881839624 |
| 30 .long 1532713819,1532713819,1532713819,1532713819 |
| 31 .long 3602276352,4288629033,3737020424,4153884961 |
| 32 .long 1354558464,32357713,2958822624,3775749553 |
| 33 .long 1201988352,132424512,1572796698,503232858 |
| 34 .long 2213177600,1597421020,4103937655,675398315 |
| 35 .long 2749646592,4273543773,1511898873,121693092 |
| 36 .long 3040248576,1103263732,2871565598,1608280554 |
| 37 .long 2236667136,2588920351,482954393,64377734 |
| 38 .long 3069987328,291237287,2117370568,3650299247 |
| 39 .long 533321216,3573750986,2572112006,1401264716 |
| 40 .long 1339849704,2721158661,548607111,3445553514 |
| 41 .long 2128193280,3054596040,2183486460,1257083700 |
| 42 .long 655635200,1165381986,3923443150,2344132524 |
| 43 .long 190078720,256924420,290342170,357187870 |
| 44 .long 1610966272,2263057382,4103205268,309794674 |
| 45 .long 2592527872,2233205587,1335446729,3402964816 |
| 46 .long 3973531904,3225098121,3002836325,1918774430 |
| 47 .long 3870401024,2102906079,2284471353,4117666579 |
| 48 .long 617007872,1021508343,366931923,691083277 |
| 49 .long 2528395776,3491914898,2968704004,1613121270 |
| 50 .long 3445188352,3247741094,844474987,4093578302 |
| 51 .long 651481088,1190302358,1689581232,574775300 |
| 52 .long 4289380608,206939853,2555985458,2489840491 |
| 53 .long 2130264064,327674451,3566485037,3349835193 |
| 54 .long 2470714624,316102159,3636825756,3393945945 |
| 55 .byte 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105 |
| 56 .byte 111,110,32,65,69,83,32,102,111,114,32,120,56,54,47,83 |
| 57 .byte 83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117 |
| 58 .byte 114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105 |
| 59 .byte 118,101,114,115,105,116,121,41,0 |
| 60 .align 64 |
| 61 .type _vpaes_preheat,@function |
| 62 .align 16 |
| 63 _vpaes_preheat: |
| 64 addl (%esp),%ebp |
| 65 movdqa -48(%ebp),%xmm7 |
| 66 movdqa -16(%ebp),%xmm6 |
| 67 ret |
| 68 .size _vpaes_preheat,.-_vpaes_preheat |
| 69 .type _vpaes_encrypt_core,@function |
| 70 .align 16 |
| 71 _vpaes_encrypt_core: |
| 72 movl $16,%ecx |
| 73 movl 240(%edx),%eax |
| 74 movdqa %xmm6,%xmm1 |
| 75 movdqa (%ebp),%xmm2 |
| 76 pandn %xmm0,%xmm1 |
| 77 pand %xmm6,%xmm0 |
| 78 movdqu (%edx),%xmm5 |
| 79 .byte 102,15,56,0,208 |
| 80 movdqa 16(%ebp),%xmm0 |
| 81 pxor %xmm5,%xmm2 |
| 82 psrld $4,%xmm1 |
| 83 addl $16,%edx |
| 84 .byte 102,15,56,0,193 |
| 85 leal 192(%ebp),%ebx |
| 86 pxor %xmm2,%xmm0 |
| 87 jmp .L000enc_entry |
| 88 .align 16 |
| 89 .L001enc_loop: |
| 90 movdqa 32(%ebp),%xmm4 |
| 91 movdqa 48(%ebp),%xmm0 |
| 92 .byte 102,15,56,0,226 |
| 93 .byte 102,15,56,0,195 |
| 94 pxor %xmm5,%xmm4 |
| 95 movdqa 64(%ebp),%xmm5 |
| 96 pxor %xmm4,%xmm0 |
| 97 movdqa -64(%ebx,%ecx,1),%xmm1 |
| 98 .byte 102,15,56,0,234 |
| 99 movdqa 80(%ebp),%xmm2 |
| 100 movdqa (%ebx,%ecx,1),%xmm4 |
| 101 .byte 102,15,56,0,211 |
| 102 movdqa %xmm0,%xmm3 |
| 103 pxor %xmm5,%xmm2 |
| 104 .byte 102,15,56,0,193 |
| 105 addl $16,%edx |
| 106 pxor %xmm2,%xmm0 |
| 107 .byte 102,15,56,0,220 |
| 108 addl $16,%ecx |
| 109 pxor %xmm0,%xmm3 |
| 110 .byte 102,15,56,0,193 |
| 111 andl $48,%ecx |
| 112 subl $1,%eax |
| 113 pxor %xmm3,%xmm0 |
| 114 .L000enc_entry: |
| 115 movdqa %xmm6,%xmm1 |
| 116 movdqa -32(%ebp),%xmm5 |
| 117 pandn %xmm0,%xmm1 |
| 118 psrld $4,%xmm1 |
| 119 pand %xmm6,%xmm0 |
| 120 .byte 102,15,56,0,232 |
| 121 movdqa %xmm7,%xmm3 |
| 122 pxor %xmm1,%xmm0 |
| 123 .byte 102,15,56,0,217 |
| 124 movdqa %xmm7,%xmm4 |
| 125 pxor %xmm5,%xmm3 |
| 126 .byte 102,15,56,0,224 |
| 127 movdqa %xmm7,%xmm2 |
| 128 pxor %xmm5,%xmm4 |
| 129 .byte 102,15,56,0,211 |
| 130 movdqa %xmm7,%xmm3 |
| 131 pxor %xmm0,%xmm2 |
| 132 .byte 102,15,56,0,220 |
| 133 movdqu (%edx),%xmm5 |
| 134 pxor %xmm1,%xmm3 |
| 135 jnz .L001enc_loop |
| 136 movdqa 96(%ebp),%xmm4 |
| 137 movdqa 112(%ebp),%xmm0 |
| 138 .byte 102,15,56,0,226 |
| 139 pxor %xmm5,%xmm4 |
| 140 .byte 102,15,56,0,195 |
| 141 movdqa 64(%ebx,%ecx,1),%xmm1 |
| 142 pxor %xmm4,%xmm0 |
| 143 .byte 102,15,56,0,193 |
| 144 ret |
| 145 .size _vpaes_encrypt_core,.-_vpaes_encrypt_core |
| 146 .type _vpaes_decrypt_core,@function |
| 147 .align 16 |
| 148 _vpaes_decrypt_core: |
| 149 leal 608(%ebp),%ebx |
| 150 movl 240(%edx),%eax |
| 151 movdqa %xmm6,%xmm1 |
| 152 movdqa -64(%ebx),%xmm2 |
| 153 pandn %xmm0,%xmm1 |
| 154 movl %eax,%ecx |
| 155 psrld $4,%xmm1 |
| 156 movdqu (%edx),%xmm5 |
| 157 shll $4,%ecx |
| 158 pand %xmm6,%xmm0 |
| 159 .byte 102,15,56,0,208 |
| 160 movdqa -48(%ebx),%xmm0 |
| 161 xorl $48,%ecx |
| 162 .byte 102,15,56,0,193 |
| 163 andl $48,%ecx |
| 164 pxor %xmm5,%xmm2 |
| 165 movdqa 176(%ebp),%xmm5 |
| 166 pxor %xmm2,%xmm0 |
| 167 addl $16,%edx |
| 168 leal -352(%ebx,%ecx,1),%ecx |
| 169 jmp .L002dec_entry |
| 170 .align 16 |
| 171 .L003dec_loop: |
| 172 movdqa -32(%ebx),%xmm4 |
| 173 movdqa -16(%ebx),%xmm1 |
| 174 .byte 102,15,56,0,226 |
| 175 .byte 102,15,56,0,203 |
| 176 pxor %xmm4,%xmm0 |
| 177 movdqa (%ebx),%xmm4 |
| 178 pxor %xmm1,%xmm0 |
| 179 movdqa 16(%ebx),%xmm1 |
| 180 .byte 102,15,56,0,226 |
| 181 .byte 102,15,56,0,197 |
| 182 .byte 102,15,56,0,203 |
| 183 pxor %xmm4,%xmm0 |
| 184 movdqa 32(%ebx),%xmm4 |
| 185 pxor %xmm1,%xmm0 |
| 186 movdqa 48(%ebx),%xmm1 |
| 187 .byte 102,15,56,0,226 |
| 188 .byte 102,15,56,0,197 |
| 189 .byte 102,15,56,0,203 |
| 190 pxor %xmm4,%xmm0 |
| 191 movdqa 64(%ebx),%xmm4 |
| 192 pxor %xmm1,%xmm0 |
| 193 movdqa 80(%ebx),%xmm1 |
| 194 .byte 102,15,56,0,226 |
| 195 .byte 102,15,56,0,197 |
| 196 .byte 102,15,56,0,203 |
| 197 pxor %xmm4,%xmm0 |
| 198 addl $16,%edx |
| 199 .byte 102,15,58,15,237,12 |
| 200 pxor %xmm1,%xmm0 |
| 201 subl $1,%eax |
| 202 .L002dec_entry: |
| 203 movdqa %xmm6,%xmm1 |
| 204 movdqa -32(%ebp),%xmm2 |
| 205 pandn %xmm0,%xmm1 |
| 206 pand %xmm6,%xmm0 |
| 207 psrld $4,%xmm1 |
| 208 .byte 102,15,56,0,208 |
| 209 movdqa %xmm7,%xmm3 |
| 210 pxor %xmm1,%xmm0 |
| 211 .byte 102,15,56,0,217 |
| 212 movdqa %xmm7,%xmm4 |
| 213 pxor %xmm2,%xmm3 |
| 214 .byte 102,15,56,0,224 |
| 215 pxor %xmm2,%xmm4 |
| 216 movdqa %xmm7,%xmm2 |
| 217 .byte 102,15,56,0,211 |
| 218 movdqa %xmm7,%xmm3 |
| 219 pxor %xmm0,%xmm2 |
| 220 .byte 102,15,56,0,220 |
| 221 movdqu (%edx),%xmm0 |
| 222 pxor %xmm1,%xmm3 |
| 223 jnz .L003dec_loop |
| 224 movdqa 96(%ebx),%xmm4 |
| 225 .byte 102,15,56,0,226 |
| 226 pxor %xmm0,%xmm4 |
| 227 movdqa 112(%ebx),%xmm0 |
| 228 movdqa (%ecx),%xmm2 |
| 229 .byte 102,15,56,0,195 |
| 230 pxor %xmm4,%xmm0 |
| 231 .byte 102,15,56,0,194 |
| 232 ret |
| 233 .size _vpaes_decrypt_core,.-_vpaes_decrypt_core |
| 234 .type _vpaes_schedule_core,@function |
| 235 .align 16 |
| 236 _vpaes_schedule_core: |
| 237 addl (%esp),%ebp |
| 238 movdqu (%esi),%xmm0 |
| 239 movdqa 320(%ebp),%xmm2 |
| 240 movdqa %xmm0,%xmm3 |
| 241 leal (%ebp),%ebx |
| 242 movdqa %xmm2,4(%esp) |
| 243 call _vpaes_schedule_transform |
| 244 movdqa %xmm0,%xmm7 |
| 245 testl %edi,%edi |
| 246 jnz .L004schedule_am_decrypting |
| 247 movdqu %xmm0,(%edx) |
| 248 jmp .L005schedule_go |
| 249 .L004schedule_am_decrypting: |
| 250 movdqa 256(%ebp,%ecx,1),%xmm1 |
| 251 .byte 102,15,56,0,217 |
| 252 movdqu %xmm3,(%edx) |
| 253 xorl $48,%ecx |
| 254 .L005schedule_go: |
| 255 cmpl $192,%eax |
| 256 ja .L006schedule_256 |
| 257 je .L007schedule_192 |
| 258 .L008schedule_128: |
| 259 movl $10,%eax |
| 260 .L009loop_schedule_128: |
| 261 call _vpaes_schedule_round |
| 262 decl %eax |
| 263 jz .L010schedule_mangle_last |
| 264 call _vpaes_schedule_mangle |
| 265 jmp .L009loop_schedule_128 |
| 266 .align 16 |
| 267 .L007schedule_192: |
| 268 movdqu 8(%esi),%xmm0 |
| 269 call _vpaes_schedule_transform |
| 270 movdqa %xmm0,%xmm6 |
| 271 pxor %xmm4,%xmm4 |
| 272 movhlps %xmm4,%xmm6 |
| 273 movl $4,%eax |
| 274 .L011loop_schedule_192: |
| 275 call _vpaes_schedule_round |
| 276 .byte 102,15,58,15,198,8 |
| 277 call _vpaes_schedule_mangle |
| 278 call _vpaes_schedule_192_smear |
| 279 call _vpaes_schedule_mangle |
| 280 call _vpaes_schedule_round |
| 281 decl %eax |
| 282 jz .L010schedule_mangle_last |
| 283 call _vpaes_schedule_mangle |
| 284 call _vpaes_schedule_192_smear |
| 285 jmp .L011loop_schedule_192 |
| 286 .align 16 |
| 287 .L006schedule_256: |
| 288 movdqu 16(%esi),%xmm0 |
| 289 call _vpaes_schedule_transform |
| 290 movl $7,%eax |
| 291 .L012loop_schedule_256: |
| 292 call _vpaes_schedule_mangle |
| 293 movdqa %xmm0,%xmm6 |
| 294 call _vpaes_schedule_round |
| 295 decl %eax |
| 296 jz .L010schedule_mangle_last |
| 297 call _vpaes_schedule_mangle |
| 298 pshufd $255,%xmm0,%xmm0 |
| 299 movdqa %xmm7,20(%esp) |
| 300 movdqa %xmm6,%xmm7 |
| 301 call .L_vpaes_schedule_low_round |
| 302 movdqa 20(%esp),%xmm7 |
| 303 jmp .L012loop_schedule_256 |
| 304 .align 16 |
| 305 .L010schedule_mangle_last: |
| 306 leal 384(%ebp),%ebx |
| 307 testl %edi,%edi |
| 308 jnz .L013schedule_mangle_last_dec |
| 309 movdqa 256(%ebp,%ecx,1),%xmm1 |
| 310 .byte 102,15,56,0,193 |
| 311 leal 352(%ebp),%ebx |
| 312 addl $32,%edx |
| 313 .L013schedule_mangle_last_dec: |
| 314 addl $-16,%edx |
| 315 pxor 336(%ebp),%xmm0 |
| 316 call _vpaes_schedule_transform |
| 317 movdqu %xmm0,(%edx) |
| 318 pxor %xmm0,%xmm0 |
| 319 pxor %xmm1,%xmm1 |
| 320 pxor %xmm2,%xmm2 |
| 321 pxor %xmm3,%xmm3 |
| 322 pxor %xmm4,%xmm4 |
| 323 pxor %xmm5,%xmm5 |
| 324 pxor %xmm6,%xmm6 |
| 325 pxor %xmm7,%xmm7 |
| 326 ret |
| 327 .size _vpaes_schedule_core,.-_vpaes_schedule_core |
| 328 .type _vpaes_schedule_192_smear,@function |
| 329 .align 16 |
| 330 _vpaes_schedule_192_smear: |
| 331 pshufd $128,%xmm6,%xmm1 |
| 332 pshufd $254,%xmm7,%xmm0 |
| 333 pxor %xmm1,%xmm6 |
| 334 pxor %xmm1,%xmm1 |
| 335 pxor %xmm0,%xmm6 |
| 336 movdqa %xmm6,%xmm0 |
| 337 movhlps %xmm1,%xmm6 |
| 338 ret |
| 339 .size _vpaes_schedule_192_smear,.-_vpaes_schedule_192_smear |
| 340 .type _vpaes_schedule_round,@function |
| 341 .align 16 |
| 342 _vpaes_schedule_round: |
| 343 movdqa 8(%esp),%xmm2 |
| 344 pxor %xmm1,%xmm1 |
| 345 .byte 102,15,58,15,202,15 |
| 346 .byte 102,15,58,15,210,15 |
| 347 pxor %xmm1,%xmm7 |
| 348 pshufd $255,%xmm0,%xmm0 |
| 349 .byte 102,15,58,15,192,1 |
| 350 movdqa %xmm2,8(%esp) |
| 351 .L_vpaes_schedule_low_round: |
| 352 movdqa %xmm7,%xmm1 |
| 353 pslldq $4,%xmm7 |
| 354 pxor %xmm1,%xmm7 |
| 355 movdqa %xmm7,%xmm1 |
| 356 pslldq $8,%xmm7 |
| 357 pxor %xmm1,%xmm7 |
| 358 pxor 336(%ebp),%xmm7 |
| 359 movdqa -16(%ebp),%xmm4 |
| 360 movdqa -48(%ebp),%xmm5 |
| 361 movdqa %xmm4,%xmm1 |
| 362 pandn %xmm0,%xmm1 |
| 363 psrld $4,%xmm1 |
| 364 pand %xmm4,%xmm0 |
| 365 movdqa -32(%ebp),%xmm2 |
| 366 .byte 102,15,56,0,208 |
| 367 pxor %xmm1,%xmm0 |
| 368 movdqa %xmm5,%xmm3 |
| 369 .byte 102,15,56,0,217 |
| 370 pxor %xmm2,%xmm3 |
| 371 movdqa %xmm5,%xmm4 |
| 372 .byte 102,15,56,0,224 |
| 373 pxor %xmm2,%xmm4 |
| 374 movdqa %xmm5,%xmm2 |
| 375 .byte 102,15,56,0,211 |
| 376 pxor %xmm0,%xmm2 |
| 377 movdqa %xmm5,%xmm3 |
| 378 .byte 102,15,56,0,220 |
| 379 pxor %xmm1,%xmm3 |
| 380 movdqa 32(%ebp),%xmm4 |
| 381 .byte 102,15,56,0,226 |
| 382 movdqa 48(%ebp),%xmm0 |
| 383 .byte 102,15,56,0,195 |
| 384 pxor %xmm4,%xmm0 |
| 385 pxor %xmm7,%xmm0 |
| 386 movdqa %xmm0,%xmm7 |
| 387 ret |
| 388 .size _vpaes_schedule_round,.-_vpaes_schedule_round |
| 389 .type _vpaes_schedule_transform,@function |
| 390 .align 16 |
| 391 _vpaes_schedule_transform: |
| 392 movdqa -16(%ebp),%xmm2 |
| 393 movdqa %xmm2,%xmm1 |
| 394 pandn %xmm0,%xmm1 |
| 395 psrld $4,%xmm1 |
| 396 pand %xmm2,%xmm0 |
| 397 movdqa (%ebx),%xmm2 |
| 398 .byte 102,15,56,0,208 |
| 399 movdqa 16(%ebx),%xmm0 |
| 400 .byte 102,15,56,0,193 |
| 401 pxor %xmm2,%xmm0 |
| 402 ret |
| 403 .size _vpaes_schedule_transform,.-_vpaes_schedule_transform |
| 404 .type _vpaes_schedule_mangle,@function |
| 405 .align 16 |
| 406 _vpaes_schedule_mangle: |
| 407 movdqa %xmm0,%xmm4 |
| 408 movdqa 128(%ebp),%xmm5 |
| 409 testl %edi,%edi |
| 410 jnz .L014schedule_mangle_dec |
| 411 addl $16,%edx |
| 412 pxor 336(%ebp),%xmm4 |
| 413 .byte 102,15,56,0,229 |
| 414 movdqa %xmm4,%xmm3 |
| 415 .byte 102,15,56,0,229 |
| 416 pxor %xmm4,%xmm3 |
| 417 .byte 102,15,56,0,229 |
| 418 pxor %xmm4,%xmm3 |
| 419 jmp .L015schedule_mangle_both |
| 420 .align 16 |
| 421 .L014schedule_mangle_dec: |
| 422 movdqa -16(%ebp),%xmm2 |
| 423 leal 416(%ebp),%esi |
| 424 movdqa %xmm2,%xmm1 |
| 425 pandn %xmm4,%xmm1 |
| 426 psrld $4,%xmm1 |
| 427 pand %xmm2,%xmm4 |
| 428 movdqa (%esi),%xmm2 |
| 429 .byte 102,15,56,0,212 |
| 430 movdqa 16(%esi),%xmm3 |
| 431 .byte 102,15,56,0,217 |
| 432 pxor %xmm2,%xmm3 |
| 433 .byte 102,15,56,0,221 |
| 434 movdqa 32(%esi),%xmm2 |
| 435 .byte 102,15,56,0,212 |
| 436 pxor %xmm3,%xmm2 |
| 437 movdqa 48(%esi),%xmm3 |
| 438 .byte 102,15,56,0,217 |
| 439 pxor %xmm2,%xmm3 |
| 440 .byte 102,15,56,0,221 |
| 441 movdqa 64(%esi),%xmm2 |
| 442 .byte 102,15,56,0,212 |
| 443 pxor %xmm3,%xmm2 |
| 444 movdqa 80(%esi),%xmm3 |
| 445 .byte 102,15,56,0,217 |
| 446 pxor %xmm2,%xmm3 |
| 447 .byte 102,15,56,0,221 |
| 448 movdqa 96(%esi),%xmm2 |
| 449 .byte 102,15,56,0,212 |
| 450 pxor %xmm3,%xmm2 |
| 451 movdqa 112(%esi),%xmm3 |
| 452 .byte 102,15,56,0,217 |
| 453 pxor %xmm2,%xmm3 |
| 454 addl $-16,%edx |
| 455 .L015schedule_mangle_both: |
| 456 movdqa 256(%ebp,%ecx,1),%xmm1 |
| 457 .byte 102,15,56,0,217 |
| 458 addl $-16,%ecx |
| 459 andl $48,%ecx |
| 460 movdqu %xmm3,(%edx) |
| 461 ret |
| 462 .size _vpaes_schedule_mangle,.-_vpaes_schedule_mangle |
| 463 .globl vpaes_set_encrypt_key |
| 464 .type vpaes_set_encrypt_key,@function |
| 465 .align 16 |
| 466 vpaes_set_encrypt_key: |
| 467 .L_vpaes_set_encrypt_key_begin: |
| 468 pushl %ebp |
| 469 pushl %ebx |
| 470 pushl %esi |
| 471 pushl %edi |
| 472 movl 20(%esp),%esi |
| 473 leal -56(%esp),%ebx |
| 474 movl 24(%esp),%eax |
| 475 andl $-16,%ebx |
| 476 movl 28(%esp),%edx |
| 477 xchgl %esp,%ebx |
| 478 movl %ebx,48(%esp) |
| 479 movl %eax,%ebx |
| 480 shrl $5,%ebx |
| 481 addl $5,%ebx |
| 482 movl %ebx,240(%edx) |
| 483 movl $48,%ecx |
| 484 movl $0,%edi |
| 485 leal .L_vpaes_consts+0x30-.L016pic_point,%ebp |
| 486 call _vpaes_schedule_core |
| 487 .L016pic_point: |
| 488 movl 48(%esp),%esp |
| 489 xorl %eax,%eax |
| 490 popl %edi |
| 491 popl %esi |
| 492 popl %ebx |
| 493 popl %ebp |
| 494 ret |
| 495 .size vpaes_set_encrypt_key,.-.L_vpaes_set_encrypt_key_begin |
| 496 .globl vpaes_set_decrypt_key |
| 497 .type vpaes_set_decrypt_key,@function |
| 498 .align 16 |
| 499 vpaes_set_decrypt_key: |
| 500 .L_vpaes_set_decrypt_key_begin: |
| 501 pushl %ebp |
| 502 pushl %ebx |
| 503 pushl %esi |
| 504 pushl %edi |
| 505 movl 20(%esp),%esi |
| 506 leal -56(%esp),%ebx |
| 507 movl 24(%esp),%eax |
| 508 andl $-16,%ebx |
| 509 movl 28(%esp),%edx |
| 510 xchgl %esp,%ebx |
| 511 movl %ebx,48(%esp) |
| 512 movl %eax,%ebx |
| 513 shrl $5,%ebx |
| 514 addl $5,%ebx |
| 515 movl %ebx,240(%edx) |
| 516 shll $4,%ebx |
| 517 leal 16(%edx,%ebx,1),%edx |
| 518 movl $1,%edi |
| 519 movl %eax,%ecx |
| 520 shrl $1,%ecx |
| 521 andl $32,%ecx |
| 522 xorl $32,%ecx |
| 523 leal .L_vpaes_consts+0x30-.L017pic_point,%ebp |
| 524 call _vpaes_schedule_core |
| 525 .L017pic_point: |
| 526 movl 48(%esp),%esp |
| 527 xorl %eax,%eax |
| 528 popl %edi |
| 529 popl %esi |
| 530 popl %ebx |
| 531 popl %ebp |
| 532 ret |
| 533 .size vpaes_set_decrypt_key,.-.L_vpaes_set_decrypt_key_begin |
| 534 .globl vpaes_encrypt |
| 535 .type vpaes_encrypt,@function |
| 536 .align 16 |
| 537 vpaes_encrypt: |
| 538 .L_vpaes_encrypt_begin: |
| 539 pushl %ebp |
| 540 pushl %ebx |
| 541 pushl %esi |
| 542 pushl %edi |
| 543 leal .L_vpaes_consts+0x30-.L018pic_point,%ebp |
| 544 call _vpaes_preheat |
| 545 .L018pic_point: |
| 546 movl 20(%esp),%esi |
| 547 leal -56(%esp),%ebx |
| 548 movl 24(%esp),%edi |
| 549 andl $-16,%ebx |
| 550 movl 28(%esp),%edx |
| 551 xchgl %esp,%ebx |
| 552 movl %ebx,48(%esp) |
| 553 movdqu (%esi),%xmm0 |
| 554 call _vpaes_encrypt_core |
| 555 movdqu %xmm0,(%edi) |
| 556 movl 48(%esp),%esp |
| 557 popl %edi |
| 558 popl %esi |
| 559 popl %ebx |
| 560 popl %ebp |
| 561 ret |
| 562 .size vpaes_encrypt,.-.L_vpaes_encrypt_begin |
| 563 .globl vpaes_decrypt |
| 564 .type vpaes_decrypt,@function |
| 565 .align 16 |
| 566 vpaes_decrypt: |
| 567 .L_vpaes_decrypt_begin: |
| 568 pushl %ebp |
| 569 pushl %ebx |
| 570 pushl %esi |
| 571 pushl %edi |
| 572 leal .L_vpaes_consts+0x30-.L019pic_point,%ebp |
| 573 call _vpaes_preheat |
| 574 .L019pic_point: |
| 575 movl 20(%esp),%esi |
| 576 leal -56(%esp),%ebx |
| 577 movl 24(%esp),%edi |
| 578 andl $-16,%ebx |
| 579 movl 28(%esp),%edx |
| 580 xchgl %esp,%ebx |
| 581 movl %ebx,48(%esp) |
| 582 movdqu (%esi),%xmm0 |
| 583 call _vpaes_decrypt_core |
| 584 movdqu %xmm0,(%edi) |
| 585 movl 48(%esp),%esp |
| 586 popl %edi |
| 587 popl %esi |
| 588 popl %ebx |
| 589 popl %ebp |
| 590 ret |
| 591 .size vpaes_decrypt,.-.L_vpaes_decrypt_begin |
| 592 .globl vpaes_cbc_encrypt |
| 593 .type vpaes_cbc_encrypt,@function |
| 594 .align 16 |
| 595 vpaes_cbc_encrypt: |
| 596 .L_vpaes_cbc_encrypt_begin: |
| 597 pushl %ebp |
| 598 pushl %ebx |
| 599 pushl %esi |
| 600 pushl %edi |
| 601 movl 20(%esp),%esi |
| 602 movl 24(%esp),%edi |
| 603 movl 28(%esp),%eax |
| 604 movl 32(%esp),%edx |
| 605 subl $16,%eax |
| 606 jc .L020cbc_abort |
| 607 leal -56(%esp),%ebx |
| 608 movl 36(%esp),%ebp |
| 609 andl $-16,%ebx |
| 610 movl 40(%esp),%ecx |
| 611 xchgl %esp,%ebx |
| 612 movdqu (%ebp),%xmm1 |
| 613 subl %esi,%edi |
| 614 movl %ebx,48(%esp) |
| 615 movl %edi,(%esp) |
| 616 movl %edx,4(%esp) |
| 617 movl %ebp,8(%esp) |
| 618 movl %eax,%edi |
| 619 leal .L_vpaes_consts+0x30-.L021pic_point,%ebp |
| 620 call _vpaes_preheat |
| 621 .L021pic_point: |
| 622 cmpl $0,%ecx |
| 623 je .L022cbc_dec_loop |
| 624 jmp .L023cbc_enc_loop |
| 625 .align 16 |
| 626 .L023cbc_enc_loop: |
| 627 movdqu (%esi),%xmm0 |
| 628 pxor %xmm1,%xmm0 |
| 629 call _vpaes_encrypt_core |
| 630 movl (%esp),%ebx |
| 631 movl 4(%esp),%edx |
| 632 movdqa %xmm0,%xmm1 |
| 633 movdqu %xmm0,(%ebx,%esi,1) |
| 634 leal 16(%esi),%esi |
| 635 subl $16,%edi |
| 636 jnc .L023cbc_enc_loop |
| 637 jmp .L024cbc_done |
| 638 .align 16 |
| 639 .L022cbc_dec_loop: |
| 640 movdqu (%esi),%xmm0 |
| 641 movdqa %xmm1,16(%esp) |
| 642 movdqa %xmm0,32(%esp) |
| 643 call _vpaes_decrypt_core |
| 644 movl (%esp),%ebx |
| 645 movl 4(%esp),%edx |
| 646 pxor 16(%esp),%xmm0 |
| 647 movdqa 32(%esp),%xmm1 |
| 648 movdqu %xmm0,(%ebx,%esi,1) |
| 649 leal 16(%esi),%esi |
| 650 subl $16,%edi |
| 651 jnc .L022cbc_dec_loop |
| 652 .L024cbc_done: |
| 653 movl 8(%esp),%ebx |
| 654 movl 48(%esp),%esp |
| 655 movdqu %xmm1,(%ebx) |
| 656 .L020cbc_abort: |
| 657 popl %edi |
| 658 popl %esi |
| 659 popl %ebx |
| 660 popl %ebp |
| 661 ret |
| 662 .size vpaes_cbc_encrypt,.-.L_vpaes_cbc_encrypt_begin |
| 663 #endif |
OLD | NEW |