Workaround for xkbcommon dead keys.
[chromium-blink-merge.git] / third_party / boringssl / win-x86 / crypto / aes / aesni-x86.asm
blob845bb35fdbf774eacac02785f960fabad60e7749
1 %ifidn __OUTPUT_FORMAT__,obj
2 section code use32 class=code align=64
3 %elifidn __OUTPUT_FORMAT__,win32
4 %ifdef __YASM_VERSION_ID__
5 %if __YASM_VERSION_ID__ < 01010000h
6 %error yasm version 1.1.0 or later needed.
7 %endif
8 ; Yasm automatically includes .00 and complains about redefining it.
9 ; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
10 %else
11 $@feat.00 equ 1
12 %endif
13 section .text code align=64
14 %else
15 section .text code
16 %endif
17 global _aesni_encrypt
18 align 16
19 _aesni_encrypt:
20 L$_aesni_encrypt_begin:
21 mov eax,DWORD [4+esp]
22 mov edx,DWORD [12+esp]
23 movups xmm2,[eax]
24 mov ecx,DWORD [240+edx]
25 mov eax,DWORD [8+esp]
26 movups xmm0,[edx]
27 movups xmm1,[16+edx]
28 lea edx,[32+edx]
29 xorps xmm2,xmm0
30 L$000enc1_loop_1:
31 db 102,15,56,220,209
32 dec ecx
33 movups xmm1,[edx]
34 lea edx,[16+edx]
35 jnz NEAR L$000enc1_loop_1
36 db 102,15,56,221,209
37 movups [eax],xmm2
38 ret
39 global _aesni_decrypt
40 align 16
41 _aesni_decrypt:
42 L$_aesni_decrypt_begin:
43 mov eax,DWORD [4+esp]
44 mov edx,DWORD [12+esp]
45 movups xmm2,[eax]
46 mov ecx,DWORD [240+edx]
47 mov eax,DWORD [8+esp]
48 movups xmm0,[edx]
49 movups xmm1,[16+edx]
50 lea edx,[32+edx]
51 xorps xmm2,xmm0
52 L$001dec1_loop_2:
53 db 102,15,56,222,209
54 dec ecx
55 movups xmm1,[edx]
56 lea edx,[16+edx]
57 jnz NEAR L$001dec1_loop_2
58 db 102,15,56,223,209
59 movups [eax],xmm2
60 ret
61 align 16
62 __aesni_encrypt2:
63 movups xmm0,[edx]
64 shl ecx,4
65 movups xmm1,[16+edx]
66 xorps xmm2,xmm0
67 pxor xmm3,xmm0
68 movups xmm0,[32+edx]
69 lea edx,[32+ecx*1+edx]
70 neg ecx
71 add ecx,16
72 L$002enc2_loop:
73 db 102,15,56,220,209
74 db 102,15,56,220,217
75 movups xmm1,[ecx*1+edx]
76 add ecx,32
77 db 102,15,56,220,208
78 db 102,15,56,220,216
79 movups xmm0,[ecx*1+edx-16]
80 jnz NEAR L$002enc2_loop
81 db 102,15,56,220,209
82 db 102,15,56,220,217
83 db 102,15,56,221,208
84 db 102,15,56,221,216
85 ret
86 align 16
87 __aesni_decrypt2:
88 movups xmm0,[edx]
89 shl ecx,4
90 movups xmm1,[16+edx]
91 xorps xmm2,xmm0
92 pxor xmm3,xmm0
93 movups xmm0,[32+edx]
94 lea edx,[32+ecx*1+edx]
95 neg ecx
96 add ecx,16
97 L$003dec2_loop:
98 db 102,15,56,222,209
99 db 102,15,56,222,217
100 movups xmm1,[ecx*1+edx]
101 add ecx,32
102 db 102,15,56,222,208
103 db 102,15,56,222,216
104 movups xmm0,[ecx*1+edx-16]
105 jnz NEAR L$003dec2_loop
106 db 102,15,56,222,209
107 db 102,15,56,222,217
108 db 102,15,56,223,208
109 db 102,15,56,223,216
111 align 16
112 __aesni_encrypt3:
113 movups xmm0,[edx]
114 shl ecx,4
115 movups xmm1,[16+edx]
116 xorps xmm2,xmm0
117 pxor xmm3,xmm0
118 pxor xmm4,xmm0
119 movups xmm0,[32+edx]
120 lea edx,[32+ecx*1+edx]
121 neg ecx
122 add ecx,16
123 L$004enc3_loop:
124 db 102,15,56,220,209
125 db 102,15,56,220,217
126 db 102,15,56,220,225
127 movups xmm1,[ecx*1+edx]
128 add ecx,32
129 db 102,15,56,220,208
130 db 102,15,56,220,216
131 db 102,15,56,220,224
132 movups xmm0,[ecx*1+edx-16]
133 jnz NEAR L$004enc3_loop
134 db 102,15,56,220,209
135 db 102,15,56,220,217
136 db 102,15,56,220,225
137 db 102,15,56,221,208
138 db 102,15,56,221,216
139 db 102,15,56,221,224
141 align 16
142 __aesni_decrypt3:
143 movups xmm0,[edx]
144 shl ecx,4
145 movups xmm1,[16+edx]
146 xorps xmm2,xmm0
147 pxor xmm3,xmm0
148 pxor xmm4,xmm0
149 movups xmm0,[32+edx]
150 lea edx,[32+ecx*1+edx]
151 neg ecx
152 add ecx,16
153 L$005dec3_loop:
154 db 102,15,56,222,209
155 db 102,15,56,222,217
156 db 102,15,56,222,225
157 movups xmm1,[ecx*1+edx]
158 add ecx,32
159 db 102,15,56,222,208
160 db 102,15,56,222,216
161 db 102,15,56,222,224
162 movups xmm0,[ecx*1+edx-16]
163 jnz NEAR L$005dec3_loop
164 db 102,15,56,222,209
165 db 102,15,56,222,217
166 db 102,15,56,222,225
167 db 102,15,56,223,208
168 db 102,15,56,223,216
169 db 102,15,56,223,224
171 align 16
172 __aesni_encrypt4:
173 movups xmm0,[edx]
174 movups xmm1,[16+edx]
175 shl ecx,4
176 xorps xmm2,xmm0
177 pxor xmm3,xmm0
178 pxor xmm4,xmm0
179 pxor xmm5,xmm0
180 movups xmm0,[32+edx]
181 lea edx,[32+ecx*1+edx]
182 neg ecx
183 db 15,31,64,0
184 add ecx,16
185 L$006enc4_loop:
186 db 102,15,56,220,209
187 db 102,15,56,220,217
188 db 102,15,56,220,225
189 db 102,15,56,220,233
190 movups xmm1,[ecx*1+edx]
191 add ecx,32
192 db 102,15,56,220,208
193 db 102,15,56,220,216
194 db 102,15,56,220,224
195 db 102,15,56,220,232
196 movups xmm0,[ecx*1+edx-16]
197 jnz NEAR L$006enc4_loop
198 db 102,15,56,220,209
199 db 102,15,56,220,217
200 db 102,15,56,220,225
201 db 102,15,56,220,233
202 db 102,15,56,221,208
203 db 102,15,56,221,216
204 db 102,15,56,221,224
205 db 102,15,56,221,232
207 align 16
208 __aesni_decrypt4:
209 movups xmm0,[edx]
210 movups xmm1,[16+edx]
211 shl ecx,4
212 xorps xmm2,xmm0
213 pxor xmm3,xmm0
214 pxor xmm4,xmm0
215 pxor xmm5,xmm0
216 movups xmm0,[32+edx]
217 lea edx,[32+ecx*1+edx]
218 neg ecx
219 db 15,31,64,0
220 add ecx,16
221 L$007dec4_loop:
222 db 102,15,56,222,209
223 db 102,15,56,222,217
224 db 102,15,56,222,225
225 db 102,15,56,222,233
226 movups xmm1,[ecx*1+edx]
227 add ecx,32
228 db 102,15,56,222,208
229 db 102,15,56,222,216
230 db 102,15,56,222,224
231 db 102,15,56,222,232
232 movups xmm0,[ecx*1+edx-16]
233 jnz NEAR L$007dec4_loop
234 db 102,15,56,222,209
235 db 102,15,56,222,217
236 db 102,15,56,222,225
237 db 102,15,56,222,233
238 db 102,15,56,223,208
239 db 102,15,56,223,216
240 db 102,15,56,223,224
241 db 102,15,56,223,232
243 align 16
244 __aesni_encrypt6:
245 movups xmm0,[edx]
246 shl ecx,4
247 movups xmm1,[16+edx]
248 xorps xmm2,xmm0
249 pxor xmm3,xmm0
250 pxor xmm4,xmm0
251 db 102,15,56,220,209
252 pxor xmm5,xmm0
253 pxor xmm6,xmm0
254 db 102,15,56,220,217
255 lea edx,[32+ecx*1+edx]
256 neg ecx
257 db 102,15,56,220,225
258 pxor xmm7,xmm0
259 add ecx,16
260 db 102,15,56,220,233
261 db 102,15,56,220,241
262 db 102,15,56,220,249
263 movups xmm0,[ecx*1+edx-16]
264 jmp NEAR L$_aesni_encrypt6_enter
265 align 16
266 L$008enc6_loop:
267 db 102,15,56,220,209
268 db 102,15,56,220,217
269 db 102,15,56,220,225
270 db 102,15,56,220,233
271 db 102,15,56,220,241
272 db 102,15,56,220,249
273 L$_aesni_encrypt6_enter:
274 movups xmm1,[ecx*1+edx]
275 add ecx,32
276 db 102,15,56,220,208
277 db 102,15,56,220,216
278 db 102,15,56,220,224
279 db 102,15,56,220,232
280 db 102,15,56,220,240
281 db 102,15,56,220,248
282 movups xmm0,[ecx*1+edx-16]
283 jnz NEAR L$008enc6_loop
284 db 102,15,56,220,209
285 db 102,15,56,220,217
286 db 102,15,56,220,225
287 db 102,15,56,220,233
288 db 102,15,56,220,241
289 db 102,15,56,220,249
290 db 102,15,56,221,208
291 db 102,15,56,221,216
292 db 102,15,56,221,224
293 db 102,15,56,221,232
294 db 102,15,56,221,240
295 db 102,15,56,221,248
297 align 16
298 __aesni_decrypt6:
299 movups xmm0,[edx]
300 shl ecx,4
301 movups xmm1,[16+edx]
302 xorps xmm2,xmm0
303 pxor xmm3,xmm0
304 pxor xmm4,xmm0
305 db 102,15,56,222,209
306 pxor xmm5,xmm0
307 pxor xmm6,xmm0
308 db 102,15,56,222,217
309 lea edx,[32+ecx*1+edx]
310 neg ecx
311 db 102,15,56,222,225
312 pxor xmm7,xmm0
313 add ecx,16
314 db 102,15,56,222,233
315 db 102,15,56,222,241
316 db 102,15,56,222,249
317 movups xmm0,[ecx*1+edx-16]
318 jmp NEAR L$_aesni_decrypt6_enter
319 align 16
320 L$009dec6_loop:
321 db 102,15,56,222,209
322 db 102,15,56,222,217
323 db 102,15,56,222,225
324 db 102,15,56,222,233
325 db 102,15,56,222,241
326 db 102,15,56,222,249
327 L$_aesni_decrypt6_enter:
328 movups xmm1,[ecx*1+edx]
329 add ecx,32
330 db 102,15,56,222,208
331 db 102,15,56,222,216
332 db 102,15,56,222,224
333 db 102,15,56,222,232
334 db 102,15,56,222,240
335 db 102,15,56,222,248
336 movups xmm0,[ecx*1+edx-16]
337 jnz NEAR L$009dec6_loop
338 db 102,15,56,222,209
339 db 102,15,56,222,217
340 db 102,15,56,222,225
341 db 102,15,56,222,233
342 db 102,15,56,222,241
343 db 102,15,56,222,249
344 db 102,15,56,223,208
345 db 102,15,56,223,216
346 db 102,15,56,223,224
347 db 102,15,56,223,232
348 db 102,15,56,223,240
349 db 102,15,56,223,248
351 global _aesni_ecb_encrypt
352 align 16
353 _aesni_ecb_encrypt:
354 L$_aesni_ecb_encrypt_begin:
355 push ebp
356 push ebx
357 push esi
358 push edi
359 mov esi,DWORD [20+esp]
360 mov edi,DWORD [24+esp]
361 mov eax,DWORD [28+esp]
362 mov edx,DWORD [32+esp]
363 mov ebx,DWORD [36+esp]
364 and eax,-16
365 jz NEAR L$010ecb_ret
366 mov ecx,DWORD [240+edx]
367 test ebx,ebx
368 jz NEAR L$011ecb_decrypt
369 mov ebp,edx
370 mov ebx,ecx
371 cmp eax,96
372 jb NEAR L$012ecb_enc_tail
373 movdqu xmm2,[esi]
374 movdqu xmm3,[16+esi]
375 movdqu xmm4,[32+esi]
376 movdqu xmm5,[48+esi]
377 movdqu xmm6,[64+esi]
378 movdqu xmm7,[80+esi]
379 lea esi,[96+esi]
380 sub eax,96
381 jmp NEAR L$013ecb_enc_loop6_enter
382 align 16
383 L$014ecb_enc_loop6:
384 movups [edi],xmm2
385 movdqu xmm2,[esi]
386 movups [16+edi],xmm3
387 movdqu xmm3,[16+esi]
388 movups [32+edi],xmm4
389 movdqu xmm4,[32+esi]
390 movups [48+edi],xmm5
391 movdqu xmm5,[48+esi]
392 movups [64+edi],xmm6
393 movdqu xmm6,[64+esi]
394 movups [80+edi],xmm7
395 lea edi,[96+edi]
396 movdqu xmm7,[80+esi]
397 lea esi,[96+esi]
398 L$013ecb_enc_loop6_enter:
399 call __aesni_encrypt6
400 mov edx,ebp
401 mov ecx,ebx
402 sub eax,96
403 jnc NEAR L$014ecb_enc_loop6
404 movups [edi],xmm2
405 movups [16+edi],xmm3
406 movups [32+edi],xmm4
407 movups [48+edi],xmm5
408 movups [64+edi],xmm6
409 movups [80+edi],xmm7
410 lea edi,[96+edi]
411 add eax,96
412 jz NEAR L$010ecb_ret
413 L$012ecb_enc_tail:
414 movups xmm2,[esi]
415 cmp eax,32
416 jb NEAR L$015ecb_enc_one
417 movups xmm3,[16+esi]
418 je NEAR L$016ecb_enc_two
419 movups xmm4,[32+esi]
420 cmp eax,64
421 jb NEAR L$017ecb_enc_three
422 movups xmm5,[48+esi]
423 je NEAR L$018ecb_enc_four
424 movups xmm6,[64+esi]
425 xorps xmm7,xmm7
426 call __aesni_encrypt6
427 movups [edi],xmm2
428 movups [16+edi],xmm3
429 movups [32+edi],xmm4
430 movups [48+edi],xmm5
431 movups [64+edi],xmm6
432 jmp NEAR L$010ecb_ret
433 align 16
434 L$015ecb_enc_one:
435 movups xmm0,[edx]
436 movups xmm1,[16+edx]
437 lea edx,[32+edx]
438 xorps xmm2,xmm0
439 L$019enc1_loop_3:
440 db 102,15,56,220,209
441 dec ecx
442 movups xmm1,[edx]
443 lea edx,[16+edx]
444 jnz NEAR L$019enc1_loop_3
445 db 102,15,56,221,209
446 movups [edi],xmm2
447 jmp NEAR L$010ecb_ret
448 align 16
449 L$016ecb_enc_two:
450 call __aesni_encrypt2
451 movups [edi],xmm2
452 movups [16+edi],xmm3
453 jmp NEAR L$010ecb_ret
454 align 16
455 L$017ecb_enc_three:
456 call __aesni_encrypt3
457 movups [edi],xmm2
458 movups [16+edi],xmm3
459 movups [32+edi],xmm4
460 jmp NEAR L$010ecb_ret
461 align 16
462 L$018ecb_enc_four:
463 call __aesni_encrypt4
464 movups [edi],xmm2
465 movups [16+edi],xmm3
466 movups [32+edi],xmm4
467 movups [48+edi],xmm5
468 jmp NEAR L$010ecb_ret
469 align 16
470 L$011ecb_decrypt:
471 mov ebp,edx
472 mov ebx,ecx
473 cmp eax,96
474 jb NEAR L$020ecb_dec_tail
475 movdqu xmm2,[esi]
476 movdqu xmm3,[16+esi]
477 movdqu xmm4,[32+esi]
478 movdqu xmm5,[48+esi]
479 movdqu xmm6,[64+esi]
480 movdqu xmm7,[80+esi]
481 lea esi,[96+esi]
482 sub eax,96
483 jmp NEAR L$021ecb_dec_loop6_enter
484 align 16
485 L$022ecb_dec_loop6:
486 movups [edi],xmm2
487 movdqu xmm2,[esi]
488 movups [16+edi],xmm3
489 movdqu xmm3,[16+esi]
490 movups [32+edi],xmm4
491 movdqu xmm4,[32+esi]
492 movups [48+edi],xmm5
493 movdqu xmm5,[48+esi]
494 movups [64+edi],xmm6
495 movdqu xmm6,[64+esi]
496 movups [80+edi],xmm7
497 lea edi,[96+edi]
498 movdqu xmm7,[80+esi]
499 lea esi,[96+esi]
500 L$021ecb_dec_loop6_enter:
501 call __aesni_decrypt6
502 mov edx,ebp
503 mov ecx,ebx
504 sub eax,96
505 jnc NEAR L$022ecb_dec_loop6
506 movups [edi],xmm2
507 movups [16+edi],xmm3
508 movups [32+edi],xmm4
509 movups [48+edi],xmm5
510 movups [64+edi],xmm6
511 movups [80+edi],xmm7
512 lea edi,[96+edi]
513 add eax,96
514 jz NEAR L$010ecb_ret
515 L$020ecb_dec_tail:
516 movups xmm2,[esi]
517 cmp eax,32
518 jb NEAR L$023ecb_dec_one
519 movups xmm3,[16+esi]
520 je NEAR L$024ecb_dec_two
521 movups xmm4,[32+esi]
522 cmp eax,64
523 jb NEAR L$025ecb_dec_three
524 movups xmm5,[48+esi]
525 je NEAR L$026ecb_dec_four
526 movups xmm6,[64+esi]
527 xorps xmm7,xmm7
528 call __aesni_decrypt6
529 movups [edi],xmm2
530 movups [16+edi],xmm3
531 movups [32+edi],xmm4
532 movups [48+edi],xmm5
533 movups [64+edi],xmm6
534 jmp NEAR L$010ecb_ret
535 align 16
536 L$023ecb_dec_one:
537 movups xmm0,[edx]
538 movups xmm1,[16+edx]
539 lea edx,[32+edx]
540 xorps xmm2,xmm0
541 L$027dec1_loop_4:
542 db 102,15,56,222,209
543 dec ecx
544 movups xmm1,[edx]
545 lea edx,[16+edx]
546 jnz NEAR L$027dec1_loop_4
547 db 102,15,56,223,209
548 movups [edi],xmm2
549 jmp NEAR L$010ecb_ret
550 align 16
551 L$024ecb_dec_two:
552 call __aesni_decrypt2
553 movups [edi],xmm2
554 movups [16+edi],xmm3
555 jmp NEAR L$010ecb_ret
556 align 16
557 L$025ecb_dec_three:
558 call __aesni_decrypt3
559 movups [edi],xmm2
560 movups [16+edi],xmm3
561 movups [32+edi],xmm4
562 jmp NEAR L$010ecb_ret
563 align 16
564 L$026ecb_dec_four:
565 call __aesni_decrypt4
566 movups [edi],xmm2
567 movups [16+edi],xmm3
568 movups [32+edi],xmm4
569 movups [48+edi],xmm5
570 L$010ecb_ret:
571 pop edi
572 pop esi
573 pop ebx
574 pop ebp
576 global _aesni_ccm64_encrypt_blocks
577 align 16
578 _aesni_ccm64_encrypt_blocks:
579 L$_aesni_ccm64_encrypt_blocks_begin:
580 push ebp
581 push ebx
582 push esi
583 push edi
584 mov esi,DWORD [20+esp]
585 mov edi,DWORD [24+esp]
586 mov eax,DWORD [28+esp]
587 mov edx,DWORD [32+esp]
588 mov ebx,DWORD [36+esp]
589 mov ecx,DWORD [40+esp]
590 mov ebp,esp
591 sub esp,60
592 and esp,-16
593 mov DWORD [48+esp],ebp
594 movdqu xmm7,[ebx]
595 movdqu xmm3,[ecx]
596 mov ecx,DWORD [240+edx]
597 mov DWORD [esp],202182159
598 mov DWORD [4+esp],134810123
599 mov DWORD [8+esp],67438087
600 mov DWORD [12+esp],66051
601 mov ebx,1
602 xor ebp,ebp
603 mov DWORD [16+esp],ebx
604 mov DWORD [20+esp],ebp
605 mov DWORD [24+esp],ebp
606 mov DWORD [28+esp],ebp
607 shl ecx,4
608 mov ebx,16
609 lea ebp,[edx]
610 movdqa xmm5,[esp]
611 movdqa xmm2,xmm7
612 lea edx,[32+ecx*1+edx]
613 sub ebx,ecx
614 db 102,15,56,0,253
615 L$028ccm64_enc_outer:
616 movups xmm0,[ebp]
617 mov ecx,ebx
618 movups xmm6,[esi]
619 xorps xmm2,xmm0
620 movups xmm1,[16+ebp]
621 xorps xmm0,xmm6
622 xorps xmm3,xmm0
623 movups xmm0,[32+ebp]
624 L$029ccm64_enc2_loop:
625 db 102,15,56,220,209
626 db 102,15,56,220,217
627 movups xmm1,[ecx*1+edx]
628 add ecx,32
629 db 102,15,56,220,208
630 db 102,15,56,220,216
631 movups xmm0,[ecx*1+edx-16]
632 jnz NEAR L$029ccm64_enc2_loop
633 db 102,15,56,220,209
634 db 102,15,56,220,217
635 paddq xmm7,[16+esp]
636 dec eax
637 db 102,15,56,221,208
638 db 102,15,56,221,216
639 lea esi,[16+esi]
640 xorps xmm6,xmm2
641 movdqa xmm2,xmm7
642 movups [edi],xmm6
643 db 102,15,56,0,213
644 lea edi,[16+edi]
645 jnz NEAR L$028ccm64_enc_outer
646 mov esp,DWORD [48+esp]
647 mov edi,DWORD [40+esp]
648 movups [edi],xmm3
649 pop edi
650 pop esi
651 pop ebx
652 pop ebp
654 global _aesni_ccm64_decrypt_blocks
655 align 16
656 _aesni_ccm64_decrypt_blocks:
657 L$_aesni_ccm64_decrypt_blocks_begin:
658 push ebp
659 push ebx
660 push esi
661 push edi
662 mov esi,DWORD [20+esp]
663 mov edi,DWORD [24+esp]
664 mov eax,DWORD [28+esp]
665 mov edx,DWORD [32+esp]
666 mov ebx,DWORD [36+esp]
667 mov ecx,DWORD [40+esp]
668 mov ebp,esp
669 sub esp,60
670 and esp,-16
671 mov DWORD [48+esp],ebp
672 movdqu xmm7,[ebx]
673 movdqu xmm3,[ecx]
674 mov ecx,DWORD [240+edx]
675 mov DWORD [esp],202182159
676 mov DWORD [4+esp],134810123
677 mov DWORD [8+esp],67438087
678 mov DWORD [12+esp],66051
679 mov ebx,1
680 xor ebp,ebp
681 mov DWORD [16+esp],ebx
682 mov DWORD [20+esp],ebp
683 mov DWORD [24+esp],ebp
684 mov DWORD [28+esp],ebp
685 movdqa xmm5,[esp]
686 movdqa xmm2,xmm7
687 mov ebp,edx
688 mov ebx,ecx
689 db 102,15,56,0,253
690 movups xmm0,[edx]
691 movups xmm1,[16+edx]
692 lea edx,[32+edx]
693 xorps xmm2,xmm0
694 L$030enc1_loop_5:
695 db 102,15,56,220,209
696 dec ecx
697 movups xmm1,[edx]
698 lea edx,[16+edx]
699 jnz NEAR L$030enc1_loop_5
700 db 102,15,56,221,209
701 shl ebx,4
702 mov ecx,16
703 movups xmm6,[esi]
704 paddq xmm7,[16+esp]
705 lea esi,[16+esi]
706 sub ecx,ebx
707 lea edx,[32+ebx*1+ebp]
708 mov ebx,ecx
709 jmp NEAR L$031ccm64_dec_outer
710 align 16
711 L$031ccm64_dec_outer:
712 xorps xmm6,xmm2
713 movdqa xmm2,xmm7
714 movups [edi],xmm6
715 lea edi,[16+edi]
716 db 102,15,56,0,213
717 sub eax,1
718 jz NEAR L$032ccm64_dec_break
719 movups xmm0,[ebp]
720 mov ecx,ebx
721 movups xmm1,[16+ebp]
722 xorps xmm6,xmm0
723 xorps xmm2,xmm0
724 xorps xmm3,xmm6
725 movups xmm0,[32+ebp]
726 L$033ccm64_dec2_loop:
727 db 102,15,56,220,209
728 db 102,15,56,220,217
729 movups xmm1,[ecx*1+edx]
730 add ecx,32
731 db 102,15,56,220,208
732 db 102,15,56,220,216
733 movups xmm0,[ecx*1+edx-16]
734 jnz NEAR L$033ccm64_dec2_loop
735 movups xmm6,[esi]
736 paddq xmm7,[16+esp]
737 db 102,15,56,220,209
738 db 102,15,56,220,217
739 db 102,15,56,221,208
740 db 102,15,56,221,216
741 lea esi,[16+esi]
742 jmp NEAR L$031ccm64_dec_outer
743 align 16
744 L$032ccm64_dec_break:
745 mov ecx,DWORD [240+ebp]
746 mov edx,ebp
747 movups xmm0,[edx]
748 movups xmm1,[16+edx]
749 xorps xmm6,xmm0
750 lea edx,[32+edx]
751 xorps xmm3,xmm6
752 L$034enc1_loop_6:
753 db 102,15,56,220,217
754 dec ecx
755 movups xmm1,[edx]
756 lea edx,[16+edx]
757 jnz NEAR L$034enc1_loop_6
758 db 102,15,56,221,217
759 mov esp,DWORD [48+esp]
760 mov edi,DWORD [40+esp]
761 movups [edi],xmm3
762 pop edi
763 pop esi
764 pop ebx
765 pop ebp
767 global _aesni_ctr32_encrypt_blocks
768 align 16
769 _aesni_ctr32_encrypt_blocks:
770 L$_aesni_ctr32_encrypt_blocks_begin:
771 push ebp
772 push ebx
773 push esi
774 push edi
775 mov esi,DWORD [20+esp]
776 mov edi,DWORD [24+esp]
777 mov eax,DWORD [28+esp]
778 mov edx,DWORD [32+esp]
779 mov ebx,DWORD [36+esp]
780 mov ebp,esp
781 sub esp,88
782 and esp,-16
783 mov DWORD [80+esp],ebp
784 cmp eax,1
785 je NEAR L$035ctr32_one_shortcut
786 movdqu xmm7,[ebx]
787 mov DWORD [esp],202182159
788 mov DWORD [4+esp],134810123
789 mov DWORD [8+esp],67438087
790 mov DWORD [12+esp],66051
791 mov ecx,6
792 xor ebp,ebp
793 mov DWORD [16+esp],ecx
794 mov DWORD [20+esp],ecx
795 mov DWORD [24+esp],ecx
796 mov DWORD [28+esp],ebp
797 db 102,15,58,22,251,3
798 db 102,15,58,34,253,3
799 mov ecx,DWORD [240+edx]
800 bswap ebx
801 pxor xmm0,xmm0
802 pxor xmm1,xmm1
803 movdqa xmm2,[esp]
804 db 102,15,58,34,195,0
805 lea ebp,[3+ebx]
806 db 102,15,58,34,205,0
807 inc ebx
808 db 102,15,58,34,195,1
809 inc ebp
810 db 102,15,58,34,205,1
811 inc ebx
812 db 102,15,58,34,195,2
813 inc ebp
814 db 102,15,58,34,205,2
815 movdqa [48+esp],xmm0
816 db 102,15,56,0,194
817 movdqu xmm6,[edx]
818 movdqa [64+esp],xmm1
819 db 102,15,56,0,202
820 pshufd xmm2,xmm0,192
821 pshufd xmm3,xmm0,128
822 cmp eax,6
823 jb NEAR L$036ctr32_tail
824 pxor xmm7,xmm6
825 shl ecx,4
826 mov ebx,16
827 movdqa [32+esp],xmm7
828 mov ebp,edx
829 sub ebx,ecx
830 lea edx,[32+ecx*1+edx]
831 sub eax,6
832 jmp NEAR L$037ctr32_loop6
833 align 16
834 L$037ctr32_loop6:
835 pshufd xmm4,xmm0,64
836 movdqa xmm0,[32+esp]
837 pshufd xmm5,xmm1,192
838 pxor xmm2,xmm0
839 pshufd xmm6,xmm1,128
840 pxor xmm3,xmm0
841 pshufd xmm7,xmm1,64
842 movups xmm1,[16+ebp]
843 pxor xmm4,xmm0
844 pxor xmm5,xmm0
845 db 102,15,56,220,209
846 pxor xmm6,xmm0
847 pxor xmm7,xmm0
848 db 102,15,56,220,217
849 movups xmm0,[32+ebp]
850 mov ecx,ebx
851 db 102,15,56,220,225
852 db 102,15,56,220,233
853 db 102,15,56,220,241
854 db 102,15,56,220,249
855 call L$_aesni_encrypt6_enter
856 movups xmm1,[esi]
857 movups xmm0,[16+esi]
858 xorps xmm2,xmm1
859 movups xmm1,[32+esi]
860 xorps xmm3,xmm0
861 movups [edi],xmm2
862 movdqa xmm0,[16+esp]
863 xorps xmm4,xmm1
864 movdqa xmm1,[64+esp]
865 movups [16+edi],xmm3
866 movups [32+edi],xmm4
867 paddd xmm1,xmm0
868 paddd xmm0,[48+esp]
869 movdqa xmm2,[esp]
870 movups xmm3,[48+esi]
871 movups xmm4,[64+esi]
872 xorps xmm5,xmm3
873 movups xmm3,[80+esi]
874 lea esi,[96+esi]
875 movdqa [48+esp],xmm0
876 db 102,15,56,0,194
877 xorps xmm6,xmm4
878 movups [48+edi],xmm5
879 xorps xmm7,xmm3
880 movdqa [64+esp],xmm1
881 db 102,15,56,0,202
882 movups [64+edi],xmm6
883 pshufd xmm2,xmm0,192
884 movups [80+edi],xmm7
885 lea edi,[96+edi]
886 pshufd xmm3,xmm0,128
887 sub eax,6
888 jnc NEAR L$037ctr32_loop6
889 add eax,6
890 jz NEAR L$038ctr32_ret
891 movdqu xmm7,[ebp]
892 mov edx,ebp
893 pxor xmm7,[32+esp]
894 mov ecx,DWORD [240+ebp]
895 L$036ctr32_tail:
896 por xmm2,xmm7
897 cmp eax,2
898 jb NEAR L$039ctr32_one
899 pshufd xmm4,xmm0,64
900 por xmm3,xmm7
901 je NEAR L$040ctr32_two
902 pshufd xmm5,xmm1,192
903 por xmm4,xmm7
904 cmp eax,4
905 jb NEAR L$041ctr32_three
906 pshufd xmm6,xmm1,128
907 por xmm5,xmm7
908 je NEAR L$042ctr32_four
909 por xmm6,xmm7
910 call __aesni_encrypt6
911 movups xmm1,[esi]
912 movups xmm0,[16+esi]
913 xorps xmm2,xmm1
914 movups xmm1,[32+esi]
915 xorps xmm3,xmm0
916 movups xmm0,[48+esi]
917 xorps xmm4,xmm1
918 movups xmm1,[64+esi]
919 xorps xmm5,xmm0
920 movups [edi],xmm2
921 xorps xmm6,xmm1
922 movups [16+edi],xmm3
923 movups [32+edi],xmm4
924 movups [48+edi],xmm5
925 movups [64+edi],xmm6
926 jmp NEAR L$038ctr32_ret
927 align 16
928 L$035ctr32_one_shortcut:
929 movups xmm2,[ebx]
930 mov ecx,DWORD [240+edx]
931 L$039ctr32_one:
932 movups xmm0,[edx]
933 movups xmm1,[16+edx]
934 lea edx,[32+edx]
935 xorps xmm2,xmm0
936 L$043enc1_loop_7:
937 db 102,15,56,220,209
938 dec ecx
939 movups xmm1,[edx]
940 lea edx,[16+edx]
941 jnz NEAR L$043enc1_loop_7
942 db 102,15,56,221,209
943 movups xmm6,[esi]
944 xorps xmm6,xmm2
945 movups [edi],xmm6
946 jmp NEAR L$038ctr32_ret
947 align 16
948 L$040ctr32_two:
949 call __aesni_encrypt2
950 movups xmm5,[esi]
951 movups xmm6,[16+esi]
952 xorps xmm2,xmm5
953 xorps xmm3,xmm6
954 movups [edi],xmm2
955 movups [16+edi],xmm3
956 jmp NEAR L$038ctr32_ret
957 align 16
958 L$041ctr32_three:
959 call __aesni_encrypt3
960 movups xmm5,[esi]
961 movups xmm6,[16+esi]
962 xorps xmm2,xmm5
963 movups xmm7,[32+esi]
964 xorps xmm3,xmm6
965 movups [edi],xmm2
966 xorps xmm4,xmm7
967 movups [16+edi],xmm3
968 movups [32+edi],xmm4
969 jmp NEAR L$038ctr32_ret
970 align 16
971 L$042ctr32_four:
972 call __aesni_encrypt4
973 movups xmm6,[esi]
974 movups xmm7,[16+esi]
975 movups xmm1,[32+esi]
976 xorps xmm2,xmm6
977 movups xmm0,[48+esi]
978 xorps xmm3,xmm7
979 movups [edi],xmm2
980 xorps xmm4,xmm1
981 movups [16+edi],xmm3
982 xorps xmm5,xmm0
983 movups [32+edi],xmm4
984 movups [48+edi],xmm5
985 L$038ctr32_ret:
986 mov esp,DWORD [80+esp]
987 pop edi
988 pop esi
989 pop ebx
990 pop ebp
992 global _aesni_xts_encrypt
993 align 16
994 _aesni_xts_encrypt:
995 L$_aesni_xts_encrypt_begin:
996 push ebp
997 push ebx
998 push esi
999 push edi
1000 mov edx,DWORD [36+esp]
1001 mov esi,DWORD [40+esp]
1002 mov ecx,DWORD [240+edx]
1003 movups xmm2,[esi]
1004 movups xmm0,[edx]
1005 movups xmm1,[16+edx]
1006 lea edx,[32+edx]
1007 xorps xmm2,xmm0
1008 L$044enc1_loop_8:
1009 db 102,15,56,220,209
1010 dec ecx
1011 movups xmm1,[edx]
1012 lea edx,[16+edx]
1013 jnz NEAR L$044enc1_loop_8
1014 db 102,15,56,221,209
1015 mov esi,DWORD [20+esp]
1016 mov edi,DWORD [24+esp]
1017 mov eax,DWORD [28+esp]
1018 mov edx,DWORD [32+esp]
1019 mov ebp,esp
1020 sub esp,120
1021 mov ecx,DWORD [240+edx]
1022 and esp,-16
1023 mov DWORD [96+esp],135
1024 mov DWORD [100+esp],0
1025 mov DWORD [104+esp],1
1026 mov DWORD [108+esp],0
1027 mov DWORD [112+esp],eax
1028 mov DWORD [116+esp],ebp
1029 movdqa xmm1,xmm2
1030 pxor xmm0,xmm0
1031 movdqa xmm3,[96+esp]
1032 pcmpgtd xmm0,xmm1
1033 and eax,-16
1034 mov ebp,edx
1035 mov ebx,ecx
1036 sub eax,96
1037 jc NEAR L$045xts_enc_short
1038 shl ecx,4
1039 mov ebx,16
1040 sub ebx,ecx
1041 lea edx,[32+ecx*1+edx]
1042 jmp NEAR L$046xts_enc_loop6
1043 align 16
1044 L$046xts_enc_loop6:
1045 pshufd xmm2,xmm0,19
1046 pxor xmm0,xmm0
1047 movdqa [esp],xmm1
1048 paddq xmm1,xmm1
1049 pand xmm2,xmm3
1050 pcmpgtd xmm0,xmm1
1051 pxor xmm1,xmm2
1052 pshufd xmm2,xmm0,19
1053 pxor xmm0,xmm0
1054 movdqa [16+esp],xmm1
1055 paddq xmm1,xmm1
1056 pand xmm2,xmm3
1057 pcmpgtd xmm0,xmm1
1058 pxor xmm1,xmm2
1059 pshufd xmm2,xmm0,19
1060 pxor xmm0,xmm0
1061 movdqa [32+esp],xmm1
1062 paddq xmm1,xmm1
1063 pand xmm2,xmm3
1064 pcmpgtd xmm0,xmm1
1065 pxor xmm1,xmm2
1066 pshufd xmm2,xmm0,19
1067 pxor xmm0,xmm0
1068 movdqa [48+esp],xmm1
1069 paddq xmm1,xmm1
1070 pand xmm2,xmm3
1071 pcmpgtd xmm0,xmm1
1072 pxor xmm1,xmm2
1073 pshufd xmm7,xmm0,19
1074 movdqa [64+esp],xmm1
1075 paddq xmm1,xmm1
1076 movups xmm0,[ebp]
1077 pand xmm7,xmm3
1078 movups xmm2,[esi]
1079 pxor xmm7,xmm1
1080 mov ecx,ebx
1081 movdqu xmm3,[16+esi]
1082 xorps xmm2,xmm0
1083 movdqu xmm4,[32+esi]
1084 pxor xmm3,xmm0
1085 movdqu xmm5,[48+esi]
1086 pxor xmm4,xmm0
1087 movdqu xmm6,[64+esi]
1088 pxor xmm5,xmm0
1089 movdqu xmm1,[80+esi]
1090 pxor xmm6,xmm0
1091 lea esi,[96+esi]
1092 pxor xmm2,[esp]
1093 movdqa [80+esp],xmm7
1094 pxor xmm7,xmm1
1095 movups xmm1,[16+ebp]
1096 pxor xmm3,[16+esp]
1097 pxor xmm4,[32+esp]
1098 db 102,15,56,220,209
1099 pxor xmm5,[48+esp]
1100 pxor xmm6,[64+esp]
1101 db 102,15,56,220,217
1102 pxor xmm7,xmm0
1103 movups xmm0,[32+ebp]
1104 db 102,15,56,220,225
1105 db 102,15,56,220,233
1106 db 102,15,56,220,241
1107 db 102,15,56,220,249
1108 call L$_aesni_encrypt6_enter
1109 movdqa xmm1,[80+esp]
1110 pxor xmm0,xmm0
1111 xorps xmm2,[esp]
1112 pcmpgtd xmm0,xmm1
1113 xorps xmm3,[16+esp]
1114 movups [edi],xmm2
1115 xorps xmm4,[32+esp]
1116 movups [16+edi],xmm3
1117 xorps xmm5,[48+esp]
1118 movups [32+edi],xmm4
1119 xorps xmm6,[64+esp]
1120 movups [48+edi],xmm5
1121 xorps xmm7,xmm1
1122 movups [64+edi],xmm6
1123 pshufd xmm2,xmm0,19
1124 movups [80+edi],xmm7
1125 lea edi,[96+edi]
1126 movdqa xmm3,[96+esp]
1127 pxor xmm0,xmm0
1128 paddq xmm1,xmm1
1129 pand xmm2,xmm3
1130 pcmpgtd xmm0,xmm1
1131 pxor xmm1,xmm2
1132 sub eax,96
1133 jnc NEAR L$046xts_enc_loop6
1134 mov ecx,DWORD [240+ebp]
1135 mov edx,ebp
1136 mov ebx,ecx
1137 L$045xts_enc_short:
1138 add eax,96
1139 jz NEAR L$047xts_enc_done6x
1140 movdqa xmm5,xmm1
1141 cmp eax,32
1142 jb NEAR L$048xts_enc_one
1143 pshufd xmm2,xmm0,19
1144 pxor xmm0,xmm0
1145 paddq xmm1,xmm1
1146 pand xmm2,xmm3
1147 pcmpgtd xmm0,xmm1
1148 pxor xmm1,xmm2
1149 je NEAR L$049xts_enc_two
1150 pshufd xmm2,xmm0,19
1151 pxor xmm0,xmm0
1152 movdqa xmm6,xmm1
1153 paddq xmm1,xmm1
1154 pand xmm2,xmm3
1155 pcmpgtd xmm0,xmm1
1156 pxor xmm1,xmm2
1157 cmp eax,64
1158 jb NEAR L$050xts_enc_three
1159 pshufd xmm2,xmm0,19
1160 pxor xmm0,xmm0
1161 movdqa xmm7,xmm1
1162 paddq xmm1,xmm1
1163 pand xmm2,xmm3
1164 pcmpgtd xmm0,xmm1
1165 pxor xmm1,xmm2
1166 movdqa [esp],xmm5
1167 movdqa [16+esp],xmm6
1168 je NEAR L$051xts_enc_four
1169 movdqa [32+esp],xmm7
1170 pshufd xmm7,xmm0,19
1171 movdqa [48+esp],xmm1
1172 paddq xmm1,xmm1
1173 pand xmm7,xmm3
1174 pxor xmm7,xmm1
1175 movdqu xmm2,[esi]
1176 movdqu xmm3,[16+esi]
1177 movdqu xmm4,[32+esi]
1178 pxor xmm2,[esp]
1179 movdqu xmm5,[48+esi]
1180 pxor xmm3,[16+esp]
1181 movdqu xmm6,[64+esi]
1182 pxor xmm4,[32+esp]
1183 lea esi,[80+esi]
1184 pxor xmm5,[48+esp]
1185 movdqa [64+esp],xmm7
1186 pxor xmm6,xmm7
1187 call __aesni_encrypt6
1188 movaps xmm1,[64+esp]
1189 xorps xmm2,[esp]
1190 xorps xmm3,[16+esp]
1191 xorps xmm4,[32+esp]
1192 movups [edi],xmm2
1193 xorps xmm5,[48+esp]
1194 movups [16+edi],xmm3
1195 xorps xmm6,xmm1
1196 movups [32+edi],xmm4
1197 movups [48+edi],xmm5
1198 movups [64+edi],xmm6
1199 lea edi,[80+edi]
1200 jmp NEAR L$052xts_enc_done
1201 align 16
1202 L$048xts_enc_one:
1203 movups xmm2,[esi]
1204 lea esi,[16+esi]
1205 xorps xmm2,xmm5
1206 movups xmm0,[edx]
1207 movups xmm1,[16+edx]
1208 lea edx,[32+edx]
1209 xorps xmm2,xmm0
1210 L$053enc1_loop_9:
1211 db 102,15,56,220,209
1212 dec ecx
1213 movups xmm1,[edx]
1214 lea edx,[16+edx]
1215 jnz NEAR L$053enc1_loop_9
1216 db 102,15,56,221,209
1217 xorps xmm2,xmm5
1218 movups [edi],xmm2
1219 lea edi,[16+edi]
1220 movdqa xmm1,xmm5
1221 jmp NEAR L$052xts_enc_done
1222 align 16
1223 L$049xts_enc_two:
1224 movaps xmm6,xmm1
1225 movups xmm2,[esi]
1226 movups xmm3,[16+esi]
1227 lea esi,[32+esi]
1228 xorps xmm2,xmm5
1229 xorps xmm3,xmm6
1230 call __aesni_encrypt2
1231 xorps xmm2,xmm5
1232 xorps xmm3,xmm6
1233 movups [edi],xmm2
1234 movups [16+edi],xmm3
1235 lea edi,[32+edi]
1236 movdqa xmm1,xmm6
1237 jmp NEAR L$052xts_enc_done
1238 align 16
1239 L$050xts_enc_three:
1240 movaps xmm7,xmm1
1241 movups xmm2,[esi]
1242 movups xmm3,[16+esi]
1243 movups xmm4,[32+esi]
1244 lea esi,[48+esi]
1245 xorps xmm2,xmm5
1246 xorps xmm3,xmm6
1247 xorps xmm4,xmm7
1248 call __aesni_encrypt3
1249 xorps xmm2,xmm5
1250 xorps xmm3,xmm6
1251 xorps xmm4,xmm7
1252 movups [edi],xmm2
1253 movups [16+edi],xmm3
1254 movups [32+edi],xmm4
1255 lea edi,[48+edi]
1256 movdqa xmm1,xmm7
1257 jmp NEAR L$052xts_enc_done
1258 align 16
1259 L$051xts_enc_four:
1260 movaps xmm6,xmm1
1261 movups xmm2,[esi]
1262 movups xmm3,[16+esi]
1263 movups xmm4,[32+esi]
1264 xorps xmm2,[esp]
1265 movups xmm5,[48+esi]
1266 lea esi,[64+esi]
1267 xorps xmm3,[16+esp]
1268 xorps xmm4,xmm7
1269 xorps xmm5,xmm6
1270 call __aesni_encrypt4
1271 xorps xmm2,[esp]
1272 xorps xmm3,[16+esp]
1273 xorps xmm4,xmm7
1274 movups [edi],xmm2
1275 xorps xmm5,xmm6
1276 movups [16+edi],xmm3
1277 movups [32+edi],xmm4
1278 movups [48+edi],xmm5
1279 lea edi,[64+edi]
1280 movdqa xmm1,xmm6
1281 jmp NEAR L$052xts_enc_done
1282 align 16
1283 L$047xts_enc_done6x:
1284 mov eax,DWORD [112+esp]
1285 and eax,15
1286 jz NEAR L$054xts_enc_ret
1287 movdqa xmm5,xmm1
1288 mov DWORD [112+esp],eax
1289 jmp NEAR L$055xts_enc_steal
1290 align 16
1291 L$052xts_enc_done:
1292 mov eax,DWORD [112+esp]
1293 pxor xmm0,xmm0
1294 and eax,15
1295 jz NEAR L$054xts_enc_ret
1296 pcmpgtd xmm0,xmm1
1297 mov DWORD [112+esp],eax
1298 pshufd xmm5,xmm0,19
1299 paddq xmm1,xmm1
1300 pand xmm5,[96+esp]
1301 pxor xmm5,xmm1
1302 L$055xts_enc_steal:
1303 movzx ecx,BYTE [esi]
1304 movzx edx,BYTE [edi-16]
1305 lea esi,[1+esi]
1306 mov BYTE [edi-16],cl
1307 mov BYTE [edi],dl
1308 lea edi,[1+edi]
1309 sub eax,1
1310 jnz NEAR L$055xts_enc_steal
1311 sub edi,DWORD [112+esp]
1312 mov edx,ebp
1313 mov ecx,ebx
1314 movups xmm2,[edi-16]
1315 xorps xmm2,xmm5
1316 movups xmm0,[edx]
1317 movups xmm1,[16+edx]
1318 lea edx,[32+edx]
1319 xorps xmm2,xmm0
1320 L$056enc1_loop_10:
1321 db 102,15,56,220,209
1322 dec ecx
1323 movups xmm1,[edx]
1324 lea edx,[16+edx]
1325 jnz NEAR L$056enc1_loop_10
1326 db 102,15,56,221,209
1327 xorps xmm2,xmm5
1328 movups [edi-16],xmm2
1329 L$054xts_enc_ret:
1330 mov esp,DWORD [116+esp]
1331 pop edi
1332 pop esi
1333 pop ebx
1334 pop ebp
1336 global _aesni_xts_decrypt
1337 align 16
1338 _aesni_xts_decrypt:
1339 L$_aesni_xts_decrypt_begin:
1340 push ebp
1341 push ebx
1342 push esi
1343 push edi
1344 mov edx,DWORD [36+esp]
1345 mov esi,DWORD [40+esp]
1346 mov ecx,DWORD [240+edx]
1347 movups xmm2,[esi]
1348 movups xmm0,[edx]
1349 movups xmm1,[16+edx]
1350 lea edx,[32+edx]
1351 xorps xmm2,xmm0
1352 L$057enc1_loop_11:
1353 db 102,15,56,220,209
1354 dec ecx
1355 movups xmm1,[edx]
1356 lea edx,[16+edx]
1357 jnz NEAR L$057enc1_loop_11
1358 db 102,15,56,221,209
1359 mov esi,DWORD [20+esp]
1360 mov edi,DWORD [24+esp]
1361 mov eax,DWORD [28+esp]
1362 mov edx,DWORD [32+esp]
1363 mov ebp,esp
1364 sub esp,120
1365 and esp,-16
1366 xor ebx,ebx
1367 test eax,15
1368 setnz bl
1369 shl ebx,4
1370 sub eax,ebx
1371 mov DWORD [96+esp],135
1372 mov DWORD [100+esp],0
1373 mov DWORD [104+esp],1
1374 mov DWORD [108+esp],0
1375 mov DWORD [112+esp],eax
1376 mov DWORD [116+esp],ebp
1377 mov ecx,DWORD [240+edx]
1378 mov ebp,edx
1379 mov ebx,ecx
1380 movdqa xmm1,xmm2
1381 pxor xmm0,xmm0
1382 movdqa xmm3,[96+esp]
1383 pcmpgtd xmm0,xmm1
1384 and eax,-16
1385 sub eax,96
1386 jc NEAR L$058xts_dec_short
1387 shl ecx,4
1388 mov ebx,16
1389 sub ebx,ecx
1390 lea edx,[32+ecx*1+edx]
1391 jmp NEAR L$059xts_dec_loop6
1392 align 16
1393 L$059xts_dec_loop6:
1394 pshufd xmm2,xmm0,19
1395 pxor xmm0,xmm0
1396 movdqa [esp],xmm1
1397 paddq xmm1,xmm1
1398 pand xmm2,xmm3
1399 pcmpgtd xmm0,xmm1
1400 pxor xmm1,xmm2
1401 pshufd xmm2,xmm0,19
1402 pxor xmm0,xmm0
1403 movdqa [16+esp],xmm1
1404 paddq xmm1,xmm1
1405 pand xmm2,xmm3
1406 pcmpgtd xmm0,xmm1
1407 pxor xmm1,xmm2
1408 pshufd xmm2,xmm0,19
1409 pxor xmm0,xmm0
1410 movdqa [32+esp],xmm1
1411 paddq xmm1,xmm1
1412 pand xmm2,xmm3
1413 pcmpgtd xmm0,xmm1
1414 pxor xmm1,xmm2
1415 pshufd xmm2,xmm0,19
1416 pxor xmm0,xmm0
1417 movdqa [48+esp],xmm1
1418 paddq xmm1,xmm1
1419 pand xmm2,xmm3
1420 pcmpgtd xmm0,xmm1
1421 pxor xmm1,xmm2
1422 pshufd xmm7,xmm0,19
1423 movdqa [64+esp],xmm1
1424 paddq xmm1,xmm1
1425 movups xmm0,[ebp]
1426 pand xmm7,xmm3
1427 movups xmm2,[esi]
1428 pxor xmm7,xmm1
1429 mov ecx,ebx
1430 movdqu xmm3,[16+esi]
1431 xorps xmm2,xmm0
1432 movdqu xmm4,[32+esi]
1433 pxor xmm3,xmm0
1434 movdqu xmm5,[48+esi]
1435 pxor xmm4,xmm0
1436 movdqu xmm6,[64+esi]
1437 pxor xmm5,xmm0
1438 movdqu xmm1,[80+esi]
1439 pxor xmm6,xmm0
1440 lea esi,[96+esi]
1441 pxor xmm2,[esp]
1442 movdqa [80+esp],xmm7
1443 pxor xmm7,xmm1
1444 movups xmm1,[16+ebp]
1445 pxor xmm3,[16+esp]
1446 pxor xmm4,[32+esp]
1447 db 102,15,56,222,209
1448 pxor xmm5,[48+esp]
1449 pxor xmm6,[64+esp]
1450 db 102,15,56,222,217
1451 pxor xmm7,xmm0
1452 movups xmm0,[32+ebp]
1453 db 102,15,56,222,225
1454 db 102,15,56,222,233
1455 db 102,15,56,222,241
1456 db 102,15,56,222,249
1457 call L$_aesni_decrypt6_enter
1458 movdqa xmm1,[80+esp]
1459 pxor xmm0,xmm0
1460 xorps xmm2,[esp]
1461 pcmpgtd xmm0,xmm1
1462 xorps xmm3,[16+esp]
1463 movups [edi],xmm2
1464 xorps xmm4,[32+esp]
1465 movups [16+edi],xmm3
1466 xorps xmm5,[48+esp]
1467 movups [32+edi],xmm4
1468 xorps xmm6,[64+esp]
1469 movups [48+edi],xmm5
1470 xorps xmm7,xmm1
1471 movups [64+edi],xmm6
1472 pshufd xmm2,xmm0,19
1473 movups [80+edi],xmm7
1474 lea edi,[96+edi]
1475 movdqa xmm3,[96+esp]
1476 pxor xmm0,xmm0
1477 paddq xmm1,xmm1
1478 pand xmm2,xmm3
1479 pcmpgtd xmm0,xmm1
1480 pxor xmm1,xmm2
1481 sub eax,96
1482 jnc NEAR L$059xts_dec_loop6
1483 mov ecx,DWORD [240+ebp]
1484 mov edx,ebp
1485 mov ebx,ecx
1486 L$058xts_dec_short:
1487 add eax,96
1488 jz NEAR L$060xts_dec_done6x
1489 movdqa xmm5,xmm1
1490 cmp eax,32
1491 jb NEAR L$061xts_dec_one
1492 pshufd xmm2,xmm0,19
1493 pxor xmm0,xmm0
1494 paddq xmm1,xmm1
1495 pand xmm2,xmm3
1496 pcmpgtd xmm0,xmm1
1497 pxor xmm1,xmm2
1498 je NEAR L$062xts_dec_two
1499 pshufd xmm2,xmm0,19
1500 pxor xmm0,xmm0
1501 movdqa xmm6,xmm1
1502 paddq xmm1,xmm1
1503 pand xmm2,xmm3
1504 pcmpgtd xmm0,xmm1
1505 pxor xmm1,xmm2
1506 cmp eax,64
1507 jb NEAR L$063xts_dec_three
1508 pshufd xmm2,xmm0,19
1509 pxor xmm0,xmm0
1510 movdqa xmm7,xmm1
1511 paddq xmm1,xmm1
1512 pand xmm2,xmm3
1513 pcmpgtd xmm0,xmm1
1514 pxor xmm1,xmm2
1515 movdqa [esp],xmm5
1516 movdqa [16+esp],xmm6
1517 je NEAR L$064xts_dec_four
1518 movdqa [32+esp],xmm7
1519 pshufd xmm7,xmm0,19
1520 movdqa [48+esp],xmm1
1521 paddq xmm1,xmm1
1522 pand xmm7,xmm3
1523 pxor xmm7,xmm1
1524 movdqu xmm2,[esi]
1525 movdqu xmm3,[16+esi]
1526 movdqu xmm4,[32+esi]
1527 pxor xmm2,[esp]
1528 movdqu xmm5,[48+esi]
1529 pxor xmm3,[16+esp]
1530 movdqu xmm6,[64+esi]
1531 pxor xmm4,[32+esp]
1532 lea esi,[80+esi]
1533 pxor xmm5,[48+esp]
1534 movdqa [64+esp],xmm7
1535 pxor xmm6,xmm7
1536 call __aesni_decrypt6
1537 movaps xmm1,[64+esp]
1538 xorps xmm2,[esp]
1539 xorps xmm3,[16+esp]
1540 xorps xmm4,[32+esp]
1541 movups [edi],xmm2
1542 xorps xmm5,[48+esp]
1543 movups [16+edi],xmm3
1544 xorps xmm6,xmm1
1545 movups [32+edi],xmm4
1546 movups [48+edi],xmm5
1547 movups [64+edi],xmm6
1548 lea edi,[80+edi]
1549 jmp NEAR L$065xts_dec_done
1550 align 16
1551 L$061xts_dec_one:
1552 movups xmm2,[esi]
1553 lea esi,[16+esi]
1554 xorps xmm2,xmm5
1555 movups xmm0,[edx]
1556 movups xmm1,[16+edx]
1557 lea edx,[32+edx]
1558 xorps xmm2,xmm0
1559 L$066dec1_loop_12:
1560 db 102,15,56,222,209
1561 dec ecx
1562 movups xmm1,[edx]
1563 lea edx,[16+edx]
1564 jnz NEAR L$066dec1_loop_12
1565 db 102,15,56,223,209
1566 xorps xmm2,xmm5
1567 movups [edi],xmm2
1568 lea edi,[16+edi]
1569 movdqa xmm1,xmm5
1570 jmp NEAR L$065xts_dec_done
1571 align 16
1572 L$062xts_dec_two:
1573 movaps xmm6,xmm1
1574 movups xmm2,[esi]
1575 movups xmm3,[16+esi]
1576 lea esi,[32+esi]
1577 xorps xmm2,xmm5
1578 xorps xmm3,xmm6
1579 call __aesni_decrypt2
1580 xorps xmm2,xmm5
1581 xorps xmm3,xmm6
1582 movups [edi],xmm2
1583 movups [16+edi],xmm3
1584 lea edi,[32+edi]
1585 movdqa xmm1,xmm6
1586 jmp NEAR L$065xts_dec_done
1587 align 16
1588 L$063xts_dec_three:
1589 movaps xmm7,xmm1
1590 movups xmm2,[esi]
1591 movups xmm3,[16+esi]
1592 movups xmm4,[32+esi]
1593 lea esi,[48+esi]
1594 xorps xmm2,xmm5
1595 xorps xmm3,xmm6
1596 xorps xmm4,xmm7
1597 call __aesni_decrypt3
1598 xorps xmm2,xmm5
1599 xorps xmm3,xmm6
1600 xorps xmm4,xmm7
1601 movups [edi],xmm2
1602 movups [16+edi],xmm3
1603 movups [32+edi],xmm4
1604 lea edi,[48+edi]
1605 movdqa xmm1,xmm7
1606 jmp NEAR L$065xts_dec_done
1607 align 16
1608 L$064xts_dec_four:
1609 movaps xmm6,xmm1
1610 movups xmm2,[esi]
1611 movups xmm3,[16+esi]
1612 movups xmm4,[32+esi]
1613 xorps xmm2,[esp]
1614 movups xmm5,[48+esi]
1615 lea esi,[64+esi]
1616 xorps xmm3,[16+esp]
1617 xorps xmm4,xmm7
1618 xorps xmm5,xmm6
1619 call __aesni_decrypt4
1620 xorps xmm2,[esp]
1621 xorps xmm3,[16+esp]
1622 xorps xmm4,xmm7
1623 movups [edi],xmm2
1624 xorps xmm5,xmm6
1625 movups [16+edi],xmm3
1626 movups [32+edi],xmm4
1627 movups [48+edi],xmm5
1628 lea edi,[64+edi]
1629 movdqa xmm1,xmm6
1630 jmp NEAR L$065xts_dec_done
1631 align 16
1632 L$060xts_dec_done6x:
1633 mov eax,DWORD [112+esp]
1634 and eax,15
1635 jz NEAR L$067xts_dec_ret
1636 mov DWORD [112+esp],eax
1637 jmp NEAR L$068xts_dec_only_one_more
1638 align 16
1639 L$065xts_dec_done:
1640 mov eax,DWORD [112+esp]
1641 pxor xmm0,xmm0
1642 and eax,15
1643 jz NEAR L$067xts_dec_ret
1644 pcmpgtd xmm0,xmm1
1645 mov DWORD [112+esp],eax
1646 pshufd xmm2,xmm0,19
1647 pxor xmm0,xmm0
1648 movdqa xmm3,[96+esp]
1649 paddq xmm1,xmm1
1650 pand xmm2,xmm3
1651 pcmpgtd xmm0,xmm1
1652 pxor xmm1,xmm2
1653 L$068xts_dec_only_one_more:
1654 pshufd xmm5,xmm0,19
1655 movdqa xmm6,xmm1
1656 paddq xmm1,xmm1
1657 pand xmm5,xmm3
1658 pxor xmm5,xmm1
1659 mov edx,ebp
1660 mov ecx,ebx
1661 movups xmm2,[esi]
1662 xorps xmm2,xmm5
1663 movups xmm0,[edx]
1664 movups xmm1,[16+edx]
1665 lea edx,[32+edx]
1666 xorps xmm2,xmm0
1667 L$069dec1_loop_13:
1668 db 102,15,56,222,209
1669 dec ecx
1670 movups xmm1,[edx]
1671 lea edx,[16+edx]
1672 jnz NEAR L$069dec1_loop_13
1673 db 102,15,56,223,209
1674 xorps xmm2,xmm5
1675 movups [edi],xmm2
1676 L$070xts_dec_steal:
1677 movzx ecx,BYTE [16+esi]
1678 movzx edx,BYTE [edi]
1679 lea esi,[1+esi]
1680 mov BYTE [edi],cl
1681 mov BYTE [16+edi],dl
1682 lea edi,[1+edi]
1683 sub eax,1
1684 jnz NEAR L$070xts_dec_steal
1685 sub edi,DWORD [112+esp]
1686 mov edx,ebp
1687 mov ecx,ebx
1688 movups xmm2,[edi]
1689 xorps xmm2,xmm6
1690 movups xmm0,[edx]
1691 movups xmm1,[16+edx]
1692 lea edx,[32+edx]
1693 xorps xmm2,xmm0
1694 L$071dec1_loop_14:
1695 db 102,15,56,222,209
1696 dec ecx
1697 movups xmm1,[edx]
1698 lea edx,[16+edx]
1699 jnz NEAR L$071dec1_loop_14
1700 db 102,15,56,223,209
1701 xorps xmm2,xmm6
1702 movups [edi],xmm2
1703 L$067xts_dec_ret:
1704 mov esp,DWORD [116+esp]
1705 pop edi
1706 pop esi
1707 pop ebx
1708 pop ebp
1710 global _aesni_cbc_encrypt
1711 align 16
1712 _aesni_cbc_encrypt:
1713 L$_aesni_cbc_encrypt_begin:
1714 push ebp
1715 push ebx
1716 push esi
1717 push edi
1718 mov esi,DWORD [20+esp]
1719 mov ebx,esp
1720 mov edi,DWORD [24+esp]
1721 sub ebx,24
1722 mov eax,DWORD [28+esp]
1723 and ebx,-16
1724 mov edx,DWORD [32+esp]
1725 mov ebp,DWORD [36+esp]
1726 test eax,eax
1727 jz NEAR L$072cbc_abort
1728 cmp DWORD [40+esp],0
1729 xchg ebx,esp
1730 movups xmm7,[ebp]
1731 mov ecx,DWORD [240+edx]
1732 mov ebp,edx
1733 mov DWORD [16+esp],ebx
1734 mov ebx,ecx
1735 je NEAR L$073cbc_decrypt
1736 movaps xmm2,xmm7
1737 cmp eax,16
1738 jb NEAR L$074cbc_enc_tail
1739 sub eax,16
1740 jmp NEAR L$075cbc_enc_loop
1741 align 16
1742 L$075cbc_enc_loop:
1743 movups xmm7,[esi]
1744 lea esi,[16+esi]
1745 movups xmm0,[edx]
1746 movups xmm1,[16+edx]
1747 xorps xmm7,xmm0
1748 lea edx,[32+edx]
1749 xorps xmm2,xmm7
1750 L$076enc1_loop_15:
1751 db 102,15,56,220,209
1752 dec ecx
1753 movups xmm1,[edx]
1754 lea edx,[16+edx]
1755 jnz NEAR L$076enc1_loop_15
1756 db 102,15,56,221,209
1757 mov ecx,ebx
1758 mov edx,ebp
1759 movups [edi],xmm2
1760 lea edi,[16+edi]
1761 sub eax,16
1762 jnc NEAR L$075cbc_enc_loop
1763 add eax,16
1764 jnz NEAR L$074cbc_enc_tail
1765 movaps xmm7,xmm2
1766 jmp NEAR L$077cbc_ret
1767 L$074cbc_enc_tail:
1768 mov ecx,eax
1769 dd 2767451785
1770 mov ecx,16
1771 sub ecx,eax
1772 xor eax,eax
1773 dd 2868115081
1774 lea edi,[edi-16]
1775 mov ecx,ebx
1776 mov esi,edi
1777 mov edx,ebp
1778 jmp NEAR L$075cbc_enc_loop
1779 align 16
1780 L$073cbc_decrypt:
1781 cmp eax,80
1782 jbe NEAR L$078cbc_dec_tail
1783 movaps [esp],xmm7
1784 sub eax,80
1785 jmp NEAR L$079cbc_dec_loop6_enter
1786 align 16
1787 L$080cbc_dec_loop6:
1788 movaps [esp],xmm0
1789 movups [edi],xmm7
1790 lea edi,[16+edi]
1791 L$079cbc_dec_loop6_enter:
1792 movdqu xmm2,[esi]
1793 movdqu xmm3,[16+esi]
1794 movdqu xmm4,[32+esi]
1795 movdqu xmm5,[48+esi]
1796 movdqu xmm6,[64+esi]
1797 movdqu xmm7,[80+esi]
1798 call __aesni_decrypt6
1799 movups xmm1,[esi]
1800 movups xmm0,[16+esi]
1801 xorps xmm2,[esp]
1802 xorps xmm3,xmm1
1803 movups xmm1,[32+esi]
1804 xorps xmm4,xmm0
1805 movups xmm0,[48+esi]
1806 xorps xmm5,xmm1
1807 movups xmm1,[64+esi]
1808 xorps xmm6,xmm0
1809 movups xmm0,[80+esi]
1810 xorps xmm7,xmm1
1811 movups [edi],xmm2
1812 movups [16+edi],xmm3
1813 lea esi,[96+esi]
1814 movups [32+edi],xmm4
1815 mov ecx,ebx
1816 movups [48+edi],xmm5
1817 mov edx,ebp
1818 movups [64+edi],xmm6
1819 lea edi,[80+edi]
1820 sub eax,96
1821 ja NEAR L$080cbc_dec_loop6
1822 movaps xmm2,xmm7
1823 movaps xmm7,xmm0
1824 add eax,80
1825 jle NEAR L$081cbc_dec_tail_collected
1826 movups [edi],xmm2
1827 lea edi,[16+edi]
1828 L$078cbc_dec_tail:
1829 movups xmm2,[esi]
1830 movaps xmm6,xmm2
1831 cmp eax,16
1832 jbe NEAR L$082cbc_dec_one
1833 movups xmm3,[16+esi]
1834 movaps xmm5,xmm3
1835 cmp eax,32
1836 jbe NEAR L$083cbc_dec_two
1837 movups xmm4,[32+esi]
1838 cmp eax,48
1839 jbe NEAR L$084cbc_dec_three
1840 movups xmm5,[48+esi]
1841 cmp eax,64
1842 jbe NEAR L$085cbc_dec_four
1843 movups xmm6,[64+esi]
1844 movaps [esp],xmm7
1845 movups xmm2,[esi]
1846 xorps xmm7,xmm7
1847 call __aesni_decrypt6
1848 movups xmm1,[esi]
1849 movups xmm0,[16+esi]
1850 xorps xmm2,[esp]
1851 xorps xmm3,xmm1
1852 movups xmm1,[32+esi]
1853 xorps xmm4,xmm0
1854 movups xmm0,[48+esi]
1855 xorps xmm5,xmm1
1856 movups xmm7,[64+esi]
1857 xorps xmm6,xmm0
1858 movups [edi],xmm2
1859 movups [16+edi],xmm3
1860 movups [32+edi],xmm4
1861 movups [48+edi],xmm5
1862 lea edi,[64+edi]
1863 movaps xmm2,xmm6
1864 sub eax,80
1865 jmp NEAR L$081cbc_dec_tail_collected
1866 align 16
1867 L$082cbc_dec_one:
1868 movups xmm0,[edx]
1869 movups xmm1,[16+edx]
1870 lea edx,[32+edx]
1871 xorps xmm2,xmm0
1872 L$086dec1_loop_16:
1873 db 102,15,56,222,209
1874 dec ecx
1875 movups xmm1,[edx]
1876 lea edx,[16+edx]
1877 jnz NEAR L$086dec1_loop_16
1878 db 102,15,56,223,209
1879 xorps xmm2,xmm7
1880 movaps xmm7,xmm6
1881 sub eax,16
1882 jmp NEAR L$081cbc_dec_tail_collected
1883 align 16
1884 L$083cbc_dec_two:
1885 call __aesni_decrypt2
1886 xorps xmm2,xmm7
1887 xorps xmm3,xmm6
1888 movups [edi],xmm2
1889 movaps xmm2,xmm3
1890 lea edi,[16+edi]
1891 movaps xmm7,xmm5
1892 sub eax,32
1893 jmp NEAR L$081cbc_dec_tail_collected
1894 align 16
1895 L$084cbc_dec_three:
1896 call __aesni_decrypt3
1897 xorps xmm2,xmm7
1898 xorps xmm3,xmm6
1899 xorps xmm4,xmm5
1900 movups [edi],xmm2
1901 movaps xmm2,xmm4
1902 movups [16+edi],xmm3
1903 lea edi,[32+edi]
1904 movups xmm7,[32+esi]
1905 sub eax,48
1906 jmp NEAR L$081cbc_dec_tail_collected
1907 align 16
1908 L$085cbc_dec_four:
1909 call __aesni_decrypt4
1910 movups xmm1,[16+esi]
1911 movups xmm0,[32+esi]
1912 xorps xmm2,xmm7
1913 movups xmm7,[48+esi]
1914 xorps xmm3,xmm6
1915 movups [edi],xmm2
1916 xorps xmm4,xmm1
1917 movups [16+edi],xmm3
1918 xorps xmm5,xmm0
1919 movups [32+edi],xmm4
1920 lea edi,[48+edi]
1921 movaps xmm2,xmm5
1922 sub eax,64
1923 L$081cbc_dec_tail_collected:
1924 and eax,15
1925 jnz NEAR L$087cbc_dec_tail_partial
1926 movups [edi],xmm2
1927 jmp NEAR L$077cbc_ret
1928 align 16
1929 L$087cbc_dec_tail_partial:
1930 movaps [esp],xmm2
1931 mov ecx,16
1932 mov esi,esp
1933 sub ecx,eax
1934 dd 2767451785
1935 L$077cbc_ret:
1936 mov esp,DWORD [16+esp]
1937 mov ebp,DWORD [36+esp]
1938 movups [ebp],xmm7
1939 L$072cbc_abort:
1940 pop edi
1941 pop esi
1942 pop ebx
1943 pop ebp
1945 align 16
1946 __aesni_set_encrypt_key:
1947 test eax,eax
1948 jz NEAR L$088bad_pointer
1949 test edx,edx
1950 jz NEAR L$088bad_pointer
1951 movups xmm0,[eax]
1952 xorps xmm4,xmm4
1953 lea edx,[16+edx]
1954 cmp ecx,256
1955 je NEAR L$08914rounds
1956 cmp ecx,192
1957 je NEAR L$09012rounds
1958 cmp ecx,128
1959 jne NEAR L$091bad_keybits
1960 align 16
1961 L$09210rounds:
1962 mov ecx,9
1963 movups [edx-16],xmm0
1964 db 102,15,58,223,200,1
1965 call L$093key_128_cold
1966 db 102,15,58,223,200,2
1967 call L$094key_128
1968 db 102,15,58,223,200,4
1969 call L$094key_128
1970 db 102,15,58,223,200,8
1971 call L$094key_128
1972 db 102,15,58,223,200,16
1973 call L$094key_128
1974 db 102,15,58,223,200,32
1975 call L$094key_128
1976 db 102,15,58,223,200,64
1977 call L$094key_128
1978 db 102,15,58,223,200,128
1979 call L$094key_128
1980 db 102,15,58,223,200,27
1981 call L$094key_128
1982 db 102,15,58,223,200,54
1983 call L$094key_128
1984 movups [edx],xmm0
1985 mov DWORD [80+edx],ecx
1986 xor eax,eax
1988 align 16
1989 L$094key_128:
1990 movups [edx],xmm0
1991 lea edx,[16+edx]
1992 L$093key_128_cold:
1993 shufps xmm4,xmm0,16
1994 xorps xmm0,xmm4
1995 shufps xmm4,xmm0,140
1996 xorps xmm0,xmm4
1997 shufps xmm1,xmm1,255
1998 xorps xmm0,xmm1
2000 align 16
2001 L$09012rounds:
2002 movq xmm2,[16+eax]
2003 mov ecx,11
2004 movups [edx-16],xmm0
2005 db 102,15,58,223,202,1
2006 call L$095key_192a_cold
2007 db 102,15,58,223,202,2
2008 call L$096key_192b
2009 db 102,15,58,223,202,4
2010 call L$097key_192a
2011 db 102,15,58,223,202,8
2012 call L$096key_192b
2013 db 102,15,58,223,202,16
2014 call L$097key_192a
2015 db 102,15,58,223,202,32
2016 call L$096key_192b
2017 db 102,15,58,223,202,64
2018 call L$097key_192a
2019 db 102,15,58,223,202,128
2020 call L$096key_192b
2021 movups [edx],xmm0
2022 mov DWORD [48+edx],ecx
2023 xor eax,eax
2025 align 16
2026 L$097key_192a:
2027 movups [edx],xmm0
2028 lea edx,[16+edx]
2029 align 16
2030 L$095key_192a_cold:
2031 movaps xmm5,xmm2
2032 L$098key_192b_warm:
2033 shufps xmm4,xmm0,16
2034 movdqa xmm3,xmm2
2035 xorps xmm0,xmm4
2036 shufps xmm4,xmm0,140
2037 pslldq xmm3,4
2038 xorps xmm0,xmm4
2039 pshufd xmm1,xmm1,85
2040 pxor xmm2,xmm3
2041 pxor xmm0,xmm1
2042 pshufd xmm3,xmm0,255
2043 pxor xmm2,xmm3
2045 align 16
2046 L$096key_192b:
2047 movaps xmm3,xmm0
2048 shufps xmm5,xmm0,68
2049 movups [edx],xmm5
2050 shufps xmm3,xmm2,78
2051 movups [16+edx],xmm3
2052 lea edx,[32+edx]
2053 jmp NEAR L$098key_192b_warm
2054 align 16
2055 L$08914rounds:
2056 movups xmm2,[16+eax]
2057 mov ecx,13
2058 lea edx,[16+edx]
2059 movups [edx-32],xmm0
2060 movups [edx-16],xmm2
2061 db 102,15,58,223,202,1
2062 call L$099key_256a_cold
2063 db 102,15,58,223,200,1
2064 call L$100key_256b
2065 db 102,15,58,223,202,2
2066 call L$101key_256a
2067 db 102,15,58,223,200,2
2068 call L$100key_256b
2069 db 102,15,58,223,202,4
2070 call L$101key_256a
2071 db 102,15,58,223,200,4
2072 call L$100key_256b
2073 db 102,15,58,223,202,8
2074 call L$101key_256a
2075 db 102,15,58,223,200,8
2076 call L$100key_256b
2077 db 102,15,58,223,202,16
2078 call L$101key_256a
2079 db 102,15,58,223,200,16
2080 call L$100key_256b
2081 db 102,15,58,223,202,32
2082 call L$101key_256a
2083 db 102,15,58,223,200,32
2084 call L$100key_256b
2085 db 102,15,58,223,202,64
2086 call L$101key_256a
2087 movups [edx],xmm0
2088 mov DWORD [16+edx],ecx
2089 xor eax,eax
2091 align 16
2092 L$101key_256a:
2093 movups [edx],xmm2
2094 lea edx,[16+edx]
2095 L$099key_256a_cold:
2096 shufps xmm4,xmm0,16
2097 xorps xmm0,xmm4
2098 shufps xmm4,xmm0,140
2099 xorps xmm0,xmm4
2100 shufps xmm1,xmm1,255
2101 xorps xmm0,xmm1
2103 align 16
2104 L$100key_256b:
2105 movups [edx],xmm0
2106 lea edx,[16+edx]
2107 shufps xmm4,xmm2,16
2108 xorps xmm2,xmm4
2109 shufps xmm4,xmm2,140
2110 xorps xmm2,xmm4
2111 shufps xmm1,xmm1,170
2112 xorps xmm2,xmm1
2114 align 4
2115 L$088bad_pointer:
2116 mov eax,-1
2118 align 4
2119 L$091bad_keybits:
2120 mov eax,-2
2122 global _aesni_set_encrypt_key
2123 align 16
2124 _aesni_set_encrypt_key:
2125 L$_aesni_set_encrypt_key_begin:
2126 mov eax,DWORD [4+esp]
2127 mov ecx,DWORD [8+esp]
2128 mov edx,DWORD [12+esp]
2129 call __aesni_set_encrypt_key
2131 global _aesni_set_decrypt_key
2132 align 16
2133 _aesni_set_decrypt_key:
2134 L$_aesni_set_decrypt_key_begin:
2135 mov eax,DWORD [4+esp]
2136 mov ecx,DWORD [8+esp]
2137 mov edx,DWORD [12+esp]
2138 call __aesni_set_encrypt_key
2139 mov edx,DWORD [12+esp]
2140 shl ecx,4
2141 test eax,eax
2142 jnz NEAR L$102dec_key_ret
2143 lea eax,[16+ecx*1+edx]
2144 movups xmm0,[edx]
2145 movups xmm1,[eax]
2146 movups [eax],xmm0
2147 movups [edx],xmm1
2148 lea edx,[16+edx]
2149 lea eax,[eax-16]
2150 L$103dec_key_inverse:
2151 movups xmm0,[edx]
2152 movups xmm1,[eax]
2153 db 102,15,56,219,192
2154 db 102,15,56,219,201
2155 lea edx,[16+edx]
2156 lea eax,[eax-16]
2157 movups [16+eax],xmm0
2158 movups [edx-16],xmm1
2159 cmp eax,edx
2160 ja NEAR L$103dec_key_inverse
2161 movups xmm0,[edx]
2162 db 102,15,56,219,192
2163 movups [edx],xmm0
2164 xor eax,eax
2165 L$102dec_key_ret:
2167 db 65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69
2168 db 83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83
2169 db 32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
2170 db 115,108,46,111,114,103,62,0