5 section .text code
align=64
8 EXTERN OPENSSL_ia32cap_P
14 mov QWORD[8+rsp
],rdi
;WIN64 prologue
17 $L$
SEH_begin_bn_mul_mont:
31 jne NEAR $L$mul4x_enter
33 jz NEAR $L$sqr8x_enter
34 jmp NEAR $L$mul4x_enter
52 mov QWORD[8+r9
*8+rsp
],r11
82 mov rax
,QWORD[r15
*8+rsi
]
87 mov QWORD[((-16))+r15
*8+rsp
],r13
93 mov rax
,QWORD[r15
*8+rcx
]
107 mov QWORD[((-16))+r15
*8+rsp
],r13
114 mov QWORD[((-8))+r9
*8+rsp
],r13
115 mov QWORD[r9
*8+rsp
],rdx
121 mov rbx
,QWORD[r14
*8+r12
]
141 jmp NEAR $L$inner_enter
146 mov rax
,QWORD[r15
*8+rsi
]
149 mov r10
,QWORD[r15
*8+rsp
]
151 mov QWORD[((-16))+r15
*8+rsp
],r13
157 mov rax
,QWORD[r15
*8+rcx
]
172 mov r10
,QWORD[r15
*8+rsp
]
174 mov QWORD[((-16))+r15
*8+rsp
],r13
182 mov QWORD[((-8))+r9
*8+rsp
],r13
183 mov QWORD[r9
*8+rsp
],rdx
195 $L$
sub: sbb rax
,QWORD[r14
*8+rcx
]
196 mov QWORD[r14
*8+rdi
],rax
197 mov rax
,QWORD[8+r14
*8+rsi
]
207 mov rsi
,QWORD[r14
*8+rsp
]
208 mov rcx
,QWORD[r14
*8+rdi
]
212 mov QWORD[r14
*8+rsp
],r14
213 mov QWORD[r14
*8+rdi
],rsi
218 mov rsi
,QWORD[8+r9
*8+rsp
]
222 mov r13
,QWORD[16+rsi
]
223 mov r12
,QWORD[24+rsi
]
224 mov rbp
,QWORD[32+rsi
]
225 mov rbx
,QWORD[40+rsi
]
228 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
229 mov rsi
,QWORD[16+rsp
]
231 $L$
SEH_end_bn_mul_mont:
235 mov QWORD[8+rsp
],rdi
;WIN64 prologue
236 mov QWORD[16+rsp
],rsi
238 $L$
SEH_begin_bn_mul4x_mont:
262 mov QWORD[8+r9
*8+rsp
],r11
264 mov QWORD[16+r9
*8+rsp
],rdi
295 mov rax
,QWORD[16+rsi
]
307 mov rax
,QWORD[((-16))+r15
*8+rcx
]
313 mov rax
,QWORD[((-8))+r15
*8+rsi
]
317 mov QWORD[((-24))+r15
*8+rsp
],r13
322 mov rax
,QWORD[((-8))+r15
*8+rcx
]
328 mov rax
,QWORD[r15
*8+rsi
]
332 mov QWORD[((-16))+r15
*8+rsp
],rdi
337 mov rax
,QWORD[r15
*8+rcx
]
343 mov rax
,QWORD[8+r15
*8+rsi
]
347 mov QWORD[((-8))+r15
*8+rsp
],r13
352 mov rax
,QWORD[8+r15
*8+rcx
]
359 mov rax
,QWORD[((-16))+r15
*8+rsi
]
363 mov QWORD[((-32))+r15
*8+rsp
],rdi
370 mov rax
,QWORD[((-16))+r15
*8+rcx
]
376 mov rax
,QWORD[((-8))+r15
*8+rsi
]
380 mov QWORD[((-24))+r15
*8+rsp
],r13
385 mov rax
,QWORD[((-8))+r15
*8+rcx
]
395 mov QWORD[((-16))+r15
*8+rsp
],rdi
401 mov QWORD[((-8))+r15
*8+rsp
],r13
402 mov QWORD[r15
*8+rsp
],rdi
407 mov rbx
,QWORD[r14
*8+r12
]
435 mov rax
,QWORD[16+rsi
]
447 mov rax
,QWORD[((-16))+r15
*8+rcx
]
449 add r10
,QWORD[((-16))+r15
*8+rsp
]
455 mov rax
,QWORD[((-8))+r15
*8+rsi
]
459 mov QWORD[((-24))+r15
*8+rsp
],r13
464 mov rax
,QWORD[((-8))+r15
*8+rcx
]
466 add r11
,QWORD[((-8))+r15
*8+rsp
]
472 mov rax
,QWORD[r15
*8+rsi
]
476 mov QWORD[((-16))+r15
*8+rsp
],rdi
481 mov rax
,QWORD[r15
*8+rcx
]
483 add r10
,QWORD[r15
*8+rsp
]
489 mov rax
,QWORD[8+r15
*8+rsi
]
493 mov QWORD[((-8))+r15
*8+rsp
],r13
498 mov rax
,QWORD[8+r15
*8+rcx
]
500 add r11
,QWORD[8+r15
*8+rsp
]
507 mov rax
,QWORD[((-16))+r15
*8+rsi
]
511 mov QWORD[((-32))+r15
*8+rsp
],rdi
518 mov rax
,QWORD[((-16))+r15
*8+rcx
]
520 add r10
,QWORD[((-16))+r15
*8+rsp
]
526 mov rax
,QWORD[((-8))+r15
*8+rsi
]
530 mov QWORD[((-24))+r15
*8+rsp
],r13
535 mov rax
,QWORD[((-8))+r15
*8+rcx
]
537 add r11
,QWORD[((-8))+r15
*8+rsp
]
548 mov QWORD[((-16))+r15
*8+rsp
],rdi
554 add r13
,QWORD[r9
*8+rsp
]
556 mov QWORD[((-8))+r15
*8+rsp
],r13
557 mov QWORD[r15
*8+rsp
],rdi
561 mov rdi
,QWORD[16+r9
*8+rsp
]
569 mov rbx
,QWORD[16+rsi
]
570 mov rbp
,QWORD[24+rsi
]
576 mov QWORD[r14
*8+rdi
],rax
577 mov QWORD[8+r14
*8+rdi
],rdx
578 sbb rbx
,QWORD[16+r14
*8+rcx
]
579 mov rax
,QWORD[32+r14
*8+rsi
]
580 mov rdx
,QWORD[40+r14
*8+rsi
]
581 sbb rbp
,QWORD[24+r14
*8+rcx
]
582 mov QWORD[16+r14
*8+rdi
],rbx
583 mov QWORD[24+r14
*8+rdi
],rbp
584 sbb rax
,QWORD[32+r14
*8+rcx
]
585 mov rbx
,QWORD[48+r14
*8+rsi
]
586 mov rbp
,QWORD[56+r14
*8+rsi
]
587 sbb rdx
,QWORD[40+r14
*8+rcx
]
592 mov QWORD[r14
*8+rdi
],rax
593 mov rax
,QWORD[32+r14
*8+rsi
]
594 sbb rbx
,QWORD[16+r14
*8+rcx
]
595 mov QWORD[8+r14
*8+rdi
],rdx
596 sbb rbp
,QWORD[24+r14
*8+rcx
]
597 mov QWORD[16+r14
*8+rdi
],rbx
600 DB 66h, 48h, 0fh
, 6eh
, 0c0h
602 mov QWORD[24+r14
*8+rdi
],rbp
610 movdqu xmm2
,XMMWORD
[r14
*1+rsp
]
611 movdqu xmm4
,XMMWORD
[16+r14
*1+rsp
]
612 movdqu xmm1
,XMMWORD
[r14
*1+rdi
]
613 movdqu xmm3
,XMMWORD
[16+r14
*1+rdi
]
620 movdqu XMMWORD
[r14
*1+rdi
],xmm2
621 movdqu XMMWORD
[16+r14
*1+rdi
],xmm4
622 movdqa XMMWORD
[r14
*1+rsp
],xmm5
623 movdqa XMMWORD
[16+r14
*1+rsp
],xmm5
630 mov rsi
,QWORD[8+r9
*8+rsp
]
634 mov r13
,QWORD[16+rsi
]
635 mov r12
,QWORD[24+rsi
]
636 mov rbp
,QWORD[32+rsi
]
637 mov rbx
,QWORD[40+rsi
]
640 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
641 mov rsi
,QWORD[16+rsp
]
643 $L$
SEH_end_bn_mul4x_mont:
644 EXTERN bn_sqr8x_internal
649 mov QWORD[8+rsp
],rdi
;WIN64 prologue
650 mov QWORD[16+rsp
],rsi
652 $L$
SEH_begin_bn_sqr8x_mont:
680 lea r11
,[((-64))+r9
*4+rsp
]
685 jb NEAR $L$sqr8x_sp_alt
687 lea rsp
,[((-64))+r9
*4+rsp
]
688 jmp NEAR $L$sqr8x_sp_done
692 lea r10
,[((4096-64))+r9
*4]
693 lea rsp
,[((-64))+r9
*4+rsp
]
703 lea r11
,[64+r9
*2+rsp
]
705 mov QWORD[40+rsp
],rax
711 mov eax,DWORD[((OPENSSL_ia32cap_P
+8))]
712 jmp NEAR $L$sqr8x_copy_n
717 movq xmm1
,QWORD[8+rcx
]
718 movq xmm3
,QWORD[16+rcx
]
719 movq xmm4
,QWORD[24+rcx
]
721 movdqa XMMWORD
[r11
],xmm0
722 movdqa XMMWORD
[16+r11
],xmm1
723 movdqa XMMWORD
[32+r11
],xmm3
724 movdqa XMMWORD
[48+r11
],xmm4
727 jnz NEAR $L$sqr8x_copy_n
732 call bn_sqr8x_internal
736 lea rdx
,[64+r9
*2+rsp
]
738 mov rsi
,QWORD[40+rsp
]
739 jmp NEAR $L$sqr8x_zero
743 movdqa XMMWORD
[rax
],xmm0
744 movdqa XMMWORD
[16+rax
],xmm0
745 movdqa XMMWORD
[32+rax
],xmm0
746 movdqa XMMWORD
[48+rax
],xmm0
748 movdqa XMMWORD
[rdx
],xmm0
749 movdqa XMMWORD
[16+rdx
],xmm0
750 movdqa XMMWORD
[32+rdx
],xmm0
751 movdqa XMMWORD
[48+rdx
],xmm0
754 jnz NEAR $L$sqr8x_zero
757 mov r15
,QWORD[((-48))+rsi
]
758 mov r14
,QWORD[((-40))+rsi
]
759 mov r13
,QWORD[((-32))+rsi
]
760 mov r12
,QWORD[((-24))+rsi
]
761 mov rbp
,QWORD[((-16))+rsi
]
762 mov rbx
,QWORD[((-8))+rsi
]
765 mov rdi
,QWORD[8+rsp
] ;WIN64 epilogue
766 mov rsi
,QWORD[16+rsp
]
768 $L$
SEH_end_bn_sqr8x_mont:
769 DB 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
770 DB 112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56
771 DB 54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83
772 DB 32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
773 DB 115,108,46,111,114,103,62,0
775 EXTERN __imp_RtlVirtualUnwind
790 mov rax
,QWORD[120+r8
]
791 mov rbx
,QWORD[248+r8
]
799 jb NEAR $L
$common_seh_tail
801 mov rax
,QWORD[152+r8
]
803 mov r10d
,DWORD[4+r11
]
806 jae NEAR $L
$common_seh_tail
808 mov r10
,QWORD[192+r8
]
809 mov rax
,QWORD[8+r10
*8+rax
]
812 mov rbx
,QWORD[((-8))+rax
]
813 mov rbp
,QWORD[((-16))+rax
]
814 mov r12
,QWORD[((-24))+rax
]
815 mov r13
,QWORD[((-32))+rax
]
816 mov r14
,QWORD[((-40))+rax
]
817 mov r15
,QWORD[((-48))+rax
]
818 mov QWORD[144+r8
],rbx
819 mov QWORD[160+r8
],rbp
820 mov QWORD[216+r8
],r12
821 mov QWORD[224+r8
],r13
822 mov QWORD[232+r8
],r14
823 mov QWORD[240+r8
],r15
825 jmp NEAR $L
$common_seh_tail
842 mov rax
,QWORD[120+r8
]
843 mov rbx
,QWORD[248+r8
]
851 jb NEAR $L
$common_seh_tail
853 mov rax
,QWORD[152+r8
]
855 mov r10d
,DWORD[4+r11
]
858 jae NEAR $L
$common_seh_tail
860 mov rax
,QWORD[40+rax
]
862 mov rbx
,QWORD[((-8))+rax
]
863 mov rbp
,QWORD[((-16))+rax
]
864 mov r12
,QWORD[((-24))+rax
]
865 mov r13
,QWORD[((-32))+rax
]
866 mov r14
,QWORD[((-40))+rax
]
867 mov r15
,QWORD[((-48))+rax
]
868 mov QWORD[144+r8
],rbx
869 mov QWORD[160+r8
],rbp
870 mov QWORD[216+r8
],r12
871 mov QWORD[224+r8
],r13
872 mov QWORD[232+r8
],r14
873 mov QWORD[240+r8
],r15
877 mov rsi
,QWORD[16+rax
]
878 mov QWORD[152+r8
],rax
879 mov QWORD[168+r8
],rsi
880 mov QWORD[176+r8
],rdi
892 mov r10
,QWORD[40+rsi
]
895 mov QWORD[32+rsp
],r10
896 mov QWORD[40+rsp
],r11
897 mov QWORD[48+rsp
],r12
898 mov QWORD[56+rsp
],rcx
899 call QWORD[__imp_RtlVirtualUnwind
]
915 section .pdata rdata
align=4
917 DD $L$SEH_begin_bn_mul_mont wrt ..imagebase
918 DD $L$SEH_end_bn_mul_mont wrt ..imagebase
919 DD $L$SEH_info_bn_mul_mont wrt ..imagebase
921 DD $L$SEH_begin_bn_mul4x_mont wrt ..imagebase
922 DD $L$SEH_end_bn_mul4x_mont wrt ..imagebase
923 DD $L$SEH_info_bn_mul4x_mont wrt ..imagebase
925 DD $L$SEH_begin_bn_sqr8x_mont wrt ..imagebase
926 DD $L$SEH_end_bn_sqr8x_mont wrt ..imagebase
927 DD $L$SEH_info_bn_sqr8x_mont wrt ..imagebase
928 section .xdata rdata
align=8
930 $L$
SEH_info_bn_mul_mont:
932 DD mul_handler wrt ..imagebase
933 DD $L$mul_body wrt ..imagebase
,$L$mul_epilogue wrt ..imagebase
934 $L$
SEH_info_bn_mul4x_mont:
936 DD mul_handler wrt ..imagebase
937 DD $L$mul4x_body wrt ..imagebase
,$L$mul4x_epilogue wrt ..imagebase
938 $L$
SEH_info_bn_sqr8x_mont:
940 DD sqr_handler wrt ..imagebase
941 DD $L$sqr8x_body wrt ..imagebase
,$L$sqr8x_epilogue wrt ..imagebase