Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: third_party/boringssl/win-x86_64/crypto/aes/vpaes-x86_64.asm

Issue 377783004: Add BoringSSL GYP files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final Python fix. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 OPTION DOTNAME
2 .text$ SEGMENT ALIGN(64) 'CODE'
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 ALIGN 16
21 _vpaes_encrypt_core PROC PRIVATE
22 mov r9,rdx
23 mov r11,16
24 mov eax,DWORD PTR[240+rdx]
25 movdqa xmm1,xmm9
26 movdqa xmm2,XMMWORD PTR[$L$k_ipt]
27 pandn xmm1,xmm0
28 movdqu xmm5,XMMWORD PTR[r9]
29 psrld xmm1,4
30 pand xmm0,xmm9
31 DB 102,15,56,0,208
32 movdqa xmm0,XMMWORD PTR[(($L$k_ipt+16))]
33 DB 102,15,56,0,193
34 pxor xmm2,xmm5
35 add r9,16
36 pxor xmm0,xmm2
37 lea r10,QWORD PTR[$L$k_mc_backward]
38 jmp $L$enc_entry
39
40 ALIGN 16
41 $L$enc_loop::
42
43 movdqa xmm4,xmm13
44 movdqa xmm0,xmm12
45 DB 102,15,56,0,226
46 DB 102,15,56,0,195
47 pxor xmm4,xmm5
48 movdqa xmm5,xmm15
49 pxor xmm0,xmm4
50 movdqa xmm1,XMMWORD PTR[((-64))+r10*1+r11]
51 DB 102,15,56,0,234
52 movdqa xmm4,XMMWORD PTR[r10*1+r11]
53 movdqa xmm2,xmm14
54 DB 102,15,56,0,211
55 movdqa xmm3,xmm0
56 pxor xmm2,xmm5
57 DB 102,15,56,0,193
58 add r9,16
59 pxor xmm0,xmm2
60 DB 102,15,56,0,220
61 add r11,16
62 pxor xmm3,xmm0
63 DB 102,15,56,0,193
64 and r11,030h
65 sub rax,1
66 pxor xmm0,xmm3
67
68 $L$enc_entry::
69
70 movdqa xmm1,xmm9
71 movdqa xmm5,xmm11
72 pandn xmm1,xmm0
73 psrld xmm1,4
74 pand xmm0,xmm9
75 DB 102,15,56,0,232
76 movdqa xmm3,xmm10
77 pxor xmm0,xmm1
78 DB 102,15,56,0,217
79 movdqa xmm4,xmm10
80 pxor xmm3,xmm5
81 DB 102,15,56,0,224
82 movdqa xmm2,xmm10
83 pxor xmm4,xmm5
84 DB 102,15,56,0,211
85 movdqa xmm3,xmm10
86 pxor xmm2,xmm0
87 DB 102,15,56,0,220
88 movdqu xmm5,XMMWORD PTR[r9]
89 pxor xmm3,xmm1
90 jnz $L$enc_loop
91
92
93 movdqa xmm4,XMMWORD PTR[((-96))+r10]
94 movdqa xmm0,XMMWORD PTR[((-80))+r10]
95 DB 102,15,56,0,226
96 pxor xmm4,xmm5
97 DB 102,15,56,0,195
98 movdqa xmm1,XMMWORD PTR[64+r10*1+r11]
99 pxor xmm0,xmm4
100 DB 102,15,56,0,193
101 DB 0F3h,0C3h ;repret
102 _vpaes_encrypt_core ENDP
103
104
105
106
107
108
109
110 ALIGN 16
111 _vpaes_decrypt_core PROC PRIVATE
112 mov r9,rdx
113 mov eax,DWORD PTR[240+rdx]
114 movdqa xmm1,xmm9
115 movdqa xmm2,XMMWORD PTR[$L$k_dipt]
116 pandn xmm1,xmm0
117 mov r11,rax
118 psrld xmm1,4
119 movdqu xmm5,XMMWORD PTR[r9]
120 shl r11,4
121 pand xmm0,xmm9
122 DB 102,15,56,0,208
123 movdqa xmm0,XMMWORD PTR[(($L$k_dipt+16))]
124 xor r11,030h
125 lea r10,QWORD PTR[$L$k_dsbd]
126 DB 102,15,56,0,193
127 and r11,030h
128 pxor xmm2,xmm5
129 movdqa xmm5,XMMWORD PTR[(($L$k_mc_forward+48))]
130 pxor xmm0,xmm2
131 add r9,16
132 add r11,r10
133 jmp $L$dec_entry
134
135 ALIGN 16
136 $L$dec_loop::
137
138
139
140 movdqa xmm4,XMMWORD PTR[((-32))+r10]
141 movdqa xmm1,XMMWORD PTR[((-16))+r10]
142 DB 102,15,56,0,226
143 DB 102,15,56,0,203
144 pxor xmm0,xmm4
145 movdqa xmm4,XMMWORD PTR[r10]
146 pxor xmm0,xmm1
147 movdqa xmm1,XMMWORD PTR[16+r10]
148
149 DB 102,15,56,0,226
150 DB 102,15,56,0,197
151 DB 102,15,56,0,203
152 pxor xmm0,xmm4
153 movdqa xmm4,XMMWORD PTR[32+r10]
154 pxor xmm0,xmm1
155 movdqa xmm1,XMMWORD PTR[48+r10]
156
157 DB 102,15,56,0,226
158 DB 102,15,56,0,197
159 DB 102,15,56,0,203
160 pxor xmm0,xmm4
161 movdqa xmm4,XMMWORD PTR[64+r10]
162 pxor xmm0,xmm1
163 movdqa xmm1,XMMWORD PTR[80+r10]
164
165 DB 102,15,56,0,226
166 DB 102,15,56,0,197
167 DB 102,15,56,0,203
168 pxor xmm0,xmm4
169 add r9,16
170 DB 102,15,58,15,237,12
171 pxor xmm0,xmm1
172 sub rax,1
173
174 $L$dec_entry::
175
176 movdqa xmm1,xmm9
177 pandn xmm1,xmm0
178 movdqa xmm2,xmm11
179 psrld xmm1,4
180 pand xmm0,xmm9
181 DB 102,15,56,0,208
182 movdqa xmm3,xmm10
183 pxor xmm0,xmm1
184 DB 102,15,56,0,217
185 movdqa xmm4,xmm10
186 pxor xmm3,xmm2
187 DB 102,15,56,0,224
188 pxor xmm4,xmm2
189 movdqa xmm2,xmm10
190 DB 102,15,56,0,211
191 movdqa xmm3,xmm10
192 pxor xmm2,xmm0
193 DB 102,15,56,0,220
194 movdqu xmm0,XMMWORD PTR[r9]
195 pxor xmm3,xmm1
196 jnz $L$dec_loop
197
198
199 movdqa xmm4,XMMWORD PTR[96+r10]
200 DB 102,15,56,0,226
201 pxor xmm4,xmm0
202 movdqa xmm0,XMMWORD PTR[112+r10]
203 movdqa xmm2,XMMWORD PTR[((-352))+r11]
204 DB 102,15,56,0,195
205 pxor xmm0,xmm4
206 DB 102,15,56,0,194
207 DB 0F3h,0C3h ;repret
208 _vpaes_decrypt_core ENDP
209
210
211
212
213
214
215
216 ALIGN 16
217 _vpaes_schedule_core PROC PRIVATE
218
219
220
221
222
223 call _vpaes_preheat
224 movdqa xmm8,XMMWORD PTR[$L$k_rcon]
225 movdqu xmm0,XMMWORD PTR[rdi]
226
227
228 movdqa xmm3,xmm0
229 lea r11,QWORD PTR[$L$k_ipt]
230 call _vpaes_schedule_transform
231 movdqa xmm7,xmm0
232
233 lea r10,QWORD PTR[$L$k_sr]
234 test rcx,rcx
235 jnz $L$schedule_am_decrypting
236
237
238 movdqu XMMWORD PTR[rdx],xmm0
239 jmp $L$schedule_go
240
241 $L$schedule_am_decrypting::
242
243 movdqa xmm1,XMMWORD PTR[r10*1+r8]
244 DB 102,15,56,0,217
245 movdqu XMMWORD PTR[rdx],xmm3
246 xor r8,030h
247
248 $L$schedule_go::
249 cmp esi,192
250 ja $L$schedule_256
251 je $L$schedule_192
252
253
254
255
256
257
258
259
260
261
262 $L$schedule_128::
263 mov esi,10
264
265 $L$oop_schedule_128::
266 call _vpaes_schedule_round
267 dec rsi
268 jz $L$schedule_mangle_last
269 call _vpaes_schedule_mangle
270 jmp $L$oop_schedule_128
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287 ALIGN 16
288 $L$schedule_192::
289 movdqu xmm0,XMMWORD PTR[8+rdi]
290 call _vpaes_schedule_transform
291 movdqa xmm6,xmm0
292 pxor xmm4,xmm4
293 movhlps xmm6,xmm4
294 mov esi,4
295
296 $L$oop_schedule_192::
297 call _vpaes_schedule_round
298 DB 102,15,58,15,198,8
299 call _vpaes_schedule_mangle
300 call _vpaes_schedule_192_smear
301 call _vpaes_schedule_mangle
302 call _vpaes_schedule_round
303 dec rsi
304 jz $L$schedule_mangle_last
305 call _vpaes_schedule_mangle
306 call _vpaes_schedule_192_smear
307 jmp $L$oop_schedule_192
308
309
310
311
312
313
314
315
316
317
318
319 ALIGN 16
320 $L$schedule_256::
321 movdqu xmm0,XMMWORD PTR[16+rdi]
322 call _vpaes_schedule_transform
323 mov esi,7
324
325 $L$oop_schedule_256::
326 call _vpaes_schedule_mangle
327 movdqa xmm6,xmm0
328
329
330 call _vpaes_schedule_round
331 dec rsi
332 jz $L$schedule_mangle_last
333 call _vpaes_schedule_mangle
334
335
336 pshufd xmm0,xmm0,0FFh
337 movdqa xmm5,xmm7
338 movdqa xmm7,xmm6
339 call _vpaes_schedule_low_round
340 movdqa xmm7,xmm5
341
342 jmp $L$oop_schedule_256
343
344
345
346
347
348
349
350
351
352
353
354
355 ALIGN 16
356 $L$schedule_mangle_last::
357
358 lea r11,QWORD PTR[$L$k_deskew]
359 test rcx,rcx
360 jnz $L$schedule_mangle_last_dec
361
362
363 movdqa xmm1,XMMWORD PTR[r10*1+r8]
364 DB 102,15,56,0,193
365 lea r11,QWORD PTR[$L$k_opt]
366 add rdx,32
367
368 $L$schedule_mangle_last_dec::
369 add rdx,-16
370 pxor xmm0,XMMWORD PTR[$L$k_s63]
371 call _vpaes_schedule_transform
372 movdqu XMMWORD PTR[rdx],xmm0
373
374
375 pxor xmm0,xmm0
376 pxor xmm1,xmm1
377 pxor xmm2,xmm2
378 pxor xmm3,xmm3
379 pxor xmm4,xmm4
380 pxor xmm5,xmm5
381 pxor xmm6,xmm6
382 pxor xmm7,xmm7
383 DB 0F3h,0C3h ;repret
384 _vpaes_schedule_core ENDP
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401 ALIGN 16
402 _vpaes_schedule_192_smear PROC PRIVATE
403 pshufd xmm1,xmm6,080h
404 pshufd xmm0,xmm7,0FEh
405 pxor xmm6,xmm1
406 pxor xmm1,xmm1
407 pxor xmm6,xmm0
408 movdqa xmm0,xmm6
409 movhlps xmm6,xmm1
410 DB 0F3h,0C3h ;repret
411 _vpaes_schedule_192_smear ENDP
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432 ALIGN 16
433 _vpaes_schedule_round PROC PRIVATE
434
435 pxor xmm1,xmm1
436 DB 102,65,15,58,15,200,15
437 DB 102,69,15,58,15,192,15
438 pxor xmm7,xmm1
439
440
441 pshufd xmm0,xmm0,0FFh
442 DB 102,15,58,15,192,1
443
444
445
446
447 _vpaes_schedule_low_round::
448
449 movdqa xmm1,xmm7
450 pslldq xmm7,4
451 pxor xmm7,xmm1
452 movdqa xmm1,xmm7
453 pslldq xmm7,8
454 pxor xmm7,xmm1
455 pxor xmm7,XMMWORD PTR[$L$k_s63]
456
457
458 movdqa xmm1,xmm9
459 pandn xmm1,xmm0
460 psrld xmm1,4
461 pand xmm0,xmm9
462 movdqa xmm2,xmm11
463 DB 102,15,56,0,208
464 pxor xmm0,xmm1
465 movdqa xmm3,xmm10
466 DB 102,15,56,0,217
467 pxor xmm3,xmm2
468 movdqa xmm4,xmm10
469 DB 102,15,56,0,224
470 pxor xmm4,xmm2
471 movdqa xmm2,xmm10
472 DB 102,15,56,0,211
473 pxor xmm2,xmm0
474 movdqa xmm3,xmm10
475 DB 102,15,56,0,220
476 pxor xmm3,xmm1
477 movdqa xmm4,xmm13
478 DB 102,15,56,0,226
479 movdqa xmm0,xmm12
480 DB 102,15,56,0,195
481 pxor xmm0,xmm4
482
483
484 pxor xmm0,xmm7
485 movdqa xmm7,xmm0
486 DB 0F3h,0C3h ;repret
487 _vpaes_schedule_round ENDP
488
489
490
491
492
493
494
495
496
497
498
499 ALIGN 16
500 _vpaes_schedule_transform PROC PRIVATE
501 movdqa xmm1,xmm9
502 pandn xmm1,xmm0
503 psrld xmm1,4
504 pand xmm0,xmm9
505 movdqa xmm2,XMMWORD PTR[r11]
506 DB 102,15,56,0,208
507 movdqa xmm0,XMMWORD PTR[16+r11]
508 DB 102,15,56,0,193
509 pxor xmm0,xmm2
510 DB 0F3h,0C3h ;repret
511 _vpaes_schedule_transform ENDP
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537 ALIGN 16
538 _vpaes_schedule_mangle PROC PRIVATE
539 movdqa xmm4,xmm0
540 movdqa xmm5,XMMWORD PTR[$L$k_mc_forward]
541 test rcx,rcx
542 jnz $L$schedule_mangle_dec
543
544
545 add rdx,16
546 pxor xmm4,XMMWORD PTR[$L$k_s63]
547 DB 102,15,56,0,229
548 movdqa xmm3,xmm4
549 DB 102,15,56,0,229
550 pxor xmm3,xmm4
551 DB 102,15,56,0,229
552 pxor xmm3,xmm4
553
554 jmp $L$schedule_mangle_both
555 ALIGN 16
556 $L$schedule_mangle_dec::
557
558 lea r11,QWORD PTR[$L$k_dksd]
559 movdqa xmm1,xmm9
560 pandn xmm1,xmm4
561 psrld xmm1,4
562 pand xmm4,xmm9
563
564 movdqa xmm2,XMMWORD PTR[r11]
565 DB 102,15,56,0,212
566 movdqa xmm3,XMMWORD PTR[16+r11]
567 DB 102,15,56,0,217
568 pxor xmm3,xmm2
569 DB 102,15,56,0,221
570
571 movdqa xmm2,XMMWORD PTR[32+r11]
572 DB 102,15,56,0,212
573 pxor xmm2,xmm3
574 movdqa xmm3,XMMWORD PTR[48+r11]
575 DB 102,15,56,0,217
576 pxor xmm3,xmm2
577 DB 102,15,56,0,221
578
579 movdqa xmm2,XMMWORD PTR[64+r11]
580 DB 102,15,56,0,212
581 pxor xmm2,xmm3
582 movdqa xmm3,XMMWORD PTR[80+r11]
583 DB 102,15,56,0,217
584 pxor xmm3,xmm2
585 DB 102,15,56,0,221
586
587 movdqa xmm2,XMMWORD PTR[96+r11]
588 DB 102,15,56,0,212
589 pxor xmm2,xmm3
590 movdqa xmm3,XMMWORD PTR[112+r11]
591 DB 102,15,56,0,217
592 pxor xmm3,xmm2
593
594 add rdx,-16
595
596 $L$schedule_mangle_both::
597 movdqa xmm1,XMMWORD PTR[r10*1+r8]
598 DB 102,15,56,0,217
599 add r8,-16
600 and r8,030h
601 movdqu XMMWORD PTR[rdx],xmm3
602 DB 0F3h,0C3h ;repret
603 _vpaes_schedule_mangle ENDP
604
605
606
607
608 PUBLIC vpaes_set_encrypt_key
609
610 ALIGN 16
611 vpaes_set_encrypt_key PROC PUBLIC
612 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
613 mov QWORD PTR[16+rsp],rsi
614 mov rax,rsp
615 $L$SEH_begin_vpaes_set_encrypt_key::
616 mov rdi,rcx
617 mov rsi,rdx
618 mov rdx,r8
619
620
621 lea rsp,QWORD PTR[((-184))+rsp]
622 movaps XMMWORD PTR[16+rsp],xmm6
623 movaps XMMWORD PTR[32+rsp],xmm7
624 movaps XMMWORD PTR[48+rsp],xmm8
625 movaps XMMWORD PTR[64+rsp],xmm9
626 movaps XMMWORD PTR[80+rsp],xmm10
627 movaps XMMWORD PTR[96+rsp],xmm11
628 movaps XMMWORD PTR[112+rsp],xmm12
629 movaps XMMWORD PTR[128+rsp],xmm13
630 movaps XMMWORD PTR[144+rsp],xmm14
631 movaps XMMWORD PTR[160+rsp],xmm15
632 $L$enc_key_body::
633 mov eax,esi
634 shr eax,5
635 add eax,5
636 mov DWORD PTR[240+rdx],eax
637
638 mov ecx,0
639 mov r8d,030h
640 call _vpaes_schedule_core
641 movaps xmm6,XMMWORD PTR[16+rsp]
642 movaps xmm7,XMMWORD PTR[32+rsp]
643 movaps xmm8,XMMWORD PTR[48+rsp]
644 movaps xmm9,XMMWORD PTR[64+rsp]
645 movaps xmm10,XMMWORD PTR[80+rsp]
646 movaps xmm11,XMMWORD PTR[96+rsp]
647 movaps xmm12,XMMWORD PTR[112+rsp]
648 movaps xmm13,XMMWORD PTR[128+rsp]
649 movaps xmm14,XMMWORD PTR[144+rsp]
650 movaps xmm15,XMMWORD PTR[160+rsp]
651 lea rsp,QWORD PTR[184+rsp]
652 $L$enc_key_epilogue::
653 xor eax,eax
654 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
655 mov rsi,QWORD PTR[16+rsp]
656 DB 0F3h,0C3h ;repret
657 $L$SEH_end_vpaes_set_encrypt_key::
658 vpaes_set_encrypt_key ENDP
659
660 PUBLIC vpaes_set_decrypt_key
661
662 ALIGN 16
663 vpaes_set_decrypt_key PROC PUBLIC
664 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
665 mov QWORD PTR[16+rsp],rsi
666 mov rax,rsp
667 $L$SEH_begin_vpaes_set_decrypt_key::
668 mov rdi,rcx
669 mov rsi,rdx
670 mov rdx,r8
671
672
673 lea rsp,QWORD PTR[((-184))+rsp]
674 movaps XMMWORD PTR[16+rsp],xmm6
675 movaps XMMWORD PTR[32+rsp],xmm7
676 movaps XMMWORD PTR[48+rsp],xmm8
677 movaps XMMWORD PTR[64+rsp],xmm9
678 movaps XMMWORD PTR[80+rsp],xmm10
679 movaps XMMWORD PTR[96+rsp],xmm11
680 movaps XMMWORD PTR[112+rsp],xmm12
681 movaps XMMWORD PTR[128+rsp],xmm13
682 movaps XMMWORD PTR[144+rsp],xmm14
683 movaps XMMWORD PTR[160+rsp],xmm15
684 $L$dec_key_body::
685 mov eax,esi
686 shr eax,5
687 add eax,5
688 mov DWORD PTR[240+rdx],eax
689 shl eax,4
690 lea rdx,QWORD PTR[16+rax*1+rdx]
691
692 mov ecx,1
693 mov r8d,esi
694 shr r8d,1
695 and r8d,32
696 xor r8d,32
697 call _vpaes_schedule_core
698 movaps xmm6,XMMWORD PTR[16+rsp]
699 movaps xmm7,XMMWORD PTR[32+rsp]
700 movaps xmm8,XMMWORD PTR[48+rsp]
701 movaps xmm9,XMMWORD PTR[64+rsp]
702 movaps xmm10,XMMWORD PTR[80+rsp]
703 movaps xmm11,XMMWORD PTR[96+rsp]
704 movaps xmm12,XMMWORD PTR[112+rsp]
705 movaps xmm13,XMMWORD PTR[128+rsp]
706 movaps xmm14,XMMWORD PTR[144+rsp]
707 movaps xmm15,XMMWORD PTR[160+rsp]
708 lea rsp,QWORD PTR[184+rsp]
709 $L$dec_key_epilogue::
710 xor eax,eax
711 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
712 mov rsi,QWORD PTR[16+rsp]
713 DB 0F3h,0C3h ;repret
714 $L$SEH_end_vpaes_set_decrypt_key::
715 vpaes_set_decrypt_key ENDP
716
717 PUBLIC vpaes_encrypt
718
719 ALIGN 16
720 vpaes_encrypt PROC PUBLIC
721 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
722 mov QWORD PTR[16+rsp],rsi
723 mov rax,rsp
724 $L$SEH_begin_vpaes_encrypt::
725 mov rdi,rcx
726 mov rsi,rdx
727 mov rdx,r8
728
729
730 lea rsp,QWORD PTR[((-184))+rsp]
731 movaps XMMWORD PTR[16+rsp],xmm6
732 movaps XMMWORD PTR[32+rsp],xmm7
733 movaps XMMWORD PTR[48+rsp],xmm8
734 movaps XMMWORD PTR[64+rsp],xmm9
735 movaps XMMWORD PTR[80+rsp],xmm10
736 movaps XMMWORD PTR[96+rsp],xmm11
737 movaps XMMWORD PTR[112+rsp],xmm12
738 movaps XMMWORD PTR[128+rsp],xmm13
739 movaps XMMWORD PTR[144+rsp],xmm14
740 movaps XMMWORD PTR[160+rsp],xmm15
741 $L$enc_body::
742 movdqu xmm0,XMMWORD PTR[rdi]
743 call _vpaes_preheat
744 call _vpaes_encrypt_core
745 movdqu XMMWORD PTR[rsi],xmm0
746 movaps xmm6,XMMWORD PTR[16+rsp]
747 movaps xmm7,XMMWORD PTR[32+rsp]
748 movaps xmm8,XMMWORD PTR[48+rsp]
749 movaps xmm9,XMMWORD PTR[64+rsp]
750 movaps xmm10,XMMWORD PTR[80+rsp]
751 movaps xmm11,XMMWORD PTR[96+rsp]
752 movaps xmm12,XMMWORD PTR[112+rsp]
753 movaps xmm13,XMMWORD PTR[128+rsp]
754 movaps xmm14,XMMWORD PTR[144+rsp]
755 movaps xmm15,XMMWORD PTR[160+rsp]
756 lea rsp,QWORD PTR[184+rsp]
757 $L$enc_epilogue::
758 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
759 mov rsi,QWORD PTR[16+rsp]
760 DB 0F3h,0C3h ;repret
761 $L$SEH_end_vpaes_encrypt::
762 vpaes_encrypt ENDP
763
764 PUBLIC vpaes_decrypt
765
766 ALIGN 16
767 vpaes_decrypt PROC PUBLIC
768 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
769 mov QWORD PTR[16+rsp],rsi
770 mov rax,rsp
771 $L$SEH_begin_vpaes_decrypt::
772 mov rdi,rcx
773 mov rsi,rdx
774 mov rdx,r8
775
776
777 lea rsp,QWORD PTR[((-184))+rsp]
778 movaps XMMWORD PTR[16+rsp],xmm6
779 movaps XMMWORD PTR[32+rsp],xmm7
780 movaps XMMWORD PTR[48+rsp],xmm8
781 movaps XMMWORD PTR[64+rsp],xmm9
782 movaps XMMWORD PTR[80+rsp],xmm10
783 movaps XMMWORD PTR[96+rsp],xmm11
784 movaps XMMWORD PTR[112+rsp],xmm12
785 movaps XMMWORD PTR[128+rsp],xmm13
786 movaps XMMWORD PTR[144+rsp],xmm14
787 movaps XMMWORD PTR[160+rsp],xmm15
788 $L$dec_body::
789 movdqu xmm0,XMMWORD PTR[rdi]
790 call _vpaes_preheat
791 call _vpaes_decrypt_core
792 movdqu XMMWORD PTR[rsi],xmm0
793 movaps xmm6,XMMWORD PTR[16+rsp]
794 movaps xmm7,XMMWORD PTR[32+rsp]
795 movaps xmm8,XMMWORD PTR[48+rsp]
796 movaps xmm9,XMMWORD PTR[64+rsp]
797 movaps xmm10,XMMWORD PTR[80+rsp]
798 movaps xmm11,XMMWORD PTR[96+rsp]
799 movaps xmm12,XMMWORD PTR[112+rsp]
800 movaps xmm13,XMMWORD PTR[128+rsp]
801 movaps xmm14,XMMWORD PTR[144+rsp]
802 movaps xmm15,XMMWORD PTR[160+rsp]
803 lea rsp,QWORD PTR[184+rsp]
804 $L$dec_epilogue::
805 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
806 mov rsi,QWORD PTR[16+rsp]
807 DB 0F3h,0C3h ;repret
808 $L$SEH_end_vpaes_decrypt::
809 vpaes_decrypt ENDP
810 PUBLIC vpaes_cbc_encrypt
811
812 ALIGN 16
813 vpaes_cbc_encrypt PROC PUBLIC
814 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
815 mov QWORD PTR[16+rsp],rsi
816 mov rax,rsp
817 $L$SEH_begin_vpaes_cbc_encrypt::
818 mov rdi,rcx
819 mov rsi,rdx
820 mov rdx,r8
821 mov rcx,r9
822 mov r8,QWORD PTR[40+rsp]
823 mov r9,QWORD PTR[48+rsp]
824
825
826 xchg rdx,rcx
827 sub rcx,16
828 jc $L$cbc_abort
829 lea rsp,QWORD PTR[((-184))+rsp]
830 movaps XMMWORD PTR[16+rsp],xmm6
831 movaps XMMWORD PTR[32+rsp],xmm7
832 movaps XMMWORD PTR[48+rsp],xmm8
833 movaps XMMWORD PTR[64+rsp],xmm9
834 movaps XMMWORD PTR[80+rsp],xmm10
835 movaps XMMWORD PTR[96+rsp],xmm11
836 movaps XMMWORD PTR[112+rsp],xmm12
837 movaps XMMWORD PTR[128+rsp],xmm13
838 movaps XMMWORD PTR[144+rsp],xmm14
839 movaps XMMWORD PTR[160+rsp],xmm15
840 $L$cbc_body::
841 movdqu xmm6,XMMWORD PTR[r8]
842 sub rsi,rdi
843 call _vpaes_preheat
844 cmp r9d,0
845 je $L$cbc_dec_loop
846 jmp $L$cbc_enc_loop
847 ALIGN 16
848 $L$cbc_enc_loop::
849 movdqu xmm0,XMMWORD PTR[rdi]
850 pxor xmm0,xmm6
851 call _vpaes_encrypt_core
852 movdqa xmm6,xmm0
853 movdqu XMMWORD PTR[rdi*1+rsi],xmm0
854 lea rdi,QWORD PTR[16+rdi]
855 sub rcx,16
856 jnc $L$cbc_enc_loop
857 jmp $L$cbc_done
858 ALIGN 16
859 $L$cbc_dec_loop::
860 movdqu xmm0,XMMWORD PTR[rdi]
861 movdqa xmm7,xmm0
862 call _vpaes_decrypt_core
863 pxor xmm0,xmm6
864 movdqa xmm6,xmm7
865 movdqu XMMWORD PTR[rdi*1+rsi],xmm0
866 lea rdi,QWORD PTR[16+rdi]
867 sub rcx,16
868 jnc $L$cbc_dec_loop
869 $L$cbc_done::
870 movdqu XMMWORD PTR[r8],xmm6
871 movaps xmm6,XMMWORD PTR[16+rsp]
872 movaps xmm7,XMMWORD PTR[32+rsp]
873 movaps xmm8,XMMWORD PTR[48+rsp]
874 movaps xmm9,XMMWORD PTR[64+rsp]
875 movaps xmm10,XMMWORD PTR[80+rsp]
876 movaps xmm11,XMMWORD PTR[96+rsp]
877 movaps xmm12,XMMWORD PTR[112+rsp]
878 movaps xmm13,XMMWORD PTR[128+rsp]
879 movaps xmm14,XMMWORD PTR[144+rsp]
880 movaps xmm15,XMMWORD PTR[160+rsp]
881 lea rsp,QWORD PTR[184+rsp]
882 $L$cbc_epilogue::
883 $L$cbc_abort::
884 mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue
885 mov rsi,QWORD PTR[16+rsp]
886 DB 0F3h,0C3h ;repret
887 $L$SEH_end_vpaes_cbc_encrypt::
888 vpaes_cbc_encrypt ENDP
889
890
891
892
893
894
895
896 ALIGN 16
897 _vpaes_preheat PROC PRIVATE
898 lea r10,QWORD PTR[$L$k_s0F]
899 movdqa xmm10,XMMWORD PTR[((-32))+r10]
900 movdqa xmm11,XMMWORD PTR[((-16))+r10]
901 movdqa xmm9,XMMWORD PTR[r10]
902 movdqa xmm13,XMMWORD PTR[48+r10]
903 movdqa xmm12,XMMWORD PTR[64+r10]
904 movdqa xmm15,XMMWORD PTR[80+r10]
905 movdqa xmm14,XMMWORD PTR[96+r10]
906 DB 0F3h,0C3h ;repret
907 _vpaes_preheat ENDP
908
909
910
911
912
913
914 ALIGN 64
915 _vpaes_consts::
916 $L$k_inv::
917 DQ 00E05060F0D080180h,0040703090A0B0C02h
918 DQ 001040A060F0B0780h,0030D0E0C02050809h
919
920 $L$k_s0F::
921 DQ 00F0F0F0F0F0F0F0Fh,00F0F0F0F0F0F0F0Fh
922
923 $L$k_ipt::
924 DQ 0C2B2E8985A2A7000h,0CABAE09052227808h
925 DQ 04C01307D317C4D00h,0CD80B1FCB0FDCC81h
926
927 $L$k_sb1::
928 DQ 0B19BE18FCB503E00h,0A5DF7A6E142AF544h
929 DQ 03618D415FAE22300h,03BF7CCC10D2ED9EFh
930 $L$k_sb2::
931 DQ 0E27A93C60B712400h,05EB7E955BC982FCDh
932 DQ 069EB88400AE12900h,0C2A163C8AB82234Ah
933 $L$k_sbo::
934 DQ 0D0D26D176FBDC700h,015AABF7AC502A878h
935 DQ 0CFE474A55FBB6A00h,08E1E90D1412B35FAh
936
937 $L$k_mc_forward::
938 DQ 00407060500030201h,00C0F0E0D080B0A09h
939 DQ 0080B0A0904070605h,0000302010C0F0E0Dh
940 DQ 00C0F0E0D080B0A09h,00407060500030201h
941 DQ 0000302010C0F0E0Dh,0080B0A0904070605h
942
943 $L$k_mc_backward::
944 DQ 00605040702010003h,00E0D0C0F0A09080Bh
945 DQ 0020100030E0D0C0Fh,00A09080B06050407h
946 DQ 00E0D0C0F0A09080Bh,00605040702010003h
947 DQ 00A09080B06050407h,0020100030E0D0C0Fh
948
949 $L$k_sr::
950 DQ 00706050403020100h,00F0E0D0C0B0A0908h
951 DQ 0030E09040F0A0500h,00B06010C07020D08h
952 DQ 00F060D040B020900h,0070E050C030A0108h
953 DQ 00B0E0104070A0D00h,00306090C0F020508h
954
955 $L$k_rcon::
956 DQ 01F8391B9AF9DEEB6h,0702A98084D7C7D81h
957
958 $L$k_s63::
959 DQ 05B5B5B5B5B5B5B5Bh,05B5B5B5B5B5B5B5Bh
960
961 $L$k_opt::
962 DQ 0FF9F4929D6B66000h,0F7974121DEBE6808h
963 DQ 001EDBD5150BCEC00h,0E10D5DB1B05C0CE0h
964
965 $L$k_deskew::
966 DQ 007E4A34047A4E300h,01DFEB95A5DBEF91Ah
967 DQ 05F36B5DC83EA6900h,02841C2ABF49D1E77h
968
969
970
971
972
973 $L$k_dksd::
974 DQ 0FEB91A5DA3E44700h,00740E3A45A1DBEF9h
975 DQ 041C277F4B5368300h,05FDC69EAAB289D1Eh
976 $L$k_dksb::
977 DQ 09A4FCA1F8550D500h,003D653861CC94C99h
978 DQ 0115BEDA7B6FC4A00h,0D993256F7E3482C8h
979 $L$k_dkse::
980 DQ 0D5031CCA1FC9D600h,053859A4C994F5086h
981 DQ 0A23196054FDC7BE8h,0CD5EF96A20B31487h
982 $L$k_dks9::
983 DQ 0B6116FC87ED9A700h,04AED933482255BFCh
984 DQ 04576516227143300h,08BB89FACE9DAFDCEh
985
986
987
988
989
990 $L$k_dipt::
991 DQ 00F505B040B545F00h,0154A411E114E451Ah
992 DQ 086E383E660056500h,012771772F491F194h
993
994 $L$k_dsb9::
995 DQ 0851C03539A86D600h,0CAD51F504F994CC9h
996 DQ 0C03B1789ECD74900h,0725E2C9EB2FBA565h
997 $L$k_dsbd::
998 DQ 07D57CCDFE6B1A200h,0F56E9B13882A4439h
999 DQ 03CE2FAF724C6CB00h,02931180D15DEEFD3h
1000 $L$k_dsbb::
1001 DQ 0D022649296B44200h,0602646F6B0F2D404h
1002 DQ 0C19498A6CD596700h,0F3FF0C3E3255AA6Bh
1003 $L$k_dsbe::
1004 DQ 046F2929626D4D000h,02242600464B4F6B0h
1005 DQ 00C55A6CDFFAAC100h,09467F36B98593E32h
1006 $L$k_dsbo::
1007 DQ 01387EA537EF94000h,0C7AA6DB9D4943E2Dh
1008 DQ 012D7560F93441D00h,0CA4B8159D8C58E9Ch
1009 DB 86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
1010 DB 111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54
1011 DB 52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97
1012 DB 109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32
1013 DB 85,110,105,118,101,114,115,105,116,121,41,0
1014 ALIGN 64
1015
1016 EXTERN __imp_RtlVirtualUnwind:NEAR
1017
1018 ALIGN 16
1019 se_handler PROC PRIVATE
1020 push rsi
1021 push rdi
1022 push rbx
1023 push rbp
1024 push r12
1025 push r13
1026 push r14
1027 push r15
1028 pushfq
1029 sub rsp,64
1030
1031 mov rax,QWORD PTR[120+r8]
1032 mov rbx,QWORD PTR[248+r8]
1033
1034 mov rsi,QWORD PTR[8+r9]
1035 mov r11,QWORD PTR[56+r9]
1036
1037 mov r10d,DWORD PTR[r11]
1038 lea r10,QWORD PTR[r10*1+rsi]
1039 cmp rbx,r10
1040 jb $L$in_prologue
1041
1042 mov rax,QWORD PTR[152+r8]
1043
1044 mov r10d,DWORD PTR[4+r11]
1045 lea r10,QWORD PTR[r10*1+rsi]
1046 cmp rbx,r10
1047 jae $L$in_prologue
1048
1049 lea rsi,QWORD PTR[16+rax]
1050 lea rdi,QWORD PTR[512+r8]
1051 mov ecx,20
1052 DD 0a548f3fch
1053 lea rax,QWORD PTR[184+rax]
1054
1055 $L$in_prologue::
1056 mov rdi,QWORD PTR[8+rax]
1057 mov rsi,QWORD PTR[16+rax]
1058 mov QWORD PTR[152+r8],rax
1059 mov QWORD PTR[168+r8],rsi
1060 mov QWORD PTR[176+r8],rdi
1061
1062 mov rdi,QWORD PTR[40+r9]
1063 mov rsi,r8
1064 mov ecx,154
1065 DD 0a548f3fch
1066
1067 mov rsi,r9
1068 xor rcx,rcx
1069 mov rdx,QWORD PTR[8+rsi]
1070 mov r8,QWORD PTR[rsi]
1071 mov r9,QWORD PTR[16+rsi]
1072 mov r10,QWORD PTR[40+rsi]
1073 lea r11,QWORD PTR[56+rsi]
1074 lea r12,QWORD PTR[24+rsi]
1075 mov QWORD PTR[32+rsp],r10
1076 mov QWORD PTR[40+rsp],r11
1077 mov QWORD PTR[48+rsp],r12
1078 mov QWORD PTR[56+rsp],rcx
1079 call QWORD PTR[__imp_RtlVirtualUnwind]
1080
1081 mov eax,1
1082 add rsp,64
1083 popfq
1084 pop r15
1085 pop r14
1086 pop r13
1087 pop r12
1088 pop rbp
1089 pop rbx
1090 pop rdi
1091 pop rsi
1092 DB 0F3h,0C3h ;repret
1093 se_handler ENDP
1094
1095 .text$ ENDS
1096 .pdata SEGMENT READONLY ALIGN(4)
1097 ALIGN 4
1098 DD imagerel $L$SEH_begin_vpaes_set_encrypt_key
1099 DD imagerel $L$SEH_end_vpaes_set_encrypt_key
1100 DD imagerel $L$SEH_info_vpaes_set_encrypt_key
1101
1102 DD imagerel $L$SEH_begin_vpaes_set_decrypt_key
1103 DD imagerel $L$SEH_end_vpaes_set_decrypt_key
1104 DD imagerel $L$SEH_info_vpaes_set_decrypt_key
1105
1106 DD imagerel $L$SEH_begin_vpaes_encrypt
1107 DD imagerel $L$SEH_end_vpaes_encrypt
1108 DD imagerel $L$SEH_info_vpaes_encrypt
1109
1110 DD imagerel $L$SEH_begin_vpaes_decrypt
1111 DD imagerel $L$SEH_end_vpaes_decrypt
1112 DD imagerel $L$SEH_info_vpaes_decrypt
1113
1114 DD imagerel $L$SEH_begin_vpaes_cbc_encrypt
1115 DD imagerel $L$SEH_end_vpaes_cbc_encrypt
1116 DD imagerel $L$SEH_info_vpaes_cbc_encrypt
1117
1118 .pdata ENDS
1119 .xdata SEGMENT READONLY ALIGN(8)
1120 ALIGN 8
1121 $L$SEH_info_vpaes_set_encrypt_key::
1122 DB 9,0,0,0
1123 DD imagerel se_handler
1124 DD imagerel $L$enc_key_body,imagerel $L$enc_key_epilogue
1125 $L$SEH_info_vpaes_set_decrypt_key::
1126 DB 9,0,0,0
1127 DD imagerel se_handler
1128 DD imagerel $L$dec_key_body,imagerel $L$dec_key_epilogue
1129 $L$SEH_info_vpaes_encrypt::
1130 DB 9,0,0,0
1131 DD imagerel se_handler
1132 DD imagerel $L$enc_body,imagerel $L$enc_epilogue
1133 $L$SEH_info_vpaes_decrypt::
1134 DB 9,0,0,0
1135 DD imagerel se_handler
1136 DD imagerel $L$dec_body,imagerel $L$dec_epilogue
1137 $L$SEH_info_vpaes_cbc_encrypt::
1138 DB 9,0,0,0
1139 DD imagerel se_handler
1140 DD imagerel $L$cbc_body,imagerel $L$cbc_epilogue
1141
1142 .xdata ENDS
1143 END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698