5 section .text code
align=64
8 EXTERN OPENSSL_ia32cap_P
14 mov QWORD[8+rsp
],rdi
;WIN64 prologue
17 $L$
SEH_begin_rsaz_512_sqr:
37 mov QWORD[128+rsp
],rcx
42 mov DWORD[((128+8))+rsp
],r8d
100 mov rax
,QWORD[16+rsi
]
103 mov rax
,QWORD[24+rsi
]
109 mov rax
,QWORD[32+rsi
]
117 mov rax
,QWORD[40+rsi
]
125 mov rax
,QWORD[48+rsi
]
133 mov rax
,QWORD[56+rsi
]
159 mov QWORD[24+rsp
],r10
164 mov rax
,QWORD[24+rsi
]
167 mov rax
,QWORD[32+rsi
]
173 mov rax
,QWORD[40+rsi
]
181 mov rax
,QWORD[48+rsi
]
191 mov rax
,QWORD[56+rsi
]
214 mov QWORD[32+rsp
],r11
215 mov QWORD[40+rsp
],r12
219 mov r10
,QWORD[24+rsi
]
220 mov rax
,QWORD[32+rsi
]
223 mov rax
,QWORD[40+rsi
]
229 mov rax
,QWORD[48+rsi
]
239 mov rax
,QWORD[56+rsi
]
262 mov QWORD[48+rsp
],r13
263 mov QWORD[56+rsp
],r14
267 mov r11
,QWORD[32+rsi
]
268 mov rax
,QWORD[40+rsi
]
271 mov rax
,QWORD[48+rsi
]
277 mov rax
,QWORD[56+rsi
]
302 mov QWORD[64+rsp
],r15
307 mov r12
,QWORD[40+rsi
]
308 mov rax
,QWORD[48+rsi
]
311 mov rax
,QWORD[56+rsi
]
335 mov QWORD[88+rsp
],r10
338 mov r13
,QWORD[48+rsi
]
339 mov rax
,QWORD[56+rsi
]
357 mov QWORD[96+rsp
],r11
358 mov QWORD[104+rsp
],r12
361 mov rax
,QWORD[56+rsi
]
368 mov QWORD[112+rsp
],r13
369 mov QWORD[120+rsp
],r14
373 mov r10
,QWORD[16+rsp
]
374 mov r11
,QWORD[24+rsp
]
375 mov r12
,QWORD[32+rsp
]
376 mov r13
,QWORD[40+rsp
]
377 mov r14
,QWORD[48+rsp
]
378 mov r15
,QWORD[56+rsp
]
380 call __rsaz_512_reduce
384 adc r10
,QWORD[80+rsp
]
385 adc r11
,QWORD[88+rsp
]
386 adc r12
,QWORD[96+rsp
]
387 adc r13
,QWORD[104+rsp
]
388 adc r14
,QWORD[112+rsp
]
389 adc r15
,QWORD[120+rsp
]
392 call __rsaz_512_subtract
396 mov r8d
,DWORD[((128+8))+rsp
]
402 lea rax
,[((128+24+48))+rsp
]
403 mov r15
,QWORD[((-48))+rax
]
404 mov r14
,QWORD[((-40))+rax
]
405 mov r13
,QWORD[((-32))+rax
]
406 mov r12
,QWORD[((-24))+rax
]
407 mov rbp
,QWORD[((-16))+rax
]
408 mov rbx
,QWORD[((-8))+rax
]
411 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
412 mov rsi
,QWORD[16+rsp
]
414 $L$
SEH_end_rsaz_512_sqr:
419 mov QWORD[8+rsp
],rdi
;WIN64 prologue
420 mov QWORD[16+rsp
],rsi
422 $L$
SEH_begin_rsaz_512_mul:
441 mov QWORD[128+rsp
],r8
451 mov r10
,QWORD[16+rsp
]
452 mov r11
,QWORD[24+rsp
]
453 mov r12
,QWORD[32+rsp
]
454 mov r13
,QWORD[40+rsp
]
455 mov r14
,QWORD[48+rsp
]
456 mov r15
,QWORD[56+rsp
]
458 call __rsaz_512_reduce
461 adc r10
,QWORD[80+rsp
]
462 adc r11
,QWORD[88+rsp
]
463 adc r12
,QWORD[96+rsp
]
464 adc r13
,QWORD[104+rsp
]
465 adc r14
,QWORD[112+rsp
]
466 adc r15
,QWORD[120+rsp
]
469 call __rsaz_512_subtract
471 lea rax
,[((128+24+48))+rsp
]
472 mov r15
,QWORD[((-48))+rax
]
473 mov r14
,QWORD[((-40))+rax
]
474 mov r13
,QWORD[((-32))+rax
]
475 mov r12
,QWORD[((-24))+rax
]
476 mov rbp
,QWORD[((-16))+rax
]
477 mov rbx
,QWORD[((-8))+rax
]
480 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
481 mov rsi
,QWORD[16+rsp
]
483 $L$
SEH_end_rsaz_512_mul:
484 global rsaz_512_mul_gather4
487 rsaz_512_mul_gather4:
488 mov QWORD[8+rsp
],rdi
;WIN64 prologue
489 mov QWORD[16+rsp
],rsi
491 $L$
SEH_begin_rsaz_512_mul_gather4:
510 mov eax,DWORD[64+r9
*4+rdx
]
512 mov ebx,DWORD[r9
*4+rdx
]
514 mov QWORD[128+rsp
],r8
520 lea rbp
,[128+r9
*4+rdx
]
529 mov rax
,QWORD[16+rsi
]
534 movd xmm5
,DWORD[64+rbp
]
536 mov rax
,QWORD[24+rsi
]
543 mov rax
,QWORD[32+rsi
]
550 mov rax
,QWORD[40+rsi
]
556 mov rax
,QWORD[48+rsi
]
563 mov rax
,QWORD[56+rsi
]
576 jmp NEAR $L$oop_mul_gather
590 mov rax
,QWORD[16+rsi
]
597 movd xmm5
,DWORD[64+rbp
]
599 mov rax
,QWORD[24+rsi
]
608 mov rax
,QWORD[32+rsi
]
617 mov rax
,QWORD[40+rsi
]
625 mov rax
,QWORD[48+rsi
]
633 mov rax
,QWORD[56+rsi
]
652 jnz NEAR $L$oop_mul_gather
656 mov QWORD[16+rdi
],r10
657 mov QWORD[24+rdi
],r11
658 mov QWORD[32+rdi
],r12
659 mov QWORD[40+rdi
],r13
660 mov QWORD[48+rdi
],r14
661 mov QWORD[56+rdi
],r15
668 mov r10
,QWORD[16+rsp
]
669 mov r11
,QWORD[24+rsp
]
670 mov r12
,QWORD[32+rsp
]
671 mov r13
,QWORD[40+rsp
]
672 mov r14
,QWORD[48+rsp
]
673 mov r15
,QWORD[56+rsp
]
675 call __rsaz_512_reduce
678 adc r10
,QWORD[80+rsp
]
679 adc r11
,QWORD[88+rsp
]
680 adc r12
,QWORD[96+rsp
]
681 adc r13
,QWORD[104+rsp
]
682 adc r14
,QWORD[112+rsp
]
683 adc r15
,QWORD[120+rsp
]
686 call __rsaz_512_subtract
688 lea rax
,[((128+24+48))+rsp
]
689 mov r15
,QWORD[((-48))+rax
]
690 mov r14
,QWORD[((-40))+rax
]
691 mov r13
,QWORD[((-32))+rax
]
692 mov r12
,QWORD[((-24))+rax
]
693 mov rbp
,QWORD[((-16))+rax
]
694 mov rbx
,QWORD[((-8))+rax
]
696 $L$
mul_gather4_epilogue:
697 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
698 mov rsi
,QWORD[16+rsp
]
700 $L$
SEH_end_rsaz_512_mul_gather4:
701 global rsaz_512_mul_scatter4
704 rsaz_512_mul_scatter4:
705 mov QWORD[8+rsp
],rdi
;WIN64 prologue
706 mov QWORD[16+rsp
],rsi
708 $L$
SEH_begin_rsaz_512_mul_scatter4:
726 $L$
mul_scatter4_body:
731 mov QWORD[128+rsp
],rcx
742 mov r10
,QWORD[16+rsp
]
743 mov r11
,QWORD[24+rsp
]
744 mov r12
,QWORD[32+rsp
]
745 mov r13
,QWORD[40+rsp
]
746 mov r14
,QWORD[48+rsp
]
747 mov r15
,QWORD[56+rsp
]
749 call __rsaz_512_reduce
752 adc r10
,QWORD[80+rsp
]
753 adc r11
,QWORD[88+rsp
]
754 adc r12
,QWORD[96+rsp
]
755 adc r13
,QWORD[104+rsp
]
756 adc r14
,QWORD[112+rsp
]
757 adc r15
,QWORD[120+rsp
]
761 call __rsaz_512_subtract
765 mov DWORD[128+rsi
],r9d
767 mov DWORD[256+rsi
],r10d
769 mov DWORD[384+rsi
],r11d
771 mov DWORD[512+rsi
],r12d
773 mov DWORD[640+rsi
],r13d
775 mov DWORD[768+rsi
],r14d
777 mov DWORD[896+rsi
],r15d
779 mov DWORD[64+rsi
],r8d
780 mov DWORD[192+rsi
],r9d
781 mov DWORD[320+rsi
],r10d
782 mov DWORD[448+rsi
],r11d
783 mov DWORD[576+rsi
],r12d
784 mov DWORD[704+rsi
],r13d
785 mov DWORD[832+rsi
],r14d
786 mov DWORD[960+rsi
],r15d
788 lea rax
,[((128+24+48))+rsp
]
789 mov r15
,QWORD[((-48))+rax
]
790 mov r14
,QWORD[((-40))+rax
]
791 mov r13
,QWORD[((-32))+rax
]
792 mov r12
,QWORD[((-24))+rax
]
793 mov rbp
,QWORD[((-16))+rax
]
794 mov rbx
,QWORD[((-8))+rax
]
796 $L$
mul_scatter4_epilogue:
797 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
798 mov rsi
,QWORD[16+rsp
]
800 $L$
SEH_end_rsaz_512_mul_scatter4:
801 global rsaz_512_mul_by_one
805 mov QWORD[8+rsp
],rdi
;WIN64 prologue
806 mov QWORD[16+rsp
],rsi
808 $L$
SEH_begin_rsaz_512_mul_by_one:
825 mov QWORD[128+rsp
],rcx
830 mov r10
,QWORD[16+rsi
]
831 mov r11
,QWORD[24+rsi
]
832 mov r12
,QWORD[32+rsi
]
833 mov r13
,QWORD[40+rsi
]
834 mov r14
,QWORD[48+rsi
]
835 mov r15
,QWORD[56+rsi
]
837 movdqa XMMWORD
[rsp
],xmm0
838 movdqa XMMWORD
[16+rsp
],xmm0
839 movdqa XMMWORD
[32+rsp
],xmm0
840 movdqa XMMWORD
[48+rsp
],xmm0
841 movdqa XMMWORD
[64+rsp
],xmm0
842 movdqa XMMWORD
[80+rsp
],xmm0
843 movdqa XMMWORD
[96+rsp
],xmm0
844 call __rsaz_512_reduce
847 mov QWORD[16+rdi
],r10
848 mov QWORD[24+rdi
],r11
849 mov QWORD[32+rdi
],r12
850 mov QWORD[40+rdi
],r13
851 mov QWORD[48+rdi
],r14
852 mov QWORD[56+rdi
],r15
854 lea rax
,[((128+24+48))+rsp
]
855 mov r15
,QWORD[((-48))+rax
]
856 mov r14
,QWORD[((-40))+rax
]
857 mov r13
,QWORD[((-32))+rax
]
858 mov r12
,QWORD[((-24))+rax
]
859 mov rbp
,QWORD[((-16))+rax
]
860 mov rbx
,QWORD[((-8))+rax
]
862 $L$
mul_by_one_epilogue:
863 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
864 mov rsi
,QWORD[16+rsp
]
866 $L$
SEH_end_rsaz_512_mul_by_one:
871 imul rbx
,QWORD[((128+8))+rsp
]
874 jmp NEAR $L$reduction_loop
886 mov rax
,QWORD[16+rbp
]
894 mov rax
,QWORD[24+rbp
]
902 mov rax
,QWORD[32+rbp
]
905 mov rsi
,QWORD[((128+8))+rsp
]
913 mov rax
,QWORD[40+rbp
]
922 mov rax
,QWORD[48+rbp
]
930 mov rax
,QWORD[56+rbp
]
946 jne NEAR $L$reduction_loop
955 mov QWORD[16+rdi
],r10
956 mov QWORD[24+rdi
],r11
957 mov QWORD[32+rdi
],r12
958 mov QWORD[40+rdi
],r13
959 mov QWORD[48+rdi
],r14
960 mov QWORD[56+rdi
],r15
967 mov r10
,QWORD[16+rbp
]
970 mov r11
,QWORD[24+rbp
]
973 mov r12
,QWORD[32+rbp
]
976 mov r13
,QWORD[40+rbp
]
979 mov r14
,QWORD[48+rbp
]
982 mov r15
,QWORD[56+rbp
]
989 adc r10
,QWORD[16+rdi
]
990 adc r11
,QWORD[24+rdi
]
991 adc r12
,QWORD[32+rdi
]
992 adc r13
,QWORD[40+rdi
]
993 adc r14
,QWORD[48+rdi
]
994 adc r15
,QWORD[56+rdi
]
998 mov QWORD[16+rdi
],r10
999 mov QWORD[24+rdi
],r11
1000 mov QWORD[32+rdi
],r12
1001 mov QWORD[40+rdi
],r13
1002 mov QWORD[48+rdi
],r14
1003 mov QWORD[56+rdi
],r15
1005 DB 0F3h
,0C3h
;repret
1015 mov rax
,QWORD[8+rsi
]
1020 mov rax
,QWORD[16+rsi
]
1026 mov rax
,QWORD[24+rsi
]
1032 mov rax
,QWORD[32+rsi
]
1038 mov rax
,QWORD[40+rsi
]
1044 mov rax
,QWORD[48+rsi
]
1050 mov rax
,QWORD[56+rsi
]
1071 mov rax
,QWORD[8+rsi
]
1078 mov rax
,QWORD[16+rsi
]
1086 mov rax
,QWORD[24+rsi
]
1094 mov rax
,QWORD[32+rsi
]
1102 mov rax
,QWORD[40+rsi
]
1110 mov rax
,QWORD[48+rsi
]
1118 mov rax
,QWORD[56+rsi
]
1140 mov QWORD[16+rdi
],r10
1141 mov QWORD[24+rdi
],r11
1142 mov QWORD[32+rdi
],r12
1143 mov QWORD[40+rdi
],r13
1144 mov QWORD[48+rdi
],r14
1145 mov QWORD[56+rdi
],r15
1147 DB 0F3h
,0C3h
;repret
1149 global rsaz_512_scatter4
1155 jmp NEAR $L$oop_scatter
1162 mov DWORD[64+rcx
],eax
1165 jnz NEAR $L$oop_scatter
1166 DB 0F3h
,0C3h
;repret
1169 global rsaz_512_gather4
1175 jmp NEAR $L$oop_gather
1179 mov r8d
,DWORD[64+rdx
]
1186 jnz NEAR $L$oop_gather
1187 DB 0F3h
,0C3h
;repret
1189 EXTERN __imp_RtlVirtualUnwind
1204 mov rax
,QWORD[120+r8
]
1205 mov rbx
,QWORD[248+r8
]
1208 mov r11
,QWORD[56+r9
]
1213 jb NEAR $L
$common_seh_tail
1215 mov rax
,QWORD[152+r8
]
1217 mov r10d
,DWORD[4+r11
]
1220 jae NEAR $L
$common_seh_tail
1222 lea rax
,[((128+24+48))+rax
]
1224 mov rbx
,QWORD[((-8))+rax
]
1225 mov rbp
,QWORD[((-16))+rax
]
1226 mov r12
,QWORD[((-24))+rax
]
1227 mov r13
,QWORD[((-32))+rax
]
1228 mov r14
,QWORD[((-40))+rax
]
1229 mov r15
,QWORD[((-48))+rax
]
1230 mov QWORD[144+r8
],rbx
1231 mov QWORD[160+r8
],rbp
1232 mov QWORD[216+r8
],r12
1233 mov QWORD[224+r8
],r13
1234 mov QWORD[232+r8
],r14
1235 mov QWORD[240+r8
],r15
1238 mov rdi
,QWORD[8+rax
]
1239 mov rsi
,QWORD[16+rax
]
1240 mov QWORD[152+r8
],rax
1241 mov QWORD[168+r8
],rsi
1242 mov QWORD[176+r8
],rdi
1244 mov rdi
,QWORD[40+r9
]
1251 mov rdx
,QWORD[8+rsi
]
1253 mov r9
,QWORD[16+rsi
]
1254 mov r10
,QWORD[40+rsi
]
1257 mov QWORD[32+rsp
],r10
1258 mov QWORD[40+rsp
],r11
1259 mov QWORD[48+rsp
],r12
1260 mov QWORD[56+rsp
],rcx
1261 call QWORD[__imp_RtlVirtualUnwind
]
1274 DB 0F3h
,0C3h
;repret
1277 section .pdata rdata
align=4
1279 DD $L$SEH_begin_rsaz_512_sqr wrt ..imagebase
1280 DD $L$SEH_end_rsaz_512_sqr wrt ..imagebase
1281 DD $L$SEH_info_rsaz_512_sqr wrt ..imagebase
1283 DD $L$SEH_begin_rsaz_512_mul wrt ..imagebase
1284 DD $L$SEH_end_rsaz_512_mul wrt ..imagebase
1285 DD $L$SEH_info_rsaz_512_mul wrt ..imagebase
1287 DD $L$SEH_begin_rsaz_512_mul_gather4 wrt ..imagebase
1288 DD $L$SEH_end_rsaz_512_mul_gather4 wrt ..imagebase
1289 DD $L$SEH_info_rsaz_512_mul_gather4 wrt ..imagebase
1291 DD $L$SEH_begin_rsaz_512_mul_scatter4 wrt ..imagebase
1292 DD $L$SEH_end_rsaz_512_mul_scatter4 wrt ..imagebase
1293 DD $L$SEH_info_rsaz_512_mul_scatter4 wrt ..imagebase
1295 DD $L$SEH_begin_rsaz_512_mul_by_one wrt ..imagebase
1296 DD $L$SEH_end_rsaz_512_mul_by_one wrt ..imagebase
1297 DD $L$SEH_info_rsaz_512_mul_by_one wrt ..imagebase
1299 section .xdata rdata
align=8
1301 $L$
SEH_info_rsaz_512_sqr:
1303 DD se_handler wrt ..imagebase
1304 DD $L$sqr_body wrt ..imagebase
,$L$sqr_epilogue wrt ..imagebase
1305 $L$
SEH_info_rsaz_512_mul:
1307 DD se_handler wrt ..imagebase
1308 DD $L$mul_body wrt ..imagebase
,$L$mul_epilogue wrt ..imagebase
1309 $L$
SEH_info_rsaz_512_mul_gather4:
1311 DD se_handler wrt ..imagebase
1312 DD $L$mul_gather4_body wrt ..imagebase
,$L$mul_gather4_epilogue wrt ..imagebase
1313 $L$
SEH_info_rsaz_512_mul_scatter4:
1315 DD se_handler wrt ..imagebase
1316 DD $L$mul_scatter4_body wrt ..imagebase
,$L$mul_scatter4_epilogue wrt ..imagebase
1317 $L$
SEH_info_rsaz_512_mul_by_one:
1319 DD se_handler wrt ..imagebase
1320 DD $L$mul_by_one_body wrt ..imagebase
,$L$mul_by_one_epilogue wrt ..imagebase