Debian Codegraph @

win-x86_64/crypto/fipsmodule/p256-x86_64-asm-win.asm

raw
1 ; This file is generated from a similarly-named Perl script in the BoringSSL
2 ; source tree. Do not edit by hand.
3
4 %ifidn __OUTPUT_FORMAT__, win64
5 default rel
6 %define XMMWORD
7 %define YMMWORD
8 %define ZMMWORD
9
10 %ifdef BORINGSSL_PREFIX
11 %include "boringssl_prefix_symbols_nasm.inc"
12 %endif
13 section .text code align=64
14
15 EXTERN OPENSSL_ia32cap_P
16
17
18 section .rdata rdata align=8
19 ALIGN 64
20 $L$poly:
21 DQ 0xffffffffffffffff,0x00000000ffffffff,0x0000000000000000,0xffffffff00000001
22
23 $L$One:
24 DD 1,1,1,1,1,1,1,1
25 $L$Two:
26 DD 2,2,2,2,2,2,2,2
27 $L$Three:
28 DD 3,3,3,3,3,3,3,3
29 $L$ONE_mont:
30 DQ 0x0000000000000001,0xffffffff00000000,0xffffffffffffffff,0x00000000fffffffe
31
32
33 $L$ord:
34 DQ 0xf3b9cac2fc632551,0xbce6faada7179e84,0xffffffffffffffff,0xffffffff00000000
35 $L$ordK:
36 DQ 0xccd1c8aaee00bc4f
37 section .text
38
39
40
41
42 global ecp_nistz256_neg
43
44 ALIGN 32
45 ecp_nistz256_neg:
46 mov QWORD[8+rsp],rdi ;WIN64 prologue
47 mov QWORD[16+rsp],rsi
48 mov rax,rsp
49 $L$SEH_begin_ecp_nistz256_neg:
50 mov rdi,rcx
51 mov rsi,rdx
52
53
54
55 push r12
56
57 push r13
58
59 $L$neg_body:
60
61 xor r8,r8
62 xor r9,r9
63 xor r10,r10
64 xor r11,r11
65 xor r13,r13
66
67 sub r8,QWORD[rsi]
68 sbb r9,QWORD[8+rsi]
69 sbb r10,QWORD[16+rsi]
70 mov rax,r8
71 sbb r11,QWORD[24+rsi]
72 lea rsi,[$L$poly]
73 mov rdx,r9
74 sbb r13,0
75
76 add r8,QWORD[rsi]
77 mov rcx,r10
78 adc r9,QWORD[8+rsi]
79 adc r10,QWORD[16+rsi]
80 mov r12,r11
81 adc r11,QWORD[24+rsi]
82 test r13,r13
83
84 cmovz r8,rax
85 cmovz r9,rdx
86 mov QWORD[rdi],r8
87 cmovz r10,rcx
88 mov QWORD[8+rdi],r9
89 cmovz r11,r12
90 mov QWORD[16+rdi],r10
91 mov QWORD[24+rdi],r11
92
93 mov r13,QWORD[rsp]
94
95 mov r12,QWORD[8+rsp]
96
97 lea rsp,[16+rsp]
98
99 $L$neg_epilogue:
100 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
101 mov rsi,QWORD[16+rsp]
102 DB 0F3h,0C3h ;repret
103
104 $L$SEH_end_ecp_nistz256_neg:
105
106
107
108
109
110
111 global ecp_nistz256_ord_mul_mont
112
113 ALIGN 32
114 ecp_nistz256_ord_mul_mont:
115 mov QWORD[8+rsp],rdi ;WIN64 prologue
116 mov QWORD[16+rsp],rsi
117 mov rax,rsp
118 $L$SEH_begin_ecp_nistz256_ord_mul_mont:
119 mov rdi,rcx
120 mov rsi,rdx
121 mov rdx,r8
122
123
124
125 lea rcx,[OPENSSL_ia32cap_P]
126 mov rcx,QWORD[8+rcx]
127 and ecx,0x80100
128 cmp ecx,0x80100
129 je NEAR $L$ecp_nistz256_ord_mul_montx
130 push rbp
131
132 push rbx
133
134 push r12
135
136 push r13
137
138 push r14
139
140 push r15
141
142 $L$ord_mul_body:
143
144 mov rax,QWORD[rdx]
145 mov rbx,rdx
146 lea r14,[$L$ord]
147 mov r15,QWORD[$L$ordK]
148
149
150 mov rcx,rax
151 mul QWORD[rsi]
152 mov r8,rax
153 mov rax,rcx
154 mov r9,rdx
155
156 mul QWORD[8+rsi]
157 add r9,rax
158 mov rax,rcx
159 adc rdx,0
160 mov r10,rdx
161
162 mul QWORD[16+rsi]
163 add r10,rax
164 mov rax,rcx
165 adc rdx,0
166
167 mov r13,r8
168 imul r8,r15
169
170 mov r11,rdx
171 mul QWORD[24+rsi]
172 add r11,rax
173 mov rax,r8
174 adc rdx,0
175 mov r12,rdx
176
177
178 mul QWORD[r14]
179 mov rbp,r8
180 add r13,rax
181 mov rax,r8
182 adc rdx,0
183 mov rcx,rdx
184
185 sub r10,r8
186 sbb r8,0
187
188 mul QWORD[8+r14]
189 add r9,rcx
190 adc rdx,0
191 add r9,rax
192 mov rax,rbp
193 adc r10,rdx
194 mov rdx,rbp
195 adc r8,0
196
197 shl rax,32
198 shr rdx,32
199 sub r11,rax
200 mov rax,QWORD[8+rbx]
201 sbb rbp,rdx
202
203 add r11,r8
204 adc r12,rbp
205 adc r13,0
206
207
208 mov rcx,rax
209 mul QWORD[rsi]
210 add r9,rax
211 mov rax,rcx
212 adc rdx,0
213 mov rbp,rdx
214
215 mul QWORD[8+rsi]
216 add r10,rbp
217 adc rdx,0
218 add r10,rax
219 mov rax,rcx
220 adc rdx,0
221 mov rbp,rdx
222
223 mul QWORD[16+rsi]
224 add r11,rbp
225 adc rdx,0
226 add r11,rax
227 mov rax,rcx
228 adc rdx,0
229
230 mov rcx,r9
231 imul r9,r15
232
233 mov rbp,rdx
234 mul QWORD[24+rsi]
235 add r12,rbp
236 adc rdx,0
237 xor r8,r8
238 add r12,rax
239 mov rax,r9
240 adc r13,rdx
241 adc r8,0
242
243
244 mul QWORD[r14]
245 mov rbp,r9
246 add rcx,rax
247 mov rax,r9
248 adc rcx,rdx
249
250 sub r11,r9
251 sbb r9,0
252
253 mul QWORD[8+r14]
254 add r10,rcx
255 adc rdx,0
256 add r10,rax
257 mov rax,rbp
258 adc r11,rdx
259 mov rdx,rbp
260 adc r9,0
261
262 shl rax,32
263 shr rdx,32
264 sub r12,rax
265 mov rax,QWORD[16+rbx]
266 sbb rbp,rdx
267
268 add r12,r9
269 adc r13,rbp
270 adc r8,0
271
272
273 mov rcx,rax
274 mul QWORD[rsi]
275 add r10,rax
276 mov rax,rcx
277 adc rdx,0
278 mov rbp,rdx
279
280 mul QWORD[8+rsi]
281 add r11,rbp
282 adc rdx,0
283 add r11,rax
284 mov rax,rcx
285 adc rdx,0
286 mov rbp,rdx
287
288 mul QWORD[16+rsi]
289 add r12,rbp
290 adc rdx,0
291 add r12,rax
292 mov rax,rcx
293 adc rdx,0
294
295 mov rcx,r10
296 imul r10,r15
297
298 mov rbp,rdx
299 mul QWORD[24+rsi]
300 add r13,rbp
301 adc rdx,0
302 xor r9,r9
303 add r13,rax
304 mov rax,r10
305 adc r8,rdx
306 adc r9,0
307
308
309 mul QWORD[r14]
310 mov rbp,r10
311 add rcx,rax
312 mov rax,r10
313 adc rcx,rdx
314
315 sub r12,r10
316 sbb r10,0
317
318 mul QWORD[8+r14]
319 add r11,rcx
320 adc rdx,0
321 add r11,rax
322 mov rax,rbp
323 adc r12,rdx
324 mov rdx,rbp
325 adc r10,0
326
327 shl rax,32
328 shr rdx,32
329 sub r13,rax
330 mov rax,QWORD[24+rbx]
331 sbb rbp,rdx
332
333 add r13,r10
334 adc r8,rbp
335 adc r9,0
336
337
338 mov rcx,rax
339 mul QWORD[rsi]
340 add r11,rax
341 mov rax,rcx
342 adc rdx,0
343 mov rbp,rdx
344
345 mul QWORD[8+rsi]
346 add r12,rbp
347 adc rdx,0
348 add r12,rax
349 mov rax,rcx
350 adc rdx,0
351 mov rbp,rdx
352
353 mul QWORD[16+rsi]
354 add r13,rbp
355 adc rdx,0
356 add r13,rax
357 mov rax,rcx
358 adc rdx,0
359
360 mov rcx,r11
361 imul r11,r15
362
363 mov rbp,rdx
364 mul QWORD[24+rsi]
365 add r8,rbp
366 adc rdx,0
367 xor r10,r10
368 add r8,rax
369 mov rax,r11
370 adc r9,rdx
371 adc r10,0
372
373
374 mul QWORD[r14]
375 mov rbp,r11
376 add rcx,rax
377 mov rax,r11
378 adc rcx,rdx
379
380 sub r13,r11
381 sbb r11,0
382
383 mul QWORD[8+r14]
384 add r12,rcx
385 adc rdx,0
386 add r12,rax
387 mov rax,rbp
388 adc r13,rdx
389 mov rdx,rbp
390 adc r11,0
391
392 shl rax,32
393 shr rdx,32
394 sub r8,rax
395 sbb rbp,rdx
396
397 add r8,r11
398 adc r9,rbp
399 adc r10,0
400
401
402 mov rsi,r12
403 sub r12,QWORD[r14]
404 mov r11,r13
405 sbb r13,QWORD[8+r14]
406 mov rcx,r8
407 sbb r8,QWORD[16+r14]
408 mov rbp,r9
409 sbb r9,QWORD[24+r14]
410 sbb r10,0
411
412 cmovc r12,rsi
413 cmovc r13,r11
414 cmovc r8,rcx
415 cmovc r9,rbp
416
417 mov QWORD[rdi],r12
418 mov QWORD[8+rdi],r13
419 mov QWORD[16+rdi],r8
420 mov QWORD[24+rdi],r9
421
422 mov r15,QWORD[rsp]
423
424 mov r14,QWORD[8+rsp]
425
426 mov r13,QWORD[16+rsp]
427
428 mov r12,QWORD[24+rsp]
429
430 mov rbx,QWORD[32+rsp]
431
432 mov rbp,QWORD[40+rsp]
433
434 lea rsp,[48+rsp]
435
436 $L$ord_mul_epilogue:
437 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
438 mov rsi,QWORD[16+rsp]
439 DB 0F3h,0C3h ;repret
440
441 $L$SEH_end_ecp_nistz256_ord_mul_mont:
442
443
444
445
446
447
448
449 global ecp_nistz256_ord_sqr_mont
450
451 ALIGN 32
452 ecp_nistz256_ord_sqr_mont:
453 mov QWORD[8+rsp],rdi ;WIN64 prologue
454 mov QWORD[16+rsp],rsi
455 mov rax,rsp
456 $L$SEH_begin_ecp_nistz256_ord_sqr_mont:
457 mov rdi,rcx
458 mov rsi,rdx
459 mov rdx,r8
460
461
462
463 lea rcx,[OPENSSL_ia32cap_P]
464 mov rcx,QWORD[8+rcx]
465 and ecx,0x80100
466 cmp ecx,0x80100
467 je NEAR $L$ecp_nistz256_ord_sqr_montx
468 push rbp
469
470 push rbx
471
472 push r12
473
474 push r13
475
476 push r14
477
478 push r15
479
480 $L$ord_sqr_body:
481
482 mov r8,QWORD[rsi]
483 mov rax,QWORD[8+rsi]
484 mov r14,QWORD[16+rsi]
485 mov r15,QWORD[24+rsi]
486 lea rsi,[$L$ord]
487 mov rbx,rdx
488 jmp NEAR $L$oop_ord_sqr
489
490 ALIGN 32
491 $L$oop_ord_sqr:
492
493 mov rbp,rax
494 mul r8
495 mov r9,rax
496 DB 102,72,15,110,205
497 mov rax,r14
498 mov r10,rdx
499
500 mul r8
501 add r10,rax
502 mov rax,r15
503 DB 102,73,15,110,214
504 adc rdx,0
505 mov r11,rdx
506
507 mul r8
508 add r11,rax
509 mov rax,r15
510 DB 102,73,15,110,223
511 adc rdx,0
512 mov r12,rdx
513
514
515 mul r14
516 mov r13,rax
517 mov rax,r14
518 mov r14,rdx
519
520
521 mul rbp
522 add r11,rax
523 mov rax,r15
524 adc rdx,0
525 mov r15,rdx
526
527 mul rbp
528 add r12,rax
529 adc rdx,0
530
531 add r12,r15
532 adc r13,rdx
533 adc r14,0
534
535
536 xor r15,r15
537 mov rax,r8
538 add r9,r9
539 adc r10,r10
540 adc r11,r11
541 adc r12,r12
542 adc r13,r13
543 adc r14,r14
544 adc r15,0
545
546
547 mul rax
548 mov r8,rax
549 DB 102,72,15,126,200
550 mov rbp,rdx
551
552 mul rax
553 add r9,rbp
554 adc r10,rax
555 DB 102,72,15,126,208
556 adc rdx,0
557 mov rbp,rdx
558
559 mul rax
560 add r11,rbp
561 adc r12,rax
562 DB 102,72,15,126,216
563 adc rdx,0
564 mov rbp,rdx
565
566 mov rcx,r8
567 imul r8,QWORD[32+rsi]
568
569 mul rax
570 add r13,rbp
571 adc r14,rax
572 mov rax,QWORD[rsi]
573 adc r15,rdx
574
575
576 mul r8
577 mov rbp,r8
578 add rcx,rax
579 mov rax,QWORD[8+rsi]
580 adc rcx,rdx
581
582 sub r10,r8
583 sbb rbp,0
584
585 mul r8
586 add r9,rcx
587 adc rdx,0
588 add r9,rax
589 mov rax,r8
590 adc r10,rdx
591 mov rdx,r8
592 adc rbp,0
593
594 mov rcx,r9
595 imul r9,QWORD[32+rsi]
596
597 shl rax,32
598 shr rdx,32
599 sub r11,rax
600 mov rax,QWORD[rsi]
601 sbb r8,rdx
602
603 add r11,rbp
604 adc r8,0
605
606
607 mul r9
608 mov rbp,r9
609 add rcx,rax
610 mov rax,QWORD[8+rsi]
611 adc rcx,rdx
612
613 sub r11,r9
614 sbb rbp,0
615
616 mul r9
617 add r10,rcx
618 adc rdx,0
619 add r10,rax
620 mov rax,r9
621 adc r11,rdx
622 mov rdx,r9
623 adc rbp,0
624
625 mov rcx,r10
626 imul r10,QWORD[32+rsi]
627
628 shl rax,32
629 shr rdx,32
630 sub r8,rax
631 mov rax,QWORD[rsi]
632 sbb r9,rdx
633
634 add r8,rbp
635 adc r9,0
636
637
638 mul r10
639 mov rbp,r10
640 add rcx,rax
641 mov rax,QWORD[8+rsi]
642 adc rcx,rdx
643
644 sub r8,r10
645 sbb rbp,0
646
647 mul r10
648 add r11,rcx
649 adc rdx,0
650 add r11,rax
651 mov rax,r10
652 adc r8,rdx
653 mov rdx,r10
654 adc rbp,0
655
656 mov rcx,r11
657 imul r11,QWORD[32+rsi]
658
659 shl rax,32
660 shr rdx,32
661 sub r9,rax
662 mov rax,QWORD[rsi]
663 sbb r10,rdx
664
665 add r9,rbp
666 adc r10,0
667
668
669 mul r11
670 mov rbp,r11
671 add rcx,rax
672 mov rax,QWORD[8+rsi]
673 adc rcx,rdx
674
675 sub r9,r11
676 sbb rbp,0
677
678 mul r11
679 add r8,rcx
680 adc rdx,0
681 add r8,rax
682 mov rax,r11
683 adc r9,rdx
684 mov rdx,r11
685 adc rbp,0
686
687 shl rax,32
688 shr rdx,32
689 sub r10,rax
690 sbb r11,rdx
691
692 add r10,rbp
693 adc r11,0
694
695
696 xor rdx,rdx
697 add r8,r12
698 adc r9,r13
699 mov r12,r8
700 adc r10,r14
701 adc r11,r15
702 mov rax,r9
703 adc rdx,0
704
705
706 sub r8,QWORD[rsi]
707 mov r14,r10
708 sbb r9,QWORD[8+rsi]
709 sbb r10,QWORD[16+rsi]
710 mov r15,r11
711 sbb r11,QWORD[24+rsi]
712 sbb rdx,0
713
714 cmovc r8,r12
715 cmovnc rax,r9
716 cmovnc r14,r10
717 cmovnc r15,r11
718
719 dec rbx
720 jnz NEAR $L$oop_ord_sqr
721
722 mov QWORD[rdi],r8
723 mov QWORD[8+rdi],rax
724 pxor xmm1,xmm1
725 mov QWORD[16+rdi],r14
726 pxor xmm2,xmm2
727 mov QWORD[24+rdi],r15
728 pxor xmm3,xmm3
729
730 mov r15,QWORD[rsp]
731
732 mov r14,QWORD[8+rsp]
733
734 mov r13,QWORD[16+rsp]
735
736 mov r12,QWORD[24+rsp]
737
738 mov rbx,QWORD[32+rsp]
739
740 mov rbp,QWORD[40+rsp]
741
742 lea rsp,[48+rsp]
743
744 $L$ord_sqr_epilogue:
745 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
746 mov rsi,QWORD[16+rsp]
747 DB 0F3h,0C3h ;repret
748
749 $L$SEH_end_ecp_nistz256_ord_sqr_mont:
750
751
752 ALIGN 32
753 ecp_nistz256_ord_mul_montx:
754 mov QWORD[8+rsp],rdi ;WIN64 prologue
755 mov QWORD[16+rsp],rsi
756 mov rax,rsp
757 $L$SEH_begin_ecp_nistz256_ord_mul_montx:
758 mov rdi,rcx
759 mov rsi,rdx
760 mov rdx,r8
761
762
763
764 $L$ecp_nistz256_ord_mul_montx:
765 push rbp
766
767 push rbx
768
769 push r12
770
771 push r13
772
773 push r14
774
775 push r15
776
777 $L$ord_mulx_body:
778
779 mov rbx,rdx
780 mov rdx,QWORD[rdx]
781 mov r9,QWORD[rsi]
782 mov r10,QWORD[8+rsi]
783 mov r11,QWORD[16+rsi]
784 mov r12,QWORD[24+rsi]
785 lea rsi,[((-128))+rsi]
786 lea r14,[(($L$ord-128))]
787 mov r15,QWORD[$L$ordK]
788
789
790 mulx r9,r8,r9
791 mulx r10,rcx,r10
792 mulx r11,rbp,r11
793 add r9,rcx
794 mulx r12,rcx,r12
795 mov rdx,r8
796 mulx rax,rdx,r15
797 adc r10,rbp
798 adc r11,rcx
799 adc r12,0
800
801
802 xor r13,r13
803 mulx rbp,rcx,QWORD[((0+128))+r14]
804 adcx r8,rcx
805 adox r9,rbp
806
807 mulx rbp,rcx,QWORD[((8+128))+r14]
808 adcx r9,rcx
809 adox r10,rbp
810
811 mulx rbp,rcx,QWORD[((16+128))+r14]
812 adcx r10,rcx
813 adox r11,rbp
814
815 mulx rbp,rcx,QWORD[((24+128))+r14]
816 mov rdx,QWORD[8+rbx]
817 adcx r11,rcx
818 adox r12,rbp
819 adcx r12,r8
820 adox r13,r8
821 adc r13,0
822
823
824 mulx rbp,rcx,QWORD[((0+128))+rsi]
825 adcx r9,rcx
826 adox r10,rbp
827
828 mulx rbp,rcx,QWORD[((8+128))+rsi]
829 adcx r10,rcx
830 adox r11,rbp
831
832 mulx rbp,rcx,QWORD[((16+128))+rsi]
833 adcx r11,rcx
834 adox r12,rbp
835
836 mulx rbp,rcx,QWORD[((24+128))+rsi]
837 mov rdx,r9
838 mulx rax,rdx,r15
839 adcx r12,rcx
840 adox r13,rbp
841
842 adcx r13,r8
843 adox r8,r8
844 adc r8,0
845
846
847 mulx rbp,rcx,QWORD[((0+128))+r14]
848 adcx r9,rcx
849 adox r10,rbp
850
851 mulx rbp,rcx,QWORD[((8+128))+r14]
852 adcx r10,rcx
853 adox r11,rbp
854
855 mulx rbp,rcx,QWORD[((16+128))+r14]
856 adcx r11,rcx
857 adox r12,rbp
858
859 mulx rbp,rcx,QWORD[((24+128))+r14]
860 mov rdx,QWORD[16+rbx]
861 adcx r12,rcx
862 adox r13,rbp
863 adcx r13,r9
864 adox r8,r9
865 adc r8,0
866
867
868 mulx rbp,rcx,QWORD[((0+128))+rsi]
869 adcx r10,rcx
870 adox r11,rbp
871
872 mulx rbp,rcx,QWORD[((8+128))+rsi]
873 adcx r11,rcx
874 adox r12,rbp
875
876 mulx rbp,rcx,QWORD[((16+128))+rsi]
877 adcx r12,rcx
878 adox r13,rbp
879
880 mulx rbp,rcx,QWORD[((24+128))+rsi]
881 mov rdx,r10
882 mulx rax,rdx,r15
883 adcx r13,rcx
884 adox r8,rbp
885
886 adcx r8,r9
887 adox r9,r9
888 adc r9,0
889
890
891 mulx rbp,rcx,QWORD[((0+128))+r14]
892 adcx r10,rcx
893 adox r11,rbp
894
895 mulx rbp,rcx,QWORD[((8+128))+r14]
896 adcx r11,rcx
897 adox r12,rbp
898
899 mulx rbp,rcx,QWORD[((16+128))+r14]
900 adcx r12,rcx
901 adox r13,rbp
902
903 mulx rbp,rcx,QWORD[((24+128))+r14]
904 mov rdx,QWORD[24+rbx]
905 adcx r13,rcx
906 adox r8,rbp
907 adcx r8,r10
908 adox r9,r10
909 adc r9,0
910
911
912 mulx rbp,rcx,QWORD[((0+128))+rsi]
913 adcx r11,rcx
914 adox r12,rbp
915
916 mulx rbp,rcx,QWORD[((8+128))+rsi]
917 adcx r12,rcx
918 adox r13,rbp
919
920 mulx rbp,rcx,QWORD[((16+128))+rsi]
921 adcx r13,rcx
922 adox r8,rbp
923
924 mulx rbp,rcx,QWORD[((24+128))+rsi]
925 mov rdx,r11
926 mulx rax,rdx,r15
927 adcx r8,rcx
928 adox r9,rbp
929
930 adcx r9,r10
931 adox r10,r10
932 adc r10,0
933
934
935 mulx rbp,rcx,QWORD[((0+128))+r14]
936 adcx r11,rcx
937 adox r12,rbp
938
939 mulx rbp,rcx,QWORD[((8+128))+r14]
940 adcx r12,rcx
941 adox r13,rbp
942
943 mulx rbp,rcx,QWORD[((16+128))+r14]
944 adcx r13,rcx
945 adox r8,rbp
946
947 mulx rbp,rcx,QWORD[((24+128))+r14]
948 lea r14,[128+r14]
949 mov rbx,r12
950 adcx r8,rcx
951 adox r9,rbp
952 mov rdx,r13
953 adcx r9,r11
954 adox r10,r11
955 adc r10,0
956
957
958
959 mov rcx,r8
960 sub r12,QWORD[r14]
961 sbb r13,QWORD[8+r14]
962 sbb r8,QWORD[16+r14]
963 mov rbp,r9
964 sbb r9,QWORD[24+r14]
965 sbb r10,0
966
967 cmovc r12,rbx
968 cmovc r13,rdx
969 cmovc r8,rcx
970 cmovc r9,rbp
971
972 mov QWORD[rdi],r12
973 mov QWORD[8+rdi],r13
974 mov QWORD[16+rdi],r8
975 mov QWORD[24+rdi],r9
976
977 mov r15,QWORD[rsp]
978
979 mov r14,QWORD[8+rsp]
980
981 mov r13,QWORD[16+rsp]
982
983 mov r12,QWORD[24+rsp]
984
985 mov rbx,QWORD[32+rsp]
986
987 mov rbp,QWORD[40+rsp]
988
989 lea rsp,[48+rsp]
990
991 $L$ord_mulx_epilogue:
992 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
993 mov rsi,QWORD[16+rsp]
994 DB 0F3h,0C3h ;repret
995
996 $L$SEH_end_ecp_nistz256_ord_mul_montx:
997
998
999 ALIGN 32
1000 ecp_nistz256_ord_sqr_montx:
1001 mov QWORD[8+rsp],rdi ;WIN64 prologue
1002 mov QWORD[16+rsp],rsi
1003 mov rax,rsp
1004 $L$SEH_begin_ecp_nistz256_ord_sqr_montx:
1005 mov rdi,rcx
1006 mov rsi,rdx
1007 mov rdx,r8
1008
1009
1010
1011 $L$ecp_nistz256_ord_sqr_montx:
1012 push rbp
1013
1014 push rbx
1015
1016 push r12
1017
1018 push r13
1019
1020 push r14
1021
1022 push r15
1023
1024 $L$ord_sqrx_body:
1025
1026 mov rbx,rdx
1027 mov rdx,QWORD[rsi]
1028 mov r14,QWORD[8+rsi]
1029 mov r15,QWORD[16+rsi]
1030 mov r8,QWORD[24+rsi]
1031 lea rsi,[$L$ord]
1032 jmp NEAR $L$oop_ord_sqrx
1033
1034 ALIGN 32
1035 $L$oop_ord_sqrx:
1036 mulx r10,r9,r14
1037 mulx r11,rcx,r15
1038 mov rax,rdx
1039 DB 102,73,15,110,206
1040 mulx r12,rbp,r8
1041 mov rdx,r14
1042 add r10,rcx
1043 DB 102,73,15,110,215
1044 adc r11,rbp
1045 adc r12,0
1046 xor r13,r13
1047
1048 mulx rbp,rcx,r15
1049 adcx r11,rcx
1050 adox r12,rbp
1051
1052 mulx rbp,rcx,r8
1053 mov rdx,r15
1054 adcx r12,rcx
1055 adox r13,rbp
1056 adc r13,0
1057
1058 mulx r14,rcx,r8
1059 mov rdx,rax
1060 DB 102,73,15,110,216
1061 xor r15,r15
1062 adcx r9,r9
1063 adox r13,rcx
1064 adcx r10,r10
1065 adox r14,r15
1066
1067
1068 mulx rbp,r8,rdx
1069 DB 102,72,15,126,202
1070 adcx r11,r11
1071 adox r9,rbp
1072 adcx r12,r12
1073 mulx rax,rcx,rdx
1074 DB 102,72,15,126,210
1075 adcx r13,r13
1076 adox r10,rcx
1077 adcx r14,r14
1078 mulx rbp,rcx,rdx
1079 DB 0x67
1080 DB 102,72,15,126,218
1081 adox r11,rax
1082 adcx r15,r15
1083 adox r12,rcx
1084 adox r13,rbp
1085 mulx rax,rcx,rdx
1086 adox r14,rcx
1087 adox r15,rax
1088
1089
1090 mov rdx,r8
1091 mulx rcx,rdx,QWORD[32+rsi]
1092
1093 xor rax,rax
1094 mulx rbp,rcx,QWORD[rsi]
1095 adcx r8,rcx
1096 adox r9,rbp
1097 mulx rbp,rcx,QWORD[8+rsi]
1098 adcx r9,rcx
1099 adox r10,rbp
1100 mulx rbp,rcx,QWORD[16+rsi]
1101 adcx r10,rcx
1102 adox r11,rbp
1103 mulx rbp,rcx,QWORD[24+rsi]
1104 adcx r11,rcx
1105 adox r8,rbp
1106 adcx r8,rax
1107
1108
1109 mov rdx,r9
1110 mulx rcx,rdx,QWORD[32+rsi]
1111
1112 mulx rbp,rcx,QWORD[rsi]
1113 adox r9,rcx
1114 adcx r10,rbp
1115 mulx rbp,rcx,QWORD[8+rsi]
1116 adox r10,rcx
1117 adcx r11,rbp
1118 mulx rbp,rcx,QWORD[16+rsi]
1119 adox r11,rcx
1120 adcx r8,rbp
1121 mulx rbp,rcx,QWORD[24+rsi]
1122 adox r8,rcx
1123 adcx r9,rbp
1124 adox r9,rax
1125
1126
1127 mov rdx,r10
1128 mulx rcx,rdx,QWORD[32+rsi]
1129
1130 mulx rbp,rcx,QWORD[rsi]
1131 adcx r10,rcx
1132 adox r11,rbp
1133 mulx rbp,rcx,QWORD[8+rsi]
1134 adcx r11,rcx
1135 adox r8,rbp
1136 mulx rbp,rcx,QWORD[16+rsi]
1137 adcx r8,rcx
1138 adox r9,rbp
1139 mulx rbp,rcx,QWORD[24+rsi]
1140 adcx r9,rcx
1141 adox r10,rbp
1142 adcx r10,rax
1143
1144
1145 mov rdx,r11
1146 mulx rcx,rdx,QWORD[32+rsi]
1147
1148 mulx rbp,rcx,QWORD[rsi]
1149 adox r11,rcx
1150 adcx r8,rbp
1151 mulx rbp,rcx,QWORD[8+rsi]
1152 adox r8,rcx
1153 adcx r9,rbp
1154 mulx rbp,rcx,QWORD[16+rsi]
1155 adox r9,rcx
1156 adcx r10,rbp
1157 mulx rbp,rcx,QWORD[24+rsi]
1158 adox r10,rcx
1159 adcx r11,rbp
1160 adox r11,rax
1161
1162
1163 add r12,r8
1164 adc r9,r13
1165 mov rdx,r12
1166 adc r10,r14
1167 adc r11,r15
1168 mov r14,r9
1169 adc rax,0
1170
1171
1172 sub r12,QWORD[rsi]
1173 mov r15,r10
1174 sbb r9,QWORD[8+rsi]
1175 sbb r10,QWORD[16+rsi]
1176 mov r8,r11
1177 sbb r11,QWORD[24+rsi]
1178 sbb rax,0
1179
1180 cmovnc rdx,r12
1181 cmovnc r14,r9
1182 cmovnc r15,r10
1183 cmovnc r8,r11
1184
1185 dec rbx
1186 jnz NEAR $L$oop_ord_sqrx
1187
1188 mov QWORD[rdi],rdx
1189 mov QWORD[8+rdi],r14
1190 pxor xmm1,xmm1
1191 mov QWORD[16+rdi],r15
1192 pxor xmm2,xmm2
1193 mov QWORD[24+rdi],r8
1194 pxor xmm3,xmm3
1195
1196 mov r15,QWORD[rsp]
1197
1198 mov r14,QWORD[8+rsp]
1199
1200 mov r13,QWORD[16+rsp]
1201
1202 mov r12,QWORD[24+rsp]
1203
1204 mov rbx,QWORD[32+rsp]
1205
1206 mov rbp,QWORD[40+rsp]
1207
1208 lea rsp,[48+rsp]
1209
1210 $L$ord_sqrx_epilogue:
1211 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
1212 mov rsi,QWORD[16+rsp]
1213 DB 0F3h,0C3h ;repret
1214
1215 $L$SEH_end_ecp_nistz256_ord_sqr_montx:
1216
1217
1218
1219
1220
1221
1222 global ecp_nistz256_mul_mont
1223
1224 ALIGN 32
1225 ecp_nistz256_mul_mont:
1226 mov QWORD[8+rsp],rdi ;WIN64 prologue
1227 mov QWORD[16+rsp],rsi
1228 mov rax,rsp
1229 $L$SEH_begin_ecp_nistz256_mul_mont:
1230 mov rdi,rcx
1231 mov rsi,rdx
1232 mov rdx,r8
1233
1234
1235
1236 lea rcx,[OPENSSL_ia32cap_P]
1237 mov rcx,QWORD[8+rcx]
1238 and ecx,0x80100
1239 $L$mul_mont:
1240 push rbp
1241
1242 push rbx
1243
1244 push r12
1245
1246 push r13
1247
1248 push r14
1249
1250 push r15
1251
1252 $L$mul_body:
1253 cmp ecx,0x80100
1254 je NEAR $L$mul_montx
1255 mov rbx,rdx
1256 mov rax,QWORD[rdx]
1257 mov r9,QWORD[rsi]
1258 mov r10,QWORD[8+rsi]
1259 mov r11,QWORD[16+rsi]
1260 mov r12,QWORD[24+rsi]
1261
1262 call __ecp_nistz256_mul_montq
1263 jmp NEAR $L$mul_mont_done
1264
1265 ALIGN 32
1266 $L$mul_montx:
1267 mov rbx,rdx
1268 mov rdx,QWORD[rdx]
1269 mov r9,QWORD[rsi]
1270 mov r10,QWORD[8+rsi]
1271 mov r11,QWORD[16+rsi]
1272 mov r12,QWORD[24+rsi]
1273 lea rsi,[((-128))+rsi]
1274
1275 call __ecp_nistz256_mul_montx
1276 $L$mul_mont_done:
1277 mov r15,QWORD[rsp]
1278
1279 mov r14,QWORD[8+rsp]
1280
1281 mov r13,QWORD[16+rsp]
1282
1283 mov r12,QWORD[24+rsp]
1284
1285 mov rbx,QWORD[32+rsp]
1286
1287 mov rbp,QWORD[40+rsp]
1288
1289 lea rsp,[48+rsp]
1290
1291 $L$mul_epilogue:
1292 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
1293 mov rsi,QWORD[16+rsp]
1294 DB 0F3h,0C3h ;repret
1295
1296 $L$SEH_end_ecp_nistz256_mul_mont:
1297
1298
1299 ALIGN 32
1300 __ecp_nistz256_mul_montq:
1301
1302
1303
1304 mov rbp,rax
1305 mul r9
1306 mov r14,QWORD[(($L$poly+8))]
1307 mov r8,rax
1308 mov rax,rbp
1309 mov r9,rdx
1310
1311 mul r10
1312 mov r15,QWORD[(($L$poly+24))]
1313 add r9,rax
1314 mov rax,rbp
1315 adc rdx,0
1316 mov r10,rdx
1317
1318 mul r11
1319 add r10,rax
1320 mov rax,rbp
1321 adc rdx,0
1322 mov r11,rdx
1323
1324 mul r12
1325 add r11,rax
1326 mov rax,r8
1327 adc rdx,0
1328 xor r13,r13
1329 mov r12,rdx
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340 mov rbp,r8
1341 shl r8,32
1342 mul r15
1343 shr rbp,32
1344 add r9,r8
1345 adc r10,rbp
1346 adc r11,rax
1347 mov rax,QWORD[8+rbx]
1348 adc r12,rdx
1349 adc r13,0
1350 xor r8,r8
1351
1352
1353
1354 mov rbp,rax
1355 mul QWORD[rsi]
1356 add r9,rax
1357 mov rax,rbp
1358 adc rdx,0
1359 mov rcx,rdx
1360
1361 mul QWORD[8+rsi]
1362 add r10,rcx
1363 adc rdx,0
1364 add r10,rax
1365 mov rax,rbp
1366 adc rdx,0
1367 mov rcx,rdx
1368
1369 mul QWORD[16+rsi]
1370 add r11,rcx
1371 adc rdx,0
1372 add r11,rax
1373 mov rax,rbp
1374 adc rdx,0
1375 mov rcx,rdx
1376
1377 mul QWORD[24+rsi]
1378 add r12,rcx
1379 adc rdx,0
1380 add r12,rax
1381 mov rax,r9
1382 adc r13,rdx
1383 adc r8,0
1384
1385
1386
1387 mov rbp,r9
1388 shl r9,32
1389 mul r15
1390 shr rbp,32
1391 add r10,r9
1392 adc r11,rbp
1393 adc r12,rax
1394 mov rax,QWORD[16+rbx]
1395 adc r13,rdx
1396 adc r8,0
1397 xor r9,r9
1398
1399
1400
1401 mov rbp,rax
1402 mul QWORD[rsi]
1403 add r10,rax
1404 mov rax,rbp
1405 adc rdx,0
1406 mov rcx,rdx
1407
1408 mul QWORD[8+rsi]
1409 add r11,rcx
1410 adc rdx,0
1411 add r11,rax
1412 mov rax,rbp
1413 adc rdx,0
1414 mov rcx,rdx
1415
1416 mul QWORD[16+rsi]
1417 add r12,rcx
1418 adc rdx,0
1419 add r12,rax
1420 mov rax,rbp
1421 adc rdx,0
1422 mov rcx,rdx
1423
1424 mul QWORD[24+rsi]
1425 add r13,rcx
1426 adc rdx,0
1427 add r13,rax
1428 mov rax,r10
1429 adc r8,rdx
1430 adc r9,0
1431
1432
1433
1434 mov rbp,r10
1435 shl r10,32
1436 mul r15
1437 shr rbp,32
1438 add r11,r10
1439 adc r12,rbp
1440 adc r13,rax
1441 mov rax,QWORD[24+rbx]
1442 adc r8,rdx
1443 adc r9,0
1444 xor r10,r10
1445
1446
1447
1448 mov rbp,rax
1449 mul QWORD[rsi]
1450 add r11,rax
1451 mov rax,rbp
1452 adc rdx,0
1453 mov rcx,rdx
1454
1455 mul QWORD[8+rsi]
1456 add r12,rcx
1457 adc rdx,0
1458 add r12,rax
1459 mov rax,rbp
1460 adc rdx,0
1461 mov rcx,rdx
1462
1463 mul QWORD[16+rsi]
1464 add r13,rcx
1465 adc rdx,0
1466 add r13,rax
1467 mov rax,rbp
1468 adc rdx,0
1469 mov rcx,rdx
1470
1471 mul QWORD[24+rsi]
1472 add r8,rcx
1473 adc rdx,0
1474 add r8,rax
1475 mov rax,r11
1476 adc r9,rdx
1477 adc r10,0
1478
1479
1480
1481 mov rbp,r11
1482 shl r11,32
1483 mul r15
1484 shr rbp,32
1485 add r12,r11
1486 adc r13,rbp
1487 mov rcx,r12
1488 adc r8,rax
1489 adc r9,rdx
1490 mov rbp,r13
1491 adc r10,0
1492
1493
1494
1495 sub r12,-1
1496 mov rbx,r8
1497 sbb r13,r14
1498 sbb r8,0
1499 mov rdx,r9
1500 sbb r9,r15
1501 sbb r10,0
1502
1503 cmovc r12,rcx
1504 cmovc r13,rbp
1505 mov QWORD[rdi],r12
1506 cmovc r8,rbx
1507 mov QWORD[8+rdi],r13
1508 cmovc r9,rdx
1509 mov QWORD[16+rdi],r8
1510 mov QWORD[24+rdi],r9
1511
1512 DB 0F3h,0C3h ;repret
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523 global ecp_nistz256_sqr_mont
1524
1525 ALIGN 32
1526 ecp_nistz256_sqr_mont:
1527 mov QWORD[8+rsp],rdi ;WIN64 prologue
1528 mov QWORD[16+rsp],rsi
1529 mov rax,rsp
1530 $L$SEH_begin_ecp_nistz256_sqr_mont:
1531 mov rdi,rcx
1532 mov rsi,rdx
1533
1534
1535
1536 lea rcx,[OPENSSL_ia32cap_P]
1537 mov rcx,QWORD[8+rcx]
1538 and ecx,0x80100
1539 push rbp
1540
1541 push rbx
1542
1543 push r12
1544
1545 push r13
1546
1547 push r14
1548
1549 push r15
1550
1551 $L$sqr_body:
1552 cmp ecx,0x80100
1553 je NEAR $L$sqr_montx
1554 mov rax,QWORD[rsi]
1555 mov r14,QWORD[8+rsi]
1556 mov r15,QWORD[16+rsi]
1557 mov r8,QWORD[24+rsi]
1558
1559 call __ecp_nistz256_sqr_montq
1560 jmp NEAR $L$sqr_mont_done
1561
1562 ALIGN 32
1563 $L$sqr_montx:
1564 mov rdx,QWORD[rsi]
1565 mov r14,QWORD[8+rsi]
1566 mov r15,QWORD[16+rsi]
1567 mov r8,QWORD[24+rsi]
1568 lea rsi,[((-128))+rsi]
1569
1570 call __ecp_nistz256_sqr_montx
1571 $L$sqr_mont_done:
1572 mov r15,QWORD[rsp]
1573
1574 mov r14,QWORD[8+rsp]
1575
1576 mov r13,QWORD[16+rsp]
1577
1578 mov r12,QWORD[24+rsp]
1579
1580 mov rbx,QWORD[32+rsp]
1581
1582 mov rbp,QWORD[40+rsp]
1583
1584 lea rsp,[48+rsp]
1585
1586 $L$sqr_epilogue:
1587 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
1588 mov rsi,QWORD[16+rsp]
1589 DB 0F3h,0C3h ;repret
1590
1591 $L$SEH_end_ecp_nistz256_sqr_mont:
1592
1593
1594 ALIGN 32
1595 __ecp_nistz256_sqr_montq:
1596
1597 mov r13,rax
1598 mul r14
1599 mov r9,rax
1600 mov rax,r15
1601 mov r10,rdx
1602
1603 mul r13
1604 add r10,rax
1605 mov rax,r8
1606 adc rdx,0
1607 mov r11,rdx
1608
1609 mul r13
1610 add r11,rax
1611 mov rax,r15
1612 adc rdx,0
1613 mov r12,rdx
1614
1615
1616 mul r14
1617 add r11,rax
1618 mov rax,r8
1619 adc rdx,0
1620 mov rbp,rdx
1621
1622 mul r14
1623 add r12,rax
1624 mov rax,r8
1625 adc rdx,0
1626 add r12,rbp
1627 mov r13,rdx
1628 adc r13,0
1629
1630
1631 mul r15
1632 xor r15,r15
1633 add r13,rax
1634 mov rax,QWORD[rsi]
1635 mov r14,rdx
1636 adc r14,0
1637
1638 add r9,r9
1639 adc r10,r10
1640 adc r11,r11
1641 adc r12,r12
1642 adc r13,r13
1643 adc r14,r14
1644 adc r15,0
1645
1646 mul rax
1647 mov r8,rax
1648 mov rax,QWORD[8+rsi]
1649 mov rcx,rdx
1650
1651 mul rax
1652 add r9,rcx
1653 adc r10,rax
1654 mov rax,QWORD[16+rsi]
1655 adc rdx,0
1656 mov rcx,rdx
1657
1658 mul rax
1659 add r11,rcx
1660 adc r12,rax
1661 mov rax,QWORD[24+rsi]
1662 adc rdx,0
1663 mov rcx,rdx
1664
1665 mul rax
1666 add r13,rcx
1667 adc r14,rax
1668 mov rax,r8
1669 adc r15,rdx
1670
1671 mov rsi,QWORD[(($L$poly+8))]
1672 mov rbp,QWORD[(($L$poly+24))]
1673
1674
1675
1676
1677 mov rcx,r8
1678 shl r8,32
1679 mul rbp
1680 shr rcx,32
1681 add r9,r8
1682 adc r10,rcx
1683 adc r11,rax
1684 mov rax,r9
1685 adc rdx,0
1686
1687
1688
1689 mov rcx,r9
1690 shl r9,32
1691 mov r8,rdx
1692 mul rbp
1693 shr rcx,32
1694 add r10,r9
1695 adc r11,rcx
1696 adc r8,rax
1697 mov rax,r10
1698 adc rdx,0
1699
1700
1701
1702 mov rcx,r10
1703 shl r10,32
1704 mov r9,rdx
1705 mul rbp
1706 shr rcx,32
1707 add r11,r10
1708 adc r8,rcx
1709 adc r9,rax
1710 mov rax,r11
1711 adc rdx,0
1712
1713
1714
1715 mov rcx,r11
1716 shl r11,32
1717 mov r10,rdx
1718 mul rbp
1719 shr rcx,32
1720 add r8,r11
1721 adc r9,rcx
1722 adc r10,rax
1723 adc rdx,0
1724 xor r11,r11
1725
1726
1727
1728 add r12,r8
1729 adc r13,r9
1730 mov r8,r12
1731 adc r14,r10
1732 adc r15,rdx
1733 mov r9,r13
1734 adc r11,0
1735
1736 sub r12,-1
1737 mov r10,r14
1738 sbb r13,rsi
1739 sbb r14,0
1740 mov rcx,r15
1741 sbb r15,rbp
1742 sbb r11,0
1743
1744 cmovc r12,r8
1745 cmovc r13,r9
1746 mov QWORD[rdi],r12
1747 cmovc r14,r10
1748 mov QWORD[8+rdi],r13
1749 cmovc r15,rcx
1750 mov QWORD[16+rdi],r14
1751 mov QWORD[24+rdi],r15
1752
1753 DB 0F3h,0C3h ;repret
1754
1755
1756
1757 ALIGN 32
1758 __ecp_nistz256_mul_montx:
1759
1760
1761
1762 mulx r9,r8,r9
1763 mulx r10,rcx,r10
1764 mov r14,32
1765 xor r13,r13
1766 mulx r11,rbp,r11
1767 mov r15,QWORD[(($L$poly+24))]
1768 adc r9,rcx
1769 mulx r12,rcx,r12
1770 mov rdx,r8
1771 adc r10,rbp
1772 shlx rbp,r8,r14
1773 adc r11,rcx
1774 shrx rcx,r8,r14
1775 adc r12,0
1776
1777
1778
1779 add r9,rbp
1780 adc r10,rcx
1781
1782 mulx rbp,rcx,r15
1783 mov rdx,QWORD[8+rbx]
1784 adc r11,rcx
1785 adc r12,rbp
1786 adc r13,0
1787 xor r8,r8
1788
1789
1790
1791 mulx rbp,rcx,QWORD[((0+128))+rsi]
1792 adcx r9,rcx
1793 adox r10,rbp
1794
1795 mulx rbp,rcx,QWORD[((8+128))+rsi]
1796 adcx r10,rcx
1797 adox r11,rbp
1798
1799 mulx rbp,rcx,QWORD[((16+128))+rsi]
1800 adcx r11,rcx
1801 adox r12,rbp
1802
1803 mulx rbp,rcx,QWORD[((24+128))+rsi]
1804 mov rdx,r9
1805 adcx r12,rcx
1806 shlx rcx,r9,r14
1807 adox r13,rbp
1808 shrx rbp,r9,r14
1809
1810 adcx r13,r8
1811 adox r8,r8
1812 adc r8,0
1813
1814
1815
1816 add r10,rcx
1817 adc r11,rbp
1818
1819 mulx rbp,rcx,r15
1820 mov rdx,QWORD[16+rbx]
1821 adc r12,rcx
1822 adc r13,rbp
1823 adc r8,0
1824 xor r9,r9
1825
1826
1827
1828 mulx rbp,rcx,QWORD[((0+128))+rsi]
1829 adcx r10,rcx
1830 adox r11,rbp
1831
1832 mulx rbp,rcx,QWORD[((8+128))+rsi]
1833 adcx r11,rcx
1834 adox r12,rbp
1835
1836 mulx rbp,rcx,QWORD[((16+128))+rsi]
1837 adcx r12,rcx
1838 adox r13,rbp
1839
1840 mulx rbp,rcx,QWORD[((24+128))+rsi]
1841 mov rdx,r10
1842 adcx r13,rcx
1843 shlx rcx,r10,r14
1844 adox r8,rbp
1845 shrx rbp,r10,r14
1846
1847 adcx r8,r9
1848 adox r9,r9
1849 adc r9,0
1850
1851
1852
1853 add r11,rcx
1854 adc r12,rbp
1855
1856 mulx rbp,rcx,r15
1857 mov rdx,QWORD[24+rbx]
1858 adc r13,rcx
1859 adc r8,rbp
1860 adc r9,0
1861 xor r10,r10
1862
1863
1864
1865 mulx rbp,rcx,QWORD[((0+128))+rsi]
1866 adcx r11,rcx
1867 adox r12,rbp
1868
1869 mulx rbp,rcx,QWORD[((8+128))+rsi]
1870 adcx r12,rcx
1871 adox r13,rbp
1872
1873 mulx rbp,rcx,QWORD[((16+128))+rsi]
1874 adcx r13,rcx
1875 adox r8,rbp
1876
1877 mulx rbp,rcx,QWORD[((24+128))+rsi]
1878 mov rdx,r11
1879 adcx r8,rcx
1880 shlx rcx,r11,r14
1881 adox r9,rbp
1882 shrx rbp,r11,r14
1883
1884 adcx r9,r10
1885 adox r10,r10
1886 adc r10,0
1887
1888
1889
1890 add r12,rcx
1891 adc r13,rbp
1892
1893 mulx rbp,rcx,r15
1894 mov rbx,r12
1895 mov r14,QWORD[(($L$poly+8))]
1896 adc r8,rcx
1897 mov rdx,r13
1898 adc r9,rbp
1899 adc r10,0
1900
1901
1902
1903 xor eax,eax
1904 mov rcx,r8
1905 sbb r12,-1
1906 sbb r13,r14
1907 sbb r8,0
1908 mov rbp,r9
1909 sbb r9,r15
1910 sbb r10,0
1911
1912 cmovc r12,rbx
1913 cmovc r13,rdx
1914 mov QWORD[rdi],r12
1915 cmovc r8,rcx
1916 mov QWORD[8+rdi],r13
1917 cmovc r9,rbp
1918 mov QWORD[16+rdi],r8
1919 mov QWORD[24+rdi],r9
1920
1921 DB 0F3h,0C3h ;repret
1922
1923
1924
1925
1926 ALIGN 32
1927 __ecp_nistz256_sqr_montx:
1928
1929 mulx r10,r9,r14
1930 mulx r11,rcx,r15
1931 xor eax,eax
1932 adc r10,rcx
1933 mulx r12,rbp,r8
1934 mov rdx,r14
1935 adc r11,rbp
1936 adc r12,0
1937 xor r13,r13
1938
1939
1940 mulx rbp,rcx,r15
1941 adcx r11,rcx
1942 adox r12,rbp
1943
1944 mulx rbp,rcx,r8
1945 mov rdx,r15
1946 adcx r12,rcx
1947 adox r13,rbp
1948 adc r13,0
1949
1950
1951 mulx r14,rcx,r8
1952 mov rdx,QWORD[((0+128))+rsi]
1953 xor r15,r15
1954 adcx r9,r9
1955 adox r13,rcx
1956 adcx r10,r10
1957 adox r14,r15
1958
1959 mulx rbp,r8,rdx
1960 mov rdx,QWORD[((8+128))+rsi]
1961 adcx r11,r11
1962 adox r9,rbp
1963 adcx r12,r12
1964 mulx rax,rcx,rdx
1965 mov rdx,QWORD[((16+128))+rsi]
1966 adcx r13,r13
1967 adox r10,rcx
1968 adcx r14,r14
1969 DB 0x67
1970 mulx rbp,rcx,rdx
1971 mov rdx,QWORD[((24+128))+rsi]
1972 adox r11,rax
1973 adcx r15,r15
1974 adox r12,rcx
1975 mov rsi,32
1976 adox r13,rbp
1977 DB 0x67,0x67
1978 mulx rax,rcx,rdx
1979 mov rdx,QWORD[(($L$poly+24))]
1980 adox r14,rcx
1981 shlx rcx,r8,rsi
1982 adox r15,rax
1983 shrx rax,r8,rsi
1984 mov rbp,rdx
1985
1986
1987 add r9,rcx
1988 adc r10,rax
1989
1990 mulx r8,rcx,r8
1991 adc r11,rcx
1992 shlx rcx,r9,rsi
1993 adc r8,0
1994 shrx rax,r9,rsi
1995
1996
1997 add r10,rcx
1998 adc r11,rax
1999
2000 mulx r9,rcx,r9
2001 adc r8,rcx
2002 shlx rcx,r10,rsi
2003 adc r9,0
2004 shrx rax,r10,rsi
2005
2006
2007 add r11,rcx
2008 adc r8,rax
2009
2010 mulx r10,rcx,r10
2011 adc r9,rcx
2012 shlx rcx,r11,rsi
2013 adc r10,0
2014 shrx rax,r11,rsi
2015
2016
2017 add r8,rcx
2018 adc r9,rax
2019
2020 mulx r11,rcx,r11
2021 adc r10,rcx
2022 adc r11,0
2023
2024 xor rdx,rdx
2025 add r12,r8
2026 mov rsi,QWORD[(($L$poly+8))]
2027 adc r13,r9
2028 mov r8,r12
2029 adc r14,r10
2030 adc r15,r11
2031 mov r9,r13
2032 adc rdx,0
2033
2034 sub r12,-1
2035 mov r10,r14
2036 sbb r13,rsi
2037 sbb r14,0
2038 mov r11,r15
2039 sbb r15,rbp
2040 sbb rdx,0
2041
2042 cmovc r12,r8
2043 cmovc r13,r9
2044 mov QWORD[rdi],r12
2045 cmovc r14,r10
2046 mov QWORD[8+rdi],r13
2047 cmovc r15,r11
2048 mov QWORD[16+rdi],r14
2049 mov QWORD[24+rdi],r15
2050
2051 DB 0F3h,0C3h ;repret
2052
2053
2054
2055
2056 global ecp_nistz256_select_w5
2057
2058 ALIGN 32
2059 ecp_nistz256_select_w5:
2060
2061 lea rax,[OPENSSL_ia32cap_P]
2062 mov rax,QWORD[8+rax]
2063 test eax,32
2064 jnz NEAR $L$avx2_select_w5
2065 lea rax,[((-136))+rsp]
2066 $L$SEH_begin_ecp_nistz256_select_w5:
2067 DB 0x48,0x8d,0x60,0xe0
2068 DB 0x0f,0x29,0x70,0xe0
2069 DB 0x0f,0x29,0x78,0xf0
2070 DB 0x44,0x0f,0x29,0x00
2071 DB 0x44,0x0f,0x29,0x48,0x10
2072 DB 0x44,0x0f,0x29,0x50,0x20
2073 DB 0x44,0x0f,0x29,0x58,0x30
2074 DB 0x44,0x0f,0x29,0x60,0x40
2075 DB 0x44,0x0f,0x29,0x68,0x50
2076 DB 0x44,0x0f,0x29,0x70,0x60
2077 DB 0x44,0x0f,0x29,0x78,0x70
2078 movdqa xmm0,XMMWORD[$L$One]
2079 movd xmm1,r8d
2080
2081 pxor xmm2,xmm2
2082 pxor xmm3,xmm3
2083 pxor xmm4,xmm4
2084 pxor xmm5,xmm5
2085 pxor xmm6,xmm6
2086 pxor xmm7,xmm7
2087
2088 movdqa xmm8,xmm0
2089 pshufd xmm1,xmm1,0
2090
2091 mov rax,16
2092 $L$select_loop_sse_w5:
2093
2094 movdqa xmm15,xmm8
2095 paddd xmm8,xmm0
2096 pcmpeqd xmm15,xmm1
2097
2098 movdqa xmm9,XMMWORD[rdx]
2099 movdqa xmm10,XMMWORD[16+rdx]
2100 movdqa xmm11,XMMWORD[32+rdx]
2101 movdqa xmm12,XMMWORD[48+rdx]
2102 movdqa xmm13,XMMWORD[64+rdx]
2103 movdqa xmm14,XMMWORD[80+rdx]
2104 lea rdx,[96+rdx]
2105
2106 pand xmm9,xmm15
2107 pand xmm10,xmm15
2108 por xmm2,xmm9
2109 pand xmm11,xmm15
2110 por xmm3,xmm10
2111 pand xmm12,xmm15
2112 por xmm4,xmm11
2113 pand xmm13,xmm15
2114 por xmm5,xmm12
2115 pand xmm14,xmm15
2116 por xmm6,xmm13
2117 por xmm7,xmm14
2118
2119 dec rax
2120 jnz NEAR $L$select_loop_sse_w5
2121
2122 movdqu XMMWORD[rcx],xmm2
2123 movdqu XMMWORD[16+rcx],xmm3
2124 movdqu XMMWORD[32+rcx],xmm4
2125 movdqu XMMWORD[48+rcx],xmm5
2126 movdqu XMMWORD[64+rcx],xmm6
2127 movdqu XMMWORD[80+rcx],xmm7
2128 movaps xmm6,XMMWORD[rsp]
2129 movaps xmm7,XMMWORD[16+rsp]
2130 movaps xmm8,XMMWORD[32+rsp]
2131 movaps xmm9,XMMWORD[48+rsp]
2132 movaps xmm10,XMMWORD[64+rsp]
2133 movaps xmm11,XMMWORD[80+rsp]
2134 movaps xmm12,XMMWORD[96+rsp]
2135 movaps xmm13,XMMWORD[112+rsp]
2136 movaps xmm14,XMMWORD[128+rsp]
2137 movaps xmm15,XMMWORD[144+rsp]
2138 lea rsp,[168+rsp]
2139 DB 0F3h,0C3h ;repret
2140
2141 $L$SEH_end_ecp_nistz256_select_w5:
2142
2143
2144
2145
2146 global ecp_nistz256_select_w7
2147
2148 ALIGN 32
2149 ecp_nistz256_select_w7:
2150
2151 lea rax,[OPENSSL_ia32cap_P]
2152 mov rax,QWORD[8+rax]
2153 test eax,32
2154 jnz NEAR $L$avx2_select_w7
2155 lea rax,[((-136))+rsp]
2156 $L$SEH_begin_ecp_nistz256_select_w7:
2157 DB 0x48,0x8d,0x60,0xe0
2158 DB 0x0f,0x29,0x70,0xe0
2159 DB 0x0f,0x29,0x78,0xf0
2160 DB 0x44,0x0f,0x29,0x00
2161 DB 0x44,0x0f,0x29,0x48,0x10
2162 DB 0x44,0x0f,0x29,0x50,0x20
2163 DB 0x44,0x0f,0x29,0x58,0x30
2164 DB 0x44,0x0f,0x29,0x60,0x40
2165 DB 0x44,0x0f,0x29,0x68,0x50
2166 DB 0x44,0x0f,0x29,0x70,0x60
2167 DB 0x44,0x0f,0x29,0x78,0x70
2168 movdqa xmm8,XMMWORD[$L$One]
2169 movd xmm1,r8d
2170
2171 pxor xmm2,xmm2
2172 pxor xmm3,xmm3
2173 pxor xmm4,xmm4
2174 pxor xmm5,xmm5
2175
2176 movdqa xmm0,xmm8
2177 pshufd xmm1,xmm1,0
2178 mov rax,64
2179
2180 $L$select_loop_sse_w7:
2181 movdqa xmm15,xmm8
2182 paddd xmm8,xmm0
2183 movdqa xmm9,XMMWORD[rdx]
2184 movdqa xmm10,XMMWORD[16+rdx]
2185 pcmpeqd xmm15,xmm1
2186 movdqa xmm11,XMMWORD[32+rdx]
2187 movdqa xmm12,XMMWORD[48+rdx]
2188 lea rdx,[64+rdx]
2189
2190 pand xmm9,xmm15
2191 pand xmm10,xmm15
2192 por xmm2,xmm9
2193 pand xmm11,xmm15
2194 por xmm3,xmm10
2195 pand xmm12,xmm15
2196 por xmm4,xmm11
2197 prefetcht0 [255+rdx]
2198 por xmm5,xmm12
2199
2200 dec rax
2201 jnz NEAR $L$select_loop_sse_w7
2202
2203 movdqu XMMWORD[rcx],xmm2
2204 movdqu XMMWORD[16+rcx],xmm3
2205 movdqu XMMWORD[32+rcx],xmm4
2206 movdqu XMMWORD[48+rcx],xmm5
2207 movaps xmm6,XMMWORD[rsp]
2208 movaps xmm7,XMMWORD[16+rsp]
2209 movaps xmm8,XMMWORD[32+rsp]
2210 movaps xmm9,XMMWORD[48+rsp]
2211 movaps xmm10,XMMWORD[64+rsp]
2212 movaps xmm11,XMMWORD[80+rsp]
2213 movaps xmm12,XMMWORD[96+rsp]
2214 movaps xmm13,XMMWORD[112+rsp]
2215 movaps xmm14,XMMWORD[128+rsp]
2216 movaps xmm15,XMMWORD[144+rsp]
2217 lea rsp,[168+rsp]
2218 DB 0F3h,0C3h ;repret
2219
2220 $L$SEH_end_ecp_nistz256_select_w7:
2221
2222
2223
2224
2225 ALIGN 32
2226 ecp_nistz256_avx2_select_w5:
2227
2228 $L$avx2_select_w5:
2229 vzeroupper
2230 lea rax,[((-136))+rsp]
2231 mov r11,rsp
2232 $L$SEH_begin_ecp_nistz256_avx2_select_w5:
2233 DB 0x48,0x8d,0x60,0xe0
2234 DB 0xc5,0xf8,0x29,0x70,0xe0
2235 DB 0xc5,0xf8,0x29,0x78,0xf0
2236 DB 0xc5,0x78,0x29,0x40,0x00
2237 DB 0xc5,0x78,0x29,0x48,0x10
2238 DB 0xc5,0x78,0x29,0x50,0x20
2239 DB 0xc5,0x78,0x29,0x58,0x30
2240 DB 0xc5,0x78,0x29,0x60,0x40
2241 DB 0xc5,0x78,0x29,0x68,0x50
2242 DB 0xc5,0x78,0x29,0x70,0x60
2243 DB 0xc5,0x78,0x29,0x78,0x70
2244 vmovdqa ymm0,YMMWORD[$L$Two]
2245
2246 vpxor ymm2,ymm2,ymm2
2247 vpxor ymm3,ymm3,ymm3
2248 vpxor ymm4,ymm4,ymm4
2249
2250 vmovdqa ymm5,YMMWORD[$L$One]
2251 vmovdqa ymm10,YMMWORD[$L$Two]
2252
2253 vmovd xmm1,r8d
2254 vpermd ymm1,ymm2,ymm1
2255
2256 mov rax,8
2257 $L$select_loop_avx2_w5:
2258
2259 vmovdqa ymm6,YMMWORD[rdx]
2260 vmovdqa ymm7,YMMWORD[32+rdx]
2261 vmovdqa ymm8,YMMWORD[64+rdx]
2262
2263 vmovdqa ymm11,YMMWORD[96+rdx]
2264 vmovdqa ymm12,YMMWORD[128+rdx]
2265 vmovdqa ymm13,YMMWORD[160+rdx]
2266
2267 vpcmpeqd ymm9,ymm5,ymm1
2268 vpcmpeqd ymm14,ymm10,ymm1
2269
2270 vpaddd ymm5,ymm5,ymm0
2271 vpaddd ymm10,ymm10,ymm0
2272 lea rdx,[192+rdx]
2273
2274 vpand ymm6,ymm6,ymm9
2275 vpand ymm7,ymm7,ymm9
2276 vpand ymm8,ymm8,ymm9
2277 vpand ymm11,ymm11,ymm14
2278 vpand ymm12,ymm12,ymm14
2279 vpand ymm13,ymm13,ymm14
2280
2281 vpxor ymm2,ymm2,ymm6
2282 vpxor ymm3,ymm3,ymm7
2283 vpxor ymm4,ymm4,ymm8
2284 vpxor ymm2,ymm2,ymm11
2285 vpxor ymm3,ymm3,ymm12
2286 vpxor ymm4,ymm4,ymm13
2287
2288 dec rax
2289 jnz NEAR $L$select_loop_avx2_w5
2290
2291 vmovdqu YMMWORD[rcx],ymm2
2292 vmovdqu YMMWORD[32+rcx],ymm3
2293 vmovdqu YMMWORD[64+rcx],ymm4
2294 vzeroupper
2295 movaps xmm6,XMMWORD[rsp]
2296 movaps xmm7,XMMWORD[16+rsp]
2297 movaps xmm8,XMMWORD[32+rsp]
2298 movaps xmm9,XMMWORD[48+rsp]
2299 movaps xmm10,XMMWORD[64+rsp]
2300 movaps xmm11,XMMWORD[80+rsp]
2301 movaps xmm12,XMMWORD[96+rsp]
2302 movaps xmm13,XMMWORD[112+rsp]
2303 movaps xmm14,XMMWORD[128+rsp]
2304 movaps xmm15,XMMWORD[144+rsp]
2305 lea rsp,[r11]
2306 DB 0F3h,0C3h ;repret
2307
2308 $L$SEH_end_ecp_nistz256_avx2_select_w5:
2309
2310
2311
2312
2313 global ecp_nistz256_avx2_select_w7
2314
2315 ALIGN 32
2316 ecp_nistz256_avx2_select_w7:
2317
2318 $L$avx2_select_w7:
2319 vzeroupper
2320 mov r11,rsp
2321 lea rax,[((-136))+rsp]
2322 $L$SEH_begin_ecp_nistz256_avx2_select_w7:
2323 DB 0x48,0x8d,0x60,0xe0
2324 DB 0xc5,0xf8,0x29,0x70,0xe0
2325 DB 0xc5,0xf8,0x29,0x78,0xf0
2326 DB 0xc5,0x78,0x29,0x40,0x00
2327 DB 0xc5,0x78,0x29,0x48,0x10
2328 DB 0xc5,0x78,0x29,0x50,0x20
2329 DB 0xc5,0x78,0x29,0x58,0x30
2330 DB 0xc5,0x78,0x29,0x60,0x40
2331 DB 0xc5,0x78,0x29,0x68,0x50
2332 DB 0xc5,0x78,0x29,0x70,0x60
2333 DB 0xc5,0x78,0x29,0x78,0x70
2334 vmovdqa ymm0,YMMWORD[$L$Three]
2335
2336 vpxor ymm2,ymm2,ymm2
2337 vpxor ymm3,ymm3,ymm3
2338
2339 vmovdqa ymm4,YMMWORD[$L$One]
2340 vmovdqa ymm8,YMMWORD[$L$Two]
2341 vmovdqa ymm12,YMMWORD[$L$Three]
2342
2343 vmovd xmm1,r8d
2344 vpermd ymm1,ymm2,ymm1
2345
2346
2347 mov rax,21
2348 $L$select_loop_avx2_w7:
2349
2350 vmovdqa ymm5,YMMWORD[rdx]
2351 vmovdqa ymm6,YMMWORD[32+rdx]
2352
2353 vmovdqa ymm9,YMMWORD[64+rdx]
2354 vmovdqa ymm10,YMMWORD[96+rdx]
2355
2356 vmovdqa ymm13,YMMWORD[128+rdx]
2357 vmovdqa ymm14,YMMWORD[160+rdx]
2358
2359 vpcmpeqd ymm7,ymm4,ymm1
2360 vpcmpeqd ymm11,ymm8,ymm1
2361 vpcmpeqd ymm15,ymm12,ymm1
2362
2363 vpaddd ymm4,ymm4,ymm0
2364 vpaddd ymm8,ymm8,ymm0
2365 vpaddd ymm12,ymm12,ymm0
2366 lea rdx,[192+rdx]
2367
2368 vpand ymm5,ymm5,ymm7
2369 vpand ymm6,ymm6,ymm7
2370 vpand ymm9,ymm9,ymm11
2371 vpand ymm10,ymm10,ymm11
2372 vpand ymm13,ymm13,ymm15
2373 vpand ymm14,ymm14,ymm15
2374
2375 vpxor ymm2,ymm2,ymm5
2376 vpxor ymm3,ymm3,ymm6
2377 vpxor ymm2,ymm2,ymm9
2378 vpxor ymm3,ymm3,ymm10
2379 vpxor ymm2,ymm2,ymm13
2380 vpxor ymm3,ymm3,ymm14
2381
2382 dec rax
2383 jnz NEAR $L$select_loop_avx2_w7
2384
2385
2386 vmovdqa ymm5,YMMWORD[rdx]
2387 vmovdqa ymm6,YMMWORD[32+rdx]
2388
2389 vpcmpeqd ymm7,ymm4,ymm1
2390
2391 vpand ymm5,ymm5,ymm7
2392 vpand ymm6,ymm6,ymm7
2393
2394 vpxor ymm2,ymm2,ymm5
2395 vpxor ymm3,ymm3,ymm6
2396
2397 vmovdqu YMMWORD[rcx],ymm2
2398 vmovdqu YMMWORD[32+rcx],ymm3
2399 vzeroupper
2400 movaps xmm6,XMMWORD[rsp]
2401 movaps xmm7,XMMWORD[16+rsp]
2402 movaps xmm8,XMMWORD[32+rsp]
2403 movaps xmm9,XMMWORD[48+rsp]
2404 movaps xmm10,XMMWORD[64+rsp]
2405 movaps xmm11,XMMWORD[80+rsp]
2406 movaps xmm12,XMMWORD[96+rsp]
2407 movaps xmm13,XMMWORD[112+rsp]
2408 movaps xmm14,XMMWORD[128+rsp]
2409 movaps xmm15,XMMWORD[144+rsp]
2410 lea rsp,[r11]
2411 DB 0F3h,0C3h ;repret
2412
2413 $L$SEH_end_ecp_nistz256_avx2_select_w7:
2414
2415
2416 ALIGN 32
2417 __ecp_nistz256_add_toq:
2418
2419 xor r11,r11
2420 add r12,QWORD[rbx]
2421 adc r13,QWORD[8+rbx]
2422 mov rax,r12
2423 adc r8,QWORD[16+rbx]
2424 adc r9,QWORD[24+rbx]
2425 mov rbp,r13
2426 adc r11,0
2427
2428 sub r12,-1
2429 mov rcx,r8
2430 sbb r13,r14
2431 sbb r8,0
2432 mov r10,r9
2433 sbb r9,r15
2434 sbb r11,0
2435
2436 cmovc r12,rax
2437 cmovc r13,rbp
2438 mov QWORD[rdi],r12
2439 cmovc r8,rcx
2440 mov QWORD[8+rdi],r13
2441 cmovc r9,r10
2442 mov QWORD[16+rdi],r8
2443 mov QWORD[24+rdi],r9
2444
2445 DB 0F3h,0C3h ;repret
2446
2447
2448
2449
2450 ALIGN 32
2451 __ecp_nistz256_sub_fromq:
2452
2453 sub r12,QWORD[rbx]
2454 sbb r13,QWORD[8+rbx]
2455 mov rax,r12
2456 sbb r8,QWORD[16+rbx]
2457 sbb r9,QWORD[24+rbx]
2458 mov rbp,r13
2459 sbb r11,r11
2460
2461 add r12,-1
2462 mov rcx,r8
2463 adc r13,r14
2464 adc r8,0
2465 mov r10,r9
2466 adc r9,r15
2467 test r11,r11
2468
2469 cmovz r12,rax
2470 cmovz r13,rbp
2471 mov QWORD[rdi],r12
2472 cmovz r8,rcx
2473 mov QWORD[8+rdi],r13
2474 cmovz r9,r10
2475 mov QWORD[16+rdi],r8
2476 mov QWORD[24+rdi],r9
2477
2478 DB 0F3h,0C3h ;repret
2479
2480
2481
2482
2483 ALIGN 32
2484 __ecp_nistz256_subq:
2485
2486 sub rax,r12
2487 sbb rbp,r13
2488 mov r12,rax
2489 sbb rcx,r8
2490 sbb r10,r9
2491 mov r13,rbp
2492 sbb r11,r11
2493
2494 add rax,-1
2495 mov r8,rcx
2496 adc rbp,r14
2497 adc rcx,0
2498 mov r9,r10
2499 adc r10,r15
2500 test r11,r11
2501
2502 cmovnz r12,rax
2503 cmovnz r13,rbp
2504 cmovnz r8,rcx
2505 cmovnz r9,r10
2506
2507 DB 0F3h,0C3h ;repret
2508
2509
2510
2511
2512 ALIGN 32
2513 __ecp_nistz256_mul_by_2q:
2514
2515 xor r11,r11
2516 add r12,r12
2517 adc r13,r13
2518 mov rax,r12
2519 adc r8,r8
2520 adc r9,r9
2521 mov rbp,r13
2522 adc r11,0
2523
2524 sub r12,-1
2525 mov rcx,r8
2526 sbb r13,r14
2527 sbb r8,0
2528 mov r10,r9
2529 sbb r9,r15
2530 sbb r11,0
2531
2532 cmovc r12,rax
2533 cmovc r13,rbp
2534 mov QWORD[rdi],r12
2535 cmovc r8,rcx
2536 mov QWORD[8+rdi],r13
2537 cmovc r9,r10
2538 mov QWORD[16+rdi],r8
2539 mov QWORD[24+rdi],r9
2540
2541 DB 0F3h,0C3h ;repret
2542
2543
2544 global ecp_nistz256_point_double
2545
2546 ALIGN 32
2547 ecp_nistz256_point_double:
2548 mov QWORD[8+rsp],rdi ;WIN64 prologue
2549 mov QWORD[16+rsp],rsi
2550 mov rax,rsp
2551 $L$SEH_begin_ecp_nistz256_point_double:
2552 mov rdi,rcx
2553 mov rsi,rdx
2554
2555
2556
2557 lea rcx,[OPENSSL_ia32cap_P]
2558 mov rcx,QWORD[8+rcx]
2559 and ecx,0x80100
2560 cmp ecx,0x80100
2561 je NEAR $L$point_doublex
2562 push rbp
2563
2564 push rbx
2565
2566 push r12
2567
2568 push r13
2569
2570 push r14
2571
2572 push r15
2573
2574 sub rsp,32*5+8
2575
2576 $L$point_doubleq_body:
2577
2578 $L$point_double_shortcutq:
2579 movdqu xmm0,XMMWORD[rsi]
2580 mov rbx,rsi
2581 movdqu xmm1,XMMWORD[16+rsi]
2582 mov r12,QWORD[((32+0))+rsi]
2583 mov r13,QWORD[((32+8))+rsi]
2584 mov r8,QWORD[((32+16))+rsi]
2585 mov r9,QWORD[((32+24))+rsi]
2586 mov r14,QWORD[(($L$poly+8))]
2587 mov r15,QWORD[(($L$poly+24))]
2588 movdqa XMMWORD[96+rsp],xmm0
2589 movdqa XMMWORD[(96+16)+rsp],xmm1
2590 lea r10,[32+rdi]
2591 lea r11,[64+rdi]
2592 DB 102,72,15,110,199
2593 DB 102,73,15,110,202
2594 DB 102,73,15,110,211
2595
2596 lea rdi,[rsp]
2597 call __ecp_nistz256_mul_by_2q
2598
2599 mov rax,QWORD[((64+0))+rsi]
2600 mov r14,QWORD[((64+8))+rsi]
2601 mov r15,QWORD[((64+16))+rsi]
2602 mov r8,QWORD[((64+24))+rsi]
2603 lea rsi,[((64-0))+rsi]
2604 lea rdi,[64+rsp]
2605 call __ecp_nistz256_sqr_montq
2606
2607 mov rax,QWORD[((0+0))+rsp]
2608 mov r14,QWORD[((8+0))+rsp]
2609 lea rsi,[((0+0))+rsp]
2610 mov r15,QWORD[((16+0))+rsp]
2611 mov r8,QWORD[((24+0))+rsp]
2612 lea rdi,[rsp]
2613 call __ecp_nistz256_sqr_montq
2614
2615 mov rax,QWORD[32+rbx]
2616 mov r9,QWORD[((64+0))+rbx]
2617 mov r10,QWORD[((64+8))+rbx]
2618 mov r11,QWORD[((64+16))+rbx]
2619 mov r12,QWORD[((64+24))+rbx]
2620 lea rsi,[((64-0))+rbx]
2621 lea rbx,[32+rbx]
2622 DB 102,72,15,126,215
2623 call __ecp_nistz256_mul_montq
2624 call __ecp_nistz256_mul_by_2q
2625
2626 mov r12,QWORD[((96+0))+rsp]
2627 mov r13,QWORD[((96+8))+rsp]
2628 lea rbx,[64+rsp]
2629 mov r8,QWORD[((96+16))+rsp]
2630 mov r9,QWORD[((96+24))+rsp]
2631 lea rdi,[32+rsp]
2632 call __ecp_nistz256_add_toq
2633
2634 mov r12,QWORD[((96+0))+rsp]
2635 mov r13,QWORD[((96+8))+rsp]
2636 lea rbx,[64+rsp]
2637 mov r8,QWORD[((96+16))+rsp]
2638 mov r9,QWORD[((96+24))+rsp]
2639 lea rdi,[64+rsp]
2640 call __ecp_nistz256_sub_fromq
2641
2642 mov rax,QWORD[((0+0))+rsp]
2643 mov r14,QWORD[((8+0))+rsp]
2644 lea rsi,[((0+0))+rsp]
2645 mov r15,QWORD[((16+0))+rsp]
2646 mov r8,QWORD[((24+0))+rsp]
2647 DB 102,72,15,126,207
2648 call __ecp_nistz256_sqr_montq
2649 xor r9,r9
2650 mov rax,r12
2651 add r12,-1
2652 mov r10,r13
2653 adc r13,rsi
2654 mov rcx,r14
2655 adc r14,0
2656 mov r8,r15
2657 adc r15,rbp
2658 adc r9,0
2659 xor rsi,rsi
2660 test rax,1
2661
2662 cmovz r12,rax
2663 cmovz r13,r10
2664 cmovz r14,rcx
2665 cmovz r15,r8
2666 cmovz r9,rsi
2667
2668 mov rax,r13
2669 shr r12,1
2670 shl rax,63
2671 mov r10,r14
2672 shr r13,1
2673 or r12,rax
2674 shl r10,63
2675 mov rcx,r15
2676 shr r14,1
2677 or r13,r10
2678 shl rcx,63
2679 mov QWORD[rdi],r12
2680 shr r15,1
2681 mov QWORD[8+rdi],r13
2682 shl r9,63
2683 or r14,rcx
2684 or r15,r9
2685 mov QWORD[16+rdi],r14
2686 mov QWORD[24+rdi],r15
2687 mov rax,QWORD[64+rsp]
2688 lea rbx,[64+rsp]
2689 mov r9,QWORD[((0+32))+rsp]
2690 mov r10,QWORD[((8+32))+rsp]
2691 lea rsi,[((0+32))+rsp]
2692 mov r11,QWORD[((16+32))+rsp]
2693 mov r12,QWORD[((24+32))+rsp]
2694 lea rdi,[32+rsp]
2695 call __ecp_nistz256_mul_montq
2696
2697 lea rdi,[128+rsp]
2698 call __ecp_nistz256_mul_by_2q
2699
2700 lea rbx,[32+rsp]
2701 lea rdi,[32+rsp]
2702 call __ecp_nistz256_add_toq
2703
2704 mov rax,QWORD[96+rsp]
2705 lea rbx,[96+rsp]
2706 mov r9,QWORD[((0+0))+rsp]
2707 mov r10,QWORD[((8+0))+rsp]
2708 lea rsi,[((0+0))+rsp]
2709 mov r11,QWORD[((16+0))+rsp]
2710 mov r12,QWORD[((24+0))+rsp]
2711 lea rdi,[rsp]
2712 call __ecp_nistz256_mul_montq
2713
2714 lea rdi,[128+rsp]
2715 call __ecp_nistz256_mul_by_2q
2716
2717 mov rax,QWORD[((0+32))+rsp]
2718 mov r14,QWORD[((8+32))+rsp]
2719 lea rsi,[((0+32))+rsp]
2720 mov r15,QWORD[((16+32))+rsp]
2721 mov r8,QWORD[((24+32))+rsp]
2722 DB 102,72,15,126,199
2723 call __ecp_nistz256_sqr_montq
2724
2725 lea rbx,[128+rsp]
2726 mov r8,r14
2727 mov r9,r15
2728 mov r14,rsi
2729 mov r15,rbp
2730 call __ecp_nistz256_sub_fromq
2731
2732 mov rax,QWORD[((0+0))+rsp]
2733 mov rbp,QWORD[((0+8))+rsp]
2734 mov rcx,QWORD[((0+16))+rsp]
2735 mov r10,QWORD[((0+24))+rsp]
2736 lea rdi,[rsp]
2737 call __ecp_nistz256_subq
2738
2739 mov rax,QWORD[32+rsp]
2740 lea rbx,[32+rsp]
2741 mov r14,r12
2742 xor ecx,ecx
2743 mov QWORD[((0+0))+rsp],r12
2744 mov r10,r13
2745 mov QWORD[((0+8))+rsp],r13
2746 cmovz r11,r8
2747 mov QWORD[((0+16))+rsp],r8
2748 lea rsi,[((0-0))+rsp]
2749 cmovz r12,r9
2750 mov QWORD[((0+24))+rsp],r9
2751 mov r9,r14
2752 lea rdi,[rsp]
2753 call __ecp_nistz256_mul_montq
2754
2755 DB 102,72,15,126,203
2756 DB 102,72,15,126,207
2757 call __ecp_nistz256_sub_fromq
2758
2759 lea rsi,[((160+56))+rsp]
2760
2761 mov r15,QWORD[((-48))+rsi]
2762
2763 mov r14,QWORD[((-40))+rsi]
2764
2765 mov r13,QWORD[((-32))+rsi]
2766
2767 mov r12,QWORD[((-24))+rsi]
2768
2769 mov rbx,QWORD[((-16))+rsi]
2770
2771 mov rbp,QWORD[((-8))+rsi]
2772
2773 lea rsp,[rsi]
2774
2775 $L$point_doubleq_epilogue:
2776 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
2777 mov rsi,QWORD[16+rsp]
2778 DB 0F3h,0C3h ;repret
2779
2780 $L$SEH_end_ecp_nistz256_point_double:
2781 global ecp_nistz256_point_add
2782
2783 ALIGN 32
2784 ecp_nistz256_point_add:
2785 mov QWORD[8+rsp],rdi ;WIN64 prologue
2786 mov QWORD[16+rsp],rsi
2787 mov rax,rsp
2788 $L$SEH_begin_ecp_nistz256_point_add:
2789 mov rdi,rcx
2790 mov rsi,rdx
2791 mov rdx,r8
2792
2793
2794
2795 lea rcx,[OPENSSL_ia32cap_P]
2796 mov rcx,QWORD[8+rcx]
2797 and ecx,0x80100
2798 cmp ecx,0x80100
2799 je NEAR $L$point_addx
2800 push rbp
2801
2802 push rbx
2803
2804 push r12
2805
2806 push r13
2807
2808 push r14
2809
2810 push r15
2811
2812 sub rsp,32*18+8
2813
2814 $L$point_addq_body:
2815
2816 movdqu xmm0,XMMWORD[rsi]
2817 movdqu xmm1,XMMWORD[16+rsi]
2818 movdqu xmm2,XMMWORD[32+rsi]
2819 movdqu xmm3,XMMWORD[48+rsi]
2820 movdqu xmm4,XMMWORD[64+rsi]
2821 movdqu xmm5,XMMWORD[80+rsi]
2822 mov rbx,rsi
2823 mov rsi,rdx
2824 movdqa XMMWORD[384+rsp],xmm0
2825 movdqa XMMWORD[(384+16)+rsp],xmm1
2826 movdqa XMMWORD[416+rsp],xmm2
2827 movdqa XMMWORD[(416+16)+rsp],xmm3
2828 movdqa XMMWORD[448+rsp],xmm4
2829 movdqa XMMWORD[(448+16)+rsp],xmm5
2830 por xmm5,xmm4
2831
2832 movdqu xmm0,XMMWORD[rsi]
2833 pshufd xmm3,xmm5,0xb1
2834 movdqu xmm1,XMMWORD[16+rsi]
2835 movdqu xmm2,XMMWORD[32+rsi]
2836 por xmm5,xmm3
2837 movdqu xmm3,XMMWORD[48+rsi]
2838 mov rax,QWORD[((64+0))+rsi]
2839 mov r14,QWORD[((64+8))+rsi]
2840 mov r15,QWORD[((64+16))+rsi]
2841 mov r8,QWORD[((64+24))+rsi]
2842 movdqa XMMWORD[480+rsp],xmm0
2843 pshufd xmm4,xmm5,0x1e
2844 movdqa XMMWORD[(480+16)+rsp],xmm1
2845 movdqu xmm0,XMMWORD[64+rsi]
2846 movdqu xmm1,XMMWORD[80+rsi]
2847 movdqa XMMWORD[512+rsp],xmm2
2848 movdqa XMMWORD[(512+16)+rsp],xmm3
2849 por xmm5,xmm4
2850 pxor xmm4,xmm4
2851 por xmm1,xmm0
2852 DB 102,72,15,110,199
2853
2854 lea rsi,[((64-0))+rsi]
2855 mov QWORD[((544+0))+rsp],rax
2856 mov QWORD[((544+8))+rsp],r14
2857 mov QWORD[((544+16))+rsp],r15
2858 mov QWORD[((544+24))+rsp],r8
2859 lea rdi,[96+rsp]
2860 call __ecp_nistz256_sqr_montq
2861
2862 pcmpeqd xmm5,xmm4
2863 pshufd xmm4,xmm1,0xb1
2864 por xmm4,xmm1
2865 pshufd xmm5,xmm5,0
2866 pshufd xmm3,xmm4,0x1e
2867 por xmm4,xmm3
2868 pxor xmm3,xmm3
2869 pcmpeqd xmm4,xmm3
2870 pshufd xmm4,xmm4,0
2871 mov rax,QWORD[((64+0))+rbx]
2872 mov r14,QWORD[((64+8))+rbx]
2873 mov r15,QWORD[((64+16))+rbx]
2874 mov r8,QWORD[((64+24))+rbx]
2875 DB 102,72,15,110,203
2876
2877 lea rsi,[((64-0))+rbx]
2878 lea rdi,[32+rsp]
2879 call __ecp_nistz256_sqr_montq
2880
2881 mov rax,QWORD[544+rsp]
2882 lea rbx,[544+rsp]
2883 mov r9,QWORD[((0+96))+rsp]
2884 mov r10,QWORD[((8+96))+rsp]
2885 lea rsi,[((0+96))+rsp]
2886 mov r11,QWORD[((16+96))+rsp]
2887 mov r12,QWORD[((24+96))+rsp]
2888 lea rdi,[224+rsp]
2889 call __ecp_nistz256_mul_montq
2890
2891 mov rax,QWORD[448+rsp]
2892 lea rbx,[448+rsp]
2893 mov r9,QWORD[((0+32))+rsp]
2894 mov r10,QWORD[((8+32))+rsp]
2895 lea rsi,[((0+32))+rsp]
2896 mov r11,QWORD[((16+32))+rsp]
2897 mov r12,QWORD[((24+32))+rsp]
2898 lea rdi,[256+rsp]
2899 call __ecp_nistz256_mul_montq
2900
2901 mov rax,QWORD[416+rsp]
2902 lea rbx,[416+rsp]
2903 mov r9,QWORD[((0+224))+rsp]
2904 mov r10,QWORD[((8+224))+rsp]
2905 lea rsi,[((0+224))+rsp]
2906 mov r11,QWORD[((16+224))+rsp]
2907 mov r12,QWORD[((24+224))+rsp]
2908 lea rdi,[224+rsp]
2909 call __ecp_nistz256_mul_montq
2910
2911 mov rax,QWORD[512+rsp]
2912 lea rbx,[512+rsp]
2913 mov r9,QWORD[((0+256))+rsp]
2914 mov r10,QWORD[((8+256))+rsp]
2915 lea rsi,[((0+256))+rsp]
2916 mov r11,QWORD[((16+256))+rsp]
2917 mov r12,QWORD[((24+256))+rsp]
2918 lea rdi,[256+rsp]
2919 call __ecp_nistz256_mul_montq
2920
2921 lea rbx,[224+rsp]
2922 lea rdi,[64+rsp]
2923 call __ecp_nistz256_sub_fromq
2924
2925 or r12,r13
2926 movdqa xmm2,xmm4
2927 or r12,r8
2928 or r12,r9
2929 por xmm2,xmm5
2930 DB 102,73,15,110,220
2931
2932 mov rax,QWORD[384+rsp]
2933 lea rbx,[384+rsp]
2934 mov r9,QWORD[((0+96))+rsp]
2935 mov r10,QWORD[((8+96))+rsp]
2936 lea rsi,[((0+96))+rsp]
2937 mov r11,QWORD[((16+96))+rsp]
2938 mov r12,QWORD[((24+96))+rsp]
2939 lea rdi,[160+rsp]
2940 call __ecp_nistz256_mul_montq
2941
2942 mov rax,QWORD[480+rsp]
2943 lea rbx,[480+rsp]
2944 mov r9,QWORD[((0+32))+rsp]
2945 mov r10,QWORD[((8+32))+rsp]
2946 lea rsi,[((0+32))+rsp]
2947 mov r11,QWORD[((16+32))+rsp]
2948 mov r12,QWORD[((24+32))+rsp]
2949 lea rdi,[192+rsp]
2950 call __ecp_nistz256_mul_montq
2951
2952 lea rbx,[160+rsp]
2953 lea rdi,[rsp]
2954 call __ecp_nistz256_sub_fromq
2955
2956 or r12,r13
2957 or r12,r8
2958 or r12,r9
2959
2960 DB 102,73,15,126,208
2961 DB 102,73,15,126,217
2962 or r12,r8
2963 DB 0x3e
2964 jnz NEAR $L$add_proceedq
2965
2966
2967
2968 test r9,r9
2969 jz NEAR $L$add_doubleq
2970
2971
2972
2973
2974
2975
2976 DB 102,72,15,126,199
2977 pxor xmm0,xmm0
2978 movdqu XMMWORD[rdi],xmm0
2979 movdqu XMMWORD[16+rdi],xmm0
2980 movdqu XMMWORD[32+rdi],xmm0
2981 movdqu XMMWORD[48+rdi],xmm0
2982 movdqu XMMWORD[64+rdi],xmm0
2983 movdqu XMMWORD[80+rdi],xmm0
2984 jmp NEAR $L$add_doneq
2985
2986 ALIGN 32
2987 $L$add_doubleq:
2988 DB 102,72,15,126,206
2989 DB 102,72,15,126,199
2990 add rsp,416
2991
2992 jmp NEAR $L$point_double_shortcutq
2993
2994
2995 ALIGN 32
2996 $L$add_proceedq:
2997 mov rax,QWORD[((0+64))+rsp]
2998 mov r14,QWORD[((8+64))+rsp]
2999 lea rsi,[((0+64))+rsp]
3000 mov r15,QWORD[((16+64))+rsp]
3001 mov r8,QWORD[((24+64))+rsp]
3002 lea rdi,[96+rsp]
3003 call __ecp_nistz256_sqr_montq
3004
3005 mov rax,QWORD[448+rsp]
3006 lea rbx,[448+rsp]
3007 mov r9,QWORD[((0+0))+rsp]
3008 mov r10,QWORD[((8+0))+rsp]
3009 lea rsi,[((0+0))+rsp]
3010 mov r11,QWORD[((16+0))+rsp]
3011 mov r12,QWORD[((24+0))+rsp]
3012 lea rdi,[352+rsp]
3013 call __ecp_nistz256_mul_montq
3014
3015 mov rax,QWORD[((0+0))+rsp]
3016 mov r14,QWORD[((8+0))+rsp]
3017 lea rsi,[((0+0))+rsp]
3018 mov r15,QWORD[((16+0))+rsp]
3019 mov r8,QWORD[((24+0))+rsp]
3020 lea rdi,[32+rsp]
3021 call __ecp_nistz256_sqr_montq
3022
3023 mov rax,QWORD[544+rsp]
3024 lea rbx,[544+rsp]
3025 mov r9,QWORD[((0+352))+rsp]
3026 mov r10,QWORD[((8+352))+rsp]
3027 lea rsi,[((0+352))+rsp]
3028 mov r11,QWORD[((16+352))+rsp]
3029 mov r12,QWORD[((24+352))+rsp]
3030 lea rdi,[352+rsp]
3031 call __ecp_nistz256_mul_montq
3032
3033 mov rax,QWORD[rsp]
3034 lea rbx,[rsp]
3035 mov r9,QWORD[((0+32))+rsp]
3036 mov r10,QWORD[((8+32))+rsp]
3037 lea rsi,[((0+32))+rsp]
3038 mov r11,QWORD[((16+32))+rsp]
3039 mov r12,QWORD[((24+32))+rsp]
3040 lea rdi,[128+rsp]
3041 call __ecp_nistz256_mul_montq
3042
3043 mov rax,QWORD[160+rsp]
3044 lea rbx,[160+rsp]
3045 mov r9,QWORD[((0+32))+rsp]
3046 mov r10,QWORD[((8+32))+rsp]
3047 lea rsi,[((0+32))+rsp]
3048 mov r11,QWORD[((16+32))+rsp]
3049 mov r12,QWORD[((24+32))+rsp]
3050 lea rdi,[192+rsp]
3051 call __ecp_nistz256_mul_montq
3052
3053
3054
3055
3056 xor r11,r11
3057 add r12,r12
3058 lea rsi,[96+rsp]
3059 adc r13,r13
3060 mov rax,r12
3061 adc r8,r8
3062 adc r9,r9
3063 mov rbp,r13
3064 adc r11,0
3065
3066 sub r12,-1
3067 mov rcx,r8
3068 sbb r13,r14
3069 sbb r8,0
3070 mov r10,r9
3071 sbb r9,r15
3072 sbb r11,0
3073
3074 cmovc r12,rax
3075 mov rax,QWORD[rsi]
3076 cmovc r13,rbp
3077 mov rbp,QWORD[8+rsi]
3078 cmovc r8,rcx
3079 mov rcx,QWORD[16+rsi]
3080 cmovc r9,r10
3081 mov r10,QWORD[24+rsi]
3082
3083 call __ecp_nistz256_subq
3084
3085 lea rbx,[128+rsp]
3086 lea rdi,[288+rsp]
3087 call __ecp_nistz256_sub_fromq
3088
3089 mov rax,QWORD[((192+0))+rsp]
3090 mov rbp,QWORD[((192+8))+rsp]
3091 mov rcx,QWORD[((192+16))+rsp]
3092 mov r10,QWORD[((192+24))+rsp]
3093 lea rdi,[320+rsp]
3094
3095 call __ecp_nistz256_subq
3096
3097 mov QWORD[rdi],r12
3098 mov QWORD[8+rdi],r13
3099 mov QWORD[16+rdi],r8
3100 mov QWORD[24+rdi],r9
3101 mov rax,QWORD[128+rsp]
3102 lea rbx,[128+rsp]
3103 mov r9,QWORD[((0+224))+rsp]
3104 mov r10,QWORD[((8+224))+rsp]
3105 lea rsi,[((0+224))+rsp]
3106 mov r11,QWORD[((16+224))+rsp]
3107 mov r12,QWORD[((24+224))+rsp]
3108 lea rdi,[256+rsp]
3109 call __ecp_nistz256_mul_montq
3110
3111 mov rax,QWORD[320+rsp]
3112 lea rbx,[320+rsp]
3113 mov r9,QWORD[((0+64))+rsp]
3114 mov r10,QWORD[((8+64))+rsp]
3115 lea rsi,[((0+64))+rsp]
3116 mov r11,QWORD[((16+64))+rsp]
3117 mov r12,QWORD[((24+64))+rsp]
3118 lea rdi,[320+rsp]
3119 call __ecp_nistz256_mul_montq
3120
3121 lea rbx,[256+rsp]
3122 lea rdi,[320+rsp]
3123 call __ecp_nistz256_sub_fromq
3124
3125 DB 102,72,15,126,199
3126
3127 movdqa xmm0,xmm5
3128 movdqa xmm1,xmm5
3129 pandn xmm0,XMMWORD[352+rsp]
3130 movdqa xmm2,xmm5
3131 pandn xmm1,XMMWORD[((352+16))+rsp]
3132 movdqa xmm3,xmm5
3133 pand xmm2,XMMWORD[544+rsp]
3134 pand xmm3,XMMWORD[((544+16))+rsp]
3135 por xmm2,xmm0
3136 por xmm3,xmm1
3137
3138 movdqa xmm0,xmm4
3139 movdqa xmm1,xmm4
3140 pandn xmm0,xmm2
3141 movdqa xmm2,xmm4
3142 pandn xmm1,xmm3
3143 movdqa xmm3,xmm4
3144 pand xmm2,XMMWORD[448+rsp]
3145 pand xmm3,XMMWORD[((448+16))+rsp]
3146 por xmm2,xmm0
3147 por xmm3,xmm1
3148 movdqu XMMWORD[64+rdi],xmm2
3149 movdqu XMMWORD[80+rdi],xmm3
3150
3151 movdqa xmm0,xmm5
3152 movdqa xmm1,xmm5
3153 pandn xmm0,XMMWORD[288+rsp]
3154 movdqa xmm2,xmm5
3155 pandn xmm1,XMMWORD[((288+16))+rsp]
3156 movdqa xmm3,xmm5
3157 pand xmm2,XMMWORD[480+rsp]
3158 pand xmm3,XMMWORD[((480+16))+rsp]
3159 por xmm2,xmm0
3160 por xmm3,xmm1
3161
3162 movdqa xmm0,xmm4
3163 movdqa xmm1,xmm4
3164 pandn xmm0,xmm2
3165 movdqa xmm2,xmm4
3166 pandn xmm1,xmm3
3167 movdqa xmm3,xmm4
3168 pand xmm2,XMMWORD[384+rsp]
3169 pand xmm3,XMMWORD[((384+16))+rsp]
3170 por xmm2,xmm0
3171 por xmm3,xmm1
3172 movdqu XMMWORD[rdi],xmm2
3173 movdqu XMMWORD[16+rdi],xmm3
3174
3175 movdqa xmm0,xmm5
3176 movdqa xmm1,xmm5
3177 pandn xmm0,XMMWORD[320+rsp]
3178 movdqa xmm2,xmm5
3179 pandn xmm1,XMMWORD[((320+16))+rsp]
3180 movdqa xmm3,xmm5
3181 pand xmm2,XMMWORD[512+rsp]
3182 pand xmm3,XMMWORD[((512+16))+rsp]
3183 por xmm2,xmm0
3184 por xmm3,xmm1
3185
3186 movdqa xmm0,xmm4
3187 movdqa xmm1,xmm4
3188 pandn xmm0,xmm2
3189 movdqa xmm2,xmm4
3190 pandn xmm1,xmm3
3191 movdqa xmm3,xmm4
3192 pand xmm2,XMMWORD[416+rsp]
3193 pand xmm3,XMMWORD[((416+16))+rsp]
3194 por xmm2,xmm0
3195 por xmm3,xmm1
3196 movdqu XMMWORD[32+rdi],xmm2
3197 movdqu XMMWORD[48+rdi],xmm3
3198
3199 $L$add_doneq:
3200 lea rsi,[((576+56))+rsp]
3201
3202 mov r15,QWORD[((-48))+rsi]
3203
3204 mov r14,QWORD[((-40))+rsi]
3205
3206 mov r13,QWORD[((-32))+rsi]
3207
3208 mov r12,QWORD[((-24))+rsi]
3209
3210 mov rbx,QWORD[((-16))+rsi]
3211
3212 mov rbp,QWORD[((-8))+rsi]
3213
3214 lea rsp,[rsi]
3215
3216 $L$point_addq_epilogue:
3217 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
3218 mov rsi,QWORD[16+rsp]
3219 DB 0F3h,0C3h ;repret
3220
3221 $L$SEH_end_ecp_nistz256_point_add:
3222 global ecp_nistz256_point_add_affine
3223
3224 ALIGN 32
3225 ecp_nistz256_point_add_affine:
3226 mov QWORD[8+rsp],rdi ;WIN64 prologue
3227 mov QWORD[16+rsp],rsi
3228 mov rax,rsp
3229 $L$SEH_begin_ecp_nistz256_point_add_affine:
3230 mov rdi,rcx
3231 mov rsi,rdx
3232 mov rdx,r8
3233
3234
3235
3236 lea rcx,[OPENSSL_ia32cap_P]
3237 mov rcx,QWORD[8+rcx]
3238 and ecx,0x80100
3239 cmp ecx,0x80100
3240 je NEAR $L$point_add_affinex
3241 push rbp
3242
3243 push rbx
3244
3245 push r12
3246
3247 push r13
3248
3249 push r14
3250
3251 push r15
3252
3253 sub rsp,32*15+8
3254
3255 $L$add_affineq_body:
3256
3257 movdqu xmm0,XMMWORD[rsi]
3258 mov rbx,rdx
3259 movdqu xmm1,XMMWORD[16+rsi]
3260 movdqu xmm2,XMMWORD[32+rsi]
3261 movdqu xmm3,XMMWORD[48+rsi]
3262 movdqu xmm4,XMMWORD[64+rsi]
3263 movdqu xmm5,XMMWORD[80+rsi]
3264 mov rax,QWORD[((64+0))+rsi]
3265 mov r14,QWORD[((64+8))+rsi]
3266 mov r15,QWORD[((64+16))+rsi]
3267 mov r8,QWORD[((64+24))+rsi]
3268 movdqa XMMWORD[320+rsp],xmm0
3269 movdqa XMMWORD[(320+16)+rsp],xmm1
3270 movdqa XMMWORD[352+rsp],xmm2
3271 movdqa XMMWORD[(352+16)+rsp],xmm3
3272 movdqa XMMWORD[384+rsp],xmm4
3273 movdqa XMMWORD[(384+16)+rsp],xmm5
3274 por xmm5,xmm4
3275
3276 movdqu xmm0,XMMWORD[rbx]
3277 pshufd xmm3,xmm5,0xb1
3278 movdqu xmm1,XMMWORD[16+rbx]
3279 movdqu xmm2,XMMWORD[32+rbx]
3280 por xmm5,xmm3
3281 movdqu xmm3,XMMWORD[48+rbx]
3282 movdqa XMMWORD[416+rsp],xmm0
3283 pshufd xmm4,xmm5,0x1e
3284 movdqa XMMWORD[(416+16)+rsp],xmm1
3285 por xmm1,xmm0
3286 DB 102,72,15,110,199
3287 movdqa XMMWORD[448+rsp],xmm2
3288 movdqa XMMWORD[(448+16)+rsp],xmm3
3289 por xmm3,xmm2
3290 por xmm5,xmm4
3291 pxor xmm4,xmm4
3292 por xmm3,xmm1
3293
3294 lea rsi,[((64-0))+rsi]
3295 lea rdi,[32+rsp]
3296 call __ecp_nistz256_sqr_montq
3297
3298 pcmpeqd xmm5,xmm4
3299 pshufd xmm4,xmm3,0xb1
3300 mov rax,QWORD[rbx]
3301
3302 mov r9,r12
3303 por xmm4,xmm3
3304 pshufd xmm5,xmm5,0
3305 pshufd xmm3,xmm4,0x1e
3306 mov r10,r13
3307 por xmm4,xmm3
3308 pxor xmm3,xmm3
3309 mov r11,r14
3310 pcmpeqd xmm4,xmm3
3311 pshufd xmm4,xmm4,0
3312
3313 lea rsi,[((32-0))+rsp]
3314 mov r12,r15
3315 lea rdi,[rsp]
3316 call __ecp_nistz256_mul_montq
3317
3318 lea rbx,[320+rsp]
3319 lea rdi,[64+rsp]
3320 call __ecp_nistz256_sub_fromq
3321
3322 mov rax,QWORD[384+rsp]
3323 lea rbx,[384+rsp]
3324 mov r9,QWORD[((0+32))+rsp]
3325 mov r10,QWORD[((8+32))+rsp]
3326 lea rsi,[((0+32))+rsp]
3327 mov r11,QWORD[((16+32))+rsp]
3328 mov r12,QWORD[((24+32))+rsp]
3329 lea rdi,[32+rsp]
3330 call __ecp_nistz256_mul_montq
3331
3332 mov rax,QWORD[384+rsp]
3333 lea rbx,[384+rsp]
3334 mov r9,QWORD[((0+64))+rsp]
3335 mov r10,QWORD[((8+64))+rsp]
3336 lea rsi,[((0+64))+rsp]
3337 mov r11,QWORD[((16+64))+rsp]
3338 mov r12,QWORD[((24+64))+rsp]
3339 lea rdi,[288+rsp]
3340 call __ecp_nistz256_mul_montq
3341
3342 mov rax,QWORD[448+rsp]
3343 lea rbx,[448+rsp]
3344 mov r9,QWORD[((0+32))+rsp]
3345 mov r10,QWORD[((8+32))+rsp]
3346 lea rsi,[((0+32))+rsp]
3347 mov r11,QWORD[((16+32))+rsp]
3348 mov r12,QWORD[((24+32))+rsp]
3349 lea rdi,[32+rsp]
3350 call __ecp_nistz256_mul_montq
3351
3352 lea rbx,[352+rsp]
3353 lea rdi,[96+rsp]
3354 call __ecp_nistz256_sub_fromq
3355
3356 mov rax,QWORD[((0+64))+rsp]
3357 mov r14,QWORD[((8+64))+rsp]
3358 lea rsi,[((0+64))+rsp]
3359 mov r15,QWORD[((16+64))+rsp]
3360 mov r8,QWORD[((24+64))+rsp]
3361 lea rdi,[128+rsp]
3362 call __ecp_nistz256_sqr_montq
3363
3364 mov rax,QWORD[((0+96))+rsp]
3365 mov r14,QWORD[((8+96))+rsp]
3366 lea rsi,[((0+96))+rsp]
3367 mov r15,QWORD[((16+96))+rsp]
3368 mov r8,QWORD[((24+96))+rsp]
3369 lea rdi,[192+rsp]
3370 call __ecp_nistz256_sqr_montq
3371
3372 mov rax,QWORD[128+rsp]
3373 lea rbx,[128+rsp]
3374 mov r9,QWORD[((0+64))+rsp]
3375 mov r10,QWORD[((8+64))+rsp]
3376 lea rsi,[((0+64))+rsp]
3377 mov r11,QWORD[((16+64))+rsp]
3378 mov r12,QWORD[((24+64))+rsp]
3379 lea rdi,[160+rsp]
3380 call __ecp_nistz256_mul_montq
3381
3382 mov rax,QWORD[320+rsp]
3383 lea rbx,[320+rsp]
3384 mov r9,QWORD[((0+128))+rsp]
3385 mov r10,QWORD[((8+128))+rsp]
3386 lea rsi,[((0+128))+rsp]
3387 mov r11,QWORD[((16+128))+rsp]
3388 mov r12,QWORD[((24+128))+rsp]
3389 lea rdi,[rsp]
3390 call __ecp_nistz256_mul_montq
3391
3392
3393
3394
3395 xor r11,r11
3396 add r12,r12
3397 lea rsi,[192+rsp]
3398 adc r13,r13
3399 mov rax,r12
3400 adc r8,r8
3401 adc r9,r9
3402 mov rbp,r13
3403 adc r11,0
3404
3405 sub r12,-1
3406 mov rcx,r8
3407 sbb r13,r14
3408 sbb r8,0
3409 mov r10,r9
3410 sbb r9,r15
3411 sbb r11,0
3412
3413 cmovc r12,rax
3414 mov rax,QWORD[rsi]
3415 cmovc r13,rbp
3416 mov rbp,QWORD[8+rsi]
3417 cmovc r8,rcx
3418 mov rcx,QWORD[16+rsi]
3419 cmovc r9,r10
3420 mov r10,QWORD[24+rsi]
3421
3422 call __ecp_nistz256_subq
3423
3424 lea rbx,[160+rsp]
3425 lea rdi,[224+rsp]
3426 call __ecp_nistz256_sub_fromq
3427
3428 mov rax,QWORD[((0+0))+rsp]
3429 mov rbp,QWORD[((0+8))+rsp]
3430 mov rcx,QWORD[((0+16))+rsp]
3431 mov r10,QWORD[((0+24))+rsp]
3432 lea rdi,[64+rsp]
3433
3434 call __ecp_nistz256_subq
3435
3436 mov QWORD[rdi],r12
3437 mov QWORD[8+rdi],r13
3438 mov QWORD[16+rdi],r8
3439 mov QWORD[24+rdi],r9
3440 mov rax,QWORD[352+rsp]
3441 lea rbx,[352+rsp]
3442 mov r9,QWORD[((0+160))+rsp]
3443 mov r10,QWORD[((8+160))+rsp]
3444 lea rsi,[((0+160))+rsp]
3445 mov r11,QWORD[((16+160))+rsp]
3446 mov r12,QWORD[((24+160))+rsp]
3447 lea rdi,[32+rsp]
3448 call __ecp_nistz256_mul_montq
3449
3450 mov rax,QWORD[96+rsp]
3451 lea rbx,[96+rsp]
3452 mov r9,QWORD[((0+64))+rsp]
3453 mov r10,QWORD[((8+64))+rsp]
3454 lea rsi,[((0+64))+rsp]
3455 mov r11,QWORD[((16+64))+rsp]
3456 mov r12,QWORD[((24+64))+rsp]
3457 lea rdi,[64+rsp]
3458 call __ecp_nistz256_mul_montq
3459
3460 lea rbx,[32+rsp]
3461 lea rdi,[256+rsp]
3462 call __ecp_nistz256_sub_fromq
3463
3464 DB 102,72,15,126,199
3465
3466 movdqa xmm0,xmm5
3467 movdqa xmm1,xmm5
3468 pandn xmm0,XMMWORD[288+rsp]
3469 movdqa xmm2,xmm5
3470 pandn xmm1,XMMWORD[((288+16))+rsp]
3471 movdqa xmm3,xmm5
3472 pand xmm2,XMMWORD[$L$ONE_mont]
3473 pand xmm3,XMMWORD[(($L$ONE_mont+16))]
3474 por xmm2,xmm0
3475 por xmm3,xmm1
3476
3477 movdqa xmm0,xmm4
3478 movdqa xmm1,xmm4
3479 pandn xmm0,xmm2
3480 movdqa xmm2,xmm4
3481 pandn xmm1,xmm3
3482 movdqa xmm3,xmm4
3483 pand xmm2,XMMWORD[384+rsp]
3484 pand xmm3,XMMWORD[((384+16))+rsp]
3485 por xmm2,xmm0
3486 por xmm3,xmm1
3487 movdqu XMMWORD[64+rdi],xmm2
3488 movdqu XMMWORD[80+rdi],xmm3
3489
3490 movdqa xmm0,xmm5
3491 movdqa xmm1,xmm5
3492 pandn xmm0,XMMWORD[224+rsp]
3493 movdqa xmm2,xmm5
3494 pandn xmm1,XMMWORD[((224+16))+rsp]
3495 movdqa xmm3,xmm5
3496 pand xmm2,XMMWORD[416+rsp]
3497 pand xmm3,XMMWORD[((416+16))+rsp]
3498 por xmm2,xmm0
3499 por xmm3,xmm1
3500
3501 movdqa xmm0,xmm4
3502 movdqa xmm1,xmm4
3503 pandn xmm0,xmm2
3504 movdqa xmm2,xmm4
3505 pandn xmm1,xmm3
3506 movdqa xmm3,xmm4
3507 pand xmm2,XMMWORD[320+rsp]
3508 pand xmm3,XMMWORD[((320+16))+rsp]
3509 por xmm2,xmm0
3510 por xmm3,xmm1
3511 movdqu XMMWORD[rdi],xmm2
3512 movdqu XMMWORD[16+rdi],xmm3
3513
3514 movdqa xmm0,xmm5
3515 movdqa xmm1,xmm5
3516 pandn xmm0,XMMWORD[256+rsp]
3517 movdqa xmm2,xmm5
3518 pandn xmm1,XMMWORD[((256+16))+rsp]
3519 movdqa xmm3,xmm5
3520 pand xmm2,XMMWORD[448+rsp]
3521 pand xmm3,XMMWORD[((448+16))+rsp]
3522 por xmm2,xmm0
3523 por xmm3,xmm1
3524
3525 movdqa xmm0,xmm4
3526 movdqa xmm1,xmm4
3527 pandn xmm0,xmm2
3528 movdqa xmm2,xmm4
3529 pandn xmm1,xmm3
3530 movdqa xmm3,xmm4
3531 pand xmm2,XMMWORD[352+rsp]
3532 pand xmm3,XMMWORD[((352+16))+rsp]
3533 por xmm2,xmm0
3534 por xmm3,xmm1
3535 movdqu XMMWORD[32+rdi],xmm2
3536 movdqu XMMWORD[48+rdi],xmm3
3537
3538 lea rsi,[((480+56))+rsp]
3539
3540 mov r15,QWORD[((-48))+rsi]
3541
3542 mov r14,QWORD[((-40))+rsi]
3543
3544 mov r13,QWORD[((-32))+rsi]
3545
3546 mov r12,QWORD[((-24))+rsi]
3547
3548 mov rbx,QWORD[((-16))+rsi]
3549
3550 mov rbp,QWORD[((-8))+rsi]
3551
3552 lea rsp,[rsi]
3553
3554 $L$add_affineq_epilogue:
3555 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
3556 mov rsi,QWORD[16+rsp]
3557 DB 0F3h,0C3h ;repret
3558
3559 $L$SEH_end_ecp_nistz256_point_add_affine:
3560
3561 ALIGN 32
3562 __ecp_nistz256_add_tox:
3563
3564 xor r11,r11
3565 adc r12,QWORD[rbx]
3566 adc r13,QWORD[8+rbx]
3567 mov rax,r12
3568 adc r8,QWORD[16+rbx]
3569 adc r9,QWORD[24+rbx]
3570 mov rbp,r13
3571 adc r11,0
3572
3573 xor r10,r10
3574 sbb r12,-1
3575 mov rcx,r8
3576 sbb r13,r14
3577 sbb r8,0
3578 mov r10,r9
3579 sbb r9,r15
3580 sbb r11,0
3581
3582 cmovc r12,rax
3583 cmovc r13,rbp
3584 mov QWORD[rdi],r12
3585 cmovc r8,rcx
3586 mov QWORD[8+rdi],r13
3587 cmovc r9,r10
3588 mov QWORD[16+rdi],r8
3589 mov QWORD[24+rdi],r9
3590
3591 DB 0F3h,0C3h ;repret
3592
3593
3594
3595
3596 ALIGN 32
3597 __ecp_nistz256_sub_fromx:
3598
3599 xor r11,r11
3600 sbb r12,QWORD[rbx]
3601 sbb r13,QWORD[8+rbx]
3602 mov rax,r12
3603 sbb r8,QWORD[16+rbx]
3604 sbb r9,QWORD[24+rbx]
3605 mov rbp,r13
3606 sbb r11,0
3607
3608 xor r10,r10
3609 adc r12,-1
3610 mov rcx,r8
3611 adc r13,r14
3612 adc r8,0
3613 mov r10,r9
3614 adc r9,r15
3615
3616 bt r11,0
3617 cmovnc r12,rax
3618 cmovnc r13,rbp
3619 mov QWORD[rdi],r12
3620 cmovnc r8,rcx
3621 mov QWORD[8+rdi],r13
3622 cmovnc r9,r10
3623 mov QWORD[16+rdi],r8
3624 mov QWORD[24+rdi],r9
3625
3626 DB 0F3h,0C3h ;repret
3627
3628
3629
3630
3631 ALIGN 32
3632 __ecp_nistz256_subx:
3633
3634 xor r11,r11
3635 sbb rax,r12
3636 sbb rbp,r13
3637 mov r12,rax
3638 sbb rcx,r8
3639 sbb r10,r9
3640 mov r13,rbp
3641 sbb r11,0
3642
3643 xor r9,r9
3644 adc rax,-1
3645 mov r8,rcx
3646 adc rbp,r14
3647 adc rcx,0
3648 mov r9,r10
3649 adc r10,r15
3650
3651 bt r11,0
3652 cmovc r12,rax
3653 cmovc r13,rbp
3654 cmovc r8,rcx
3655 cmovc r9,r10
3656
3657 DB 0F3h,0C3h ;repret
3658
3659
3660
3661
3662 ALIGN 32
3663 __ecp_nistz256_mul_by_2x:
3664
3665 xor r11,r11
3666 adc r12,r12
3667 adc r13,r13
3668 mov rax,r12
3669 adc r8,r8
3670 adc r9,r9
3671 mov rbp,r13
3672 adc r11,0
3673
3674 xor r10,r10
3675 sbb r12,-1
3676 mov rcx,r8
3677 sbb r13,r14
3678 sbb r8,0
3679 mov r10,r9
3680 sbb r9,r15
3681 sbb r11,0
3682
3683 cmovc r12,rax
3684 cmovc r13,rbp
3685 mov QWORD[rdi],r12
3686 cmovc r8,rcx
3687 mov QWORD[8+rdi],r13
3688 cmovc r9,r10
3689 mov QWORD[16+rdi],r8
3690 mov QWORD[24+rdi],r9
3691
3692 DB 0F3h,0C3h ;repret
3693
3694
3695
3696 ALIGN 32
3697 ecp_nistz256_point_doublex:
3698 mov QWORD[8+rsp],rdi ;WIN64 prologue
3699 mov QWORD[16+rsp],rsi
3700 mov rax,rsp
3701 $L$SEH_begin_ecp_nistz256_point_doublex:
3702 mov rdi,rcx
3703 mov rsi,rdx
3704
3705
3706
3707 $L$point_doublex:
3708 push rbp
3709
3710 push rbx
3711
3712 push r12
3713
3714 push r13
3715
3716 push r14
3717
3718 push r15
3719
3720 sub rsp,32*5+8
3721
3722 $L$point_doublex_body:
3723
3724 $L$point_double_shortcutx:
3725 movdqu xmm0,XMMWORD[rsi]
3726 mov rbx,rsi
3727 movdqu xmm1,XMMWORD[16+rsi]
3728 mov r12,QWORD[((32+0))+rsi]
3729 mov r13,QWORD[((32+8))+rsi]
3730 mov r8,QWORD[((32+16))+rsi]
3731 mov r9,QWORD[((32+24))+rsi]
3732 mov r14,QWORD[(($L$poly+8))]
3733 mov r15,QWORD[(($L$poly+24))]
3734 movdqa XMMWORD[96+rsp],xmm0
3735 movdqa XMMWORD[(96+16)+rsp],xmm1
3736 lea r10,[32+rdi]
3737 lea r11,[64+rdi]
3738 DB 102,72,15,110,199
3739 DB 102,73,15,110,202
3740 DB 102,73,15,110,211
3741
3742 lea rdi,[rsp]
3743 call __ecp_nistz256_mul_by_2x
3744
3745 mov rdx,QWORD[((64+0))+rsi]
3746 mov r14,QWORD[((64+8))+rsi]
3747 mov r15,QWORD[((64+16))+rsi]
3748 mov r8,QWORD[((64+24))+rsi]
3749 lea rsi,[((64-128))+rsi]
3750 lea rdi,[64+rsp]
3751 call __ecp_nistz256_sqr_montx
3752
3753 mov rdx,QWORD[((0+0))+rsp]
3754 mov r14,QWORD[((8+0))+rsp]
3755 lea rsi,[((-128+0))+rsp]
3756 mov r15,QWORD[((16+0))+rsp]
3757 mov r8,QWORD[((24+0))+rsp]
3758 lea rdi,[rsp]
3759 call __ecp_nistz256_sqr_montx
3760
3761 mov rdx,QWORD[32+rbx]
3762 mov r9,QWORD[((64+0))+rbx]
3763 mov r10,QWORD[((64+8))+rbx]
3764 mov r11,QWORD[((64+16))+rbx]
3765 mov r12,QWORD[((64+24))+rbx]
3766 lea rsi,[((64-128))+rbx]
3767 lea rbx,[32+rbx]
3768 DB 102,72,15,126,215
3769 call __ecp_nistz256_mul_montx
3770 call __ecp_nistz256_mul_by_2x
3771
3772 mov r12,QWORD[((96+0))+rsp]
3773 mov r13,QWORD[((96+8))+rsp]
3774 lea rbx,[64+rsp]
3775 mov r8,QWORD[((96+16))+rsp]
3776 mov r9,QWORD[((96+24))+rsp]
3777 lea rdi,[32+rsp]
3778 call __ecp_nistz256_add_tox
3779
3780 mov r12,QWORD[((96+0))+rsp]
3781 mov r13,QWORD[((96+8))+rsp]
3782 lea rbx,[64+rsp]
3783 mov r8,QWORD[((96+16))+rsp]
3784 mov r9,QWORD[((96+24))+rsp]
3785 lea rdi,[64+rsp]
3786 call __ecp_nistz256_sub_fromx
3787
3788 mov rdx,QWORD[((0+0))+rsp]
3789 mov r14,QWORD[((8+0))+rsp]
3790 lea rsi,[((-128+0))+rsp]
3791 mov r15,QWORD[((16+0))+rsp]
3792 mov r8,QWORD[((24+0))+rsp]
3793 DB 102,72,15,126,207
3794 call __ecp_nistz256_sqr_montx
3795 xor r9,r9
3796 mov rax,r12
3797 add r12,-1
3798 mov r10,r13
3799 adc r13,rsi
3800 mov rcx,r14
3801 adc r14,0
3802 mov r8,r15
3803 adc r15,rbp
3804 adc r9,0
3805 xor rsi,rsi
3806 test rax,1
3807
3808 cmovz r12,rax
3809 cmovz r13,r10
3810 cmovz r14,rcx
3811 cmovz r15,r8
3812 cmovz r9,rsi
3813
3814 mov rax,r13
3815 shr r12,1
3816 shl rax,63
3817 mov r10,r14
3818 shr r13,1
3819 or r12,rax
3820 shl r10,63
3821 mov rcx,r15
3822 shr r14,1
3823 or r13,r10
3824 shl rcx,63
3825 mov QWORD[rdi],r12
3826 shr r15,1
3827 mov QWORD[8+rdi],r13
3828 shl r9,63
3829 or r14,rcx
3830 or r15,r9
3831 mov QWORD[16+rdi],r14
3832 mov QWORD[24+rdi],r15
3833 mov rdx,QWORD[64+rsp]
3834 lea rbx,[64+rsp]
3835 mov r9,QWORD[((0+32))+rsp]
3836 mov r10,QWORD[((8+32))+rsp]
3837 lea rsi,[((-128+32))+rsp]
3838 mov r11,QWORD[((16+32))+rsp]
3839 mov r12,QWORD[((24+32))+rsp]
3840 lea rdi,[32+rsp]
3841 call __ecp_nistz256_mul_montx
3842
3843 lea rdi,[128+rsp]
3844 call __ecp_nistz256_mul_by_2x
3845
3846 lea rbx,[32+rsp]
3847 lea rdi,[32+rsp]
3848 call __ecp_nistz256_add_tox
3849
3850 mov rdx,QWORD[96+rsp]
3851 lea rbx,[96+rsp]
3852 mov r9,QWORD[((0+0))+rsp]
3853 mov r10,QWORD[((8+0))+rsp]
3854 lea rsi,[((-128+0))+rsp]
3855 mov r11,QWORD[((16+0))+rsp]
3856 mov r12,QWORD[((24+0))+rsp]
3857 lea rdi,[rsp]
3858 call __ecp_nistz256_mul_montx
3859
3860 lea rdi,[128+rsp]
3861 call __ecp_nistz256_mul_by_2x
3862
3863 mov rdx,QWORD[((0+32))+rsp]
3864 mov r14,QWORD[((8+32))+rsp]
3865 lea rsi,[((-128+32))+rsp]
3866 mov r15,QWORD[((16+32))+rsp]
3867 mov r8,QWORD[((24+32))+rsp]
3868 DB 102,72,15,126,199
3869 call __ecp_nistz256_sqr_montx
3870
3871 lea rbx,[128+rsp]
3872 mov r8,r14
3873 mov r9,r15
3874 mov r14,rsi
3875 mov r15,rbp
3876 call __ecp_nistz256_sub_fromx
3877
3878 mov rax,QWORD[((0+0))+rsp]
3879 mov rbp,QWORD[((0+8))+rsp]
3880 mov rcx,QWORD[((0+16))+rsp]
3881 mov r10,QWORD[((0+24))+rsp]
3882 lea rdi,[rsp]
3883 call __ecp_nistz256_subx
3884
3885 mov rdx,QWORD[32+rsp]
3886 lea rbx,[32+rsp]
3887 mov r14,r12
3888 xor ecx,ecx
3889 mov QWORD[((0+0))+rsp],r12
3890 mov r10,r13
3891 mov QWORD[((0+8))+rsp],r13
3892 cmovz r11,r8
3893 mov QWORD[((0+16))+rsp],r8
3894 lea rsi,[((0-128))+rsp]
3895 cmovz r12,r9
3896 mov QWORD[((0+24))+rsp],r9
3897 mov r9,r14
3898 lea rdi,[rsp]
3899 call __ecp_nistz256_mul_montx
3900
3901 DB 102,72,15,126,203
3902 DB 102,72,15,126,207
3903 call __ecp_nistz256_sub_fromx
3904
3905 lea rsi,[((160+56))+rsp]
3906
3907 mov r15,QWORD[((-48))+rsi]
3908
3909 mov r14,QWORD[((-40))+rsi]
3910
3911 mov r13,QWORD[((-32))+rsi]
3912
3913 mov r12,QWORD[((-24))+rsi]
3914
3915 mov rbx,QWORD[((-16))+rsi]
3916
3917 mov rbp,QWORD[((-8))+rsi]
3918
3919 lea rsp,[rsi]
3920
3921 $L$point_doublex_epilogue:
3922 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
3923 mov rsi,QWORD[16+rsp]
3924 DB 0F3h,0C3h ;repret
3925
3926 $L$SEH_end_ecp_nistz256_point_doublex:
3927
3928 ALIGN 32
3929 ecp_nistz256_point_addx:
3930 mov QWORD[8+rsp],rdi ;WIN64 prologue
3931 mov QWORD[16+rsp],rsi
3932 mov rax,rsp
3933 $L$SEH_begin_ecp_nistz256_point_addx:
3934 mov rdi,rcx
3935 mov rsi,rdx
3936 mov rdx,r8
3937
3938
3939
3940 $L$point_addx:
3941 push rbp
3942
3943 push rbx
3944
3945 push r12
3946
3947 push r13
3948
3949 push r14
3950
3951 push r15
3952
3953 sub rsp,32*18+8
3954
3955 $L$point_addx_body:
3956
3957 movdqu xmm0,XMMWORD[rsi]
3958 movdqu xmm1,XMMWORD[16+rsi]
3959 movdqu xmm2,XMMWORD[32+rsi]
3960 movdqu xmm3,XMMWORD[48+rsi]
3961 movdqu xmm4,XMMWORD[64+rsi]
3962 movdqu xmm5,XMMWORD[80+rsi]
3963 mov rbx,rsi
3964 mov rsi,rdx
3965 movdqa XMMWORD[384+rsp],xmm0
3966 movdqa XMMWORD[(384+16)+rsp],xmm1
3967 movdqa XMMWORD[416+rsp],xmm2
3968 movdqa XMMWORD[(416+16)+rsp],xmm3
3969 movdqa XMMWORD[448+rsp],xmm4
3970 movdqa XMMWORD[(448+16)+rsp],xmm5
3971 por xmm5,xmm4
3972
3973 movdqu xmm0,XMMWORD[rsi]
3974 pshufd xmm3,xmm5,0xb1
3975 movdqu xmm1,XMMWORD[16+rsi]
3976 movdqu xmm2,XMMWORD[32+rsi]
3977 por xmm5,xmm3
3978 movdqu xmm3,XMMWORD[48+rsi]
3979 mov rdx,QWORD[((64+0))+rsi]
3980 mov r14,QWORD[((64+8))+rsi]
3981 mov r15,QWORD[((64+16))+rsi]
3982 mov r8,QWORD[((64+24))+rsi]
3983 movdqa XMMWORD[480+rsp],xmm0
3984 pshufd xmm4,xmm5,0x1e
3985 movdqa XMMWORD[(480+16)+rsp],xmm1
3986 movdqu xmm0,XMMWORD[64+rsi]
3987 movdqu xmm1,XMMWORD[80+rsi]
3988 movdqa XMMWORD[512+rsp],xmm2
3989 movdqa XMMWORD[(512+16)+rsp],xmm3
3990 por xmm5,xmm4
3991 pxor xmm4,xmm4
3992 por xmm1,xmm0
3993 DB 102,72,15,110,199
3994
3995 lea rsi,[((64-128))+rsi]
3996 mov QWORD[((544+0))+rsp],rdx
3997 mov QWORD[((544+8))+rsp],r14
3998 mov QWORD[((544+16))+rsp],r15
3999 mov QWORD[((544+24))+rsp],r8
4000 lea rdi,[96+rsp]
4001 call __ecp_nistz256_sqr_montx
4002
4003 pcmpeqd xmm5,xmm4
4004 pshufd xmm4,xmm1,0xb1
4005 por xmm4,xmm1
4006 pshufd xmm5,xmm5,0
4007 pshufd xmm3,xmm4,0x1e
4008 por xmm4,xmm3
4009 pxor xmm3,xmm3
4010 pcmpeqd xmm4,xmm3
4011 pshufd xmm4,xmm4,0
4012 mov rdx,QWORD[((64+0))+rbx]
4013 mov r14,QWORD[((64+8))+rbx]
4014 mov r15,QWORD[((64+16))+rbx]
4015 mov r8,QWORD[((64+24))+rbx]
4016 DB 102,72,15,110,203
4017
4018 lea rsi,[((64-128))+rbx]
4019 lea rdi,[32+rsp]
4020 call __ecp_nistz256_sqr_montx
4021
4022 mov rdx,QWORD[544+rsp]
4023 lea rbx,[544+rsp]
4024 mov r9,QWORD[((0+96))+rsp]
4025 mov r10,QWORD[((8+96))+rsp]
4026 lea rsi,[((-128+96))+rsp]
4027 mov r11,QWORD[((16+96))+rsp]
4028 mov r12,QWORD[((24+96))+rsp]
4029 lea rdi,[224+rsp]
4030 call __ecp_nistz256_mul_montx
4031
4032 mov rdx,QWORD[448+rsp]
4033 lea rbx,[448+rsp]
4034 mov r9,QWORD[((0+32))+rsp]
4035 mov r10,QWORD[((8+32))+rsp]
4036 lea rsi,[((-128+32))+rsp]
4037 mov r11,QWORD[((16+32))+rsp]
4038 mov r12,QWORD[((24+32))+rsp]
4039 lea rdi,[256+rsp]
4040 call __ecp_nistz256_mul_montx
4041
4042 mov rdx,QWORD[416+rsp]
4043 lea rbx,[416+rsp]
4044 mov r9,QWORD[((0+224))+rsp]
4045 mov r10,QWORD[((8+224))+rsp]
4046 lea rsi,[((-128+224))+rsp]
4047 mov r11,QWORD[((16+224))+rsp]
4048 mov r12,QWORD[((24+224))+rsp]
4049 lea rdi,[224+rsp]
4050 call __ecp_nistz256_mul_montx
4051
4052 mov rdx,QWORD[512+rsp]
4053 lea rbx,[512+rsp]
4054 mov r9,QWORD[((0+256))+rsp]
4055 mov r10,QWORD[((8+256))+rsp]
4056 lea rsi,[((-128+256))+rsp]
4057 mov r11,QWORD[((16+256))+rsp]
4058 mov r12,QWORD[((24+256))+rsp]
4059 lea rdi,[256+rsp]
4060 call __ecp_nistz256_mul_montx
4061
4062 lea rbx,[224+rsp]
4063 lea rdi,[64+rsp]
4064 call __ecp_nistz256_sub_fromx
4065
4066 or r12,r13
4067 movdqa xmm2,xmm4
4068 or r12,r8
4069 or r12,r9
4070 por xmm2,xmm5
4071 DB 102,73,15,110,220
4072
4073 mov rdx,QWORD[384+rsp]
4074 lea rbx,[384+rsp]
4075 mov r9,QWORD[((0+96))+rsp]
4076 mov r10,QWORD[((8+96))+rsp]
4077 lea rsi,[((-128+96))+rsp]
4078 mov r11,QWORD[((16+96))+rsp]
4079 mov r12,QWORD[((24+96))+rsp]
4080 lea rdi,[160+rsp]
4081 call __ecp_nistz256_mul_montx
4082
4083 mov rdx,QWORD[480+rsp]
4084 lea rbx,[480+rsp]
4085 mov r9,QWORD[((0+32))+rsp]
4086 mov r10,QWORD[((8+32))+rsp]
4087 lea rsi,[((-128+32))+rsp]
4088 mov r11,QWORD[((16+32))+rsp]
4089 mov r12,QWORD[((24+32))+rsp]
4090 lea rdi,[192+rsp]
4091 call __ecp_nistz256_mul_montx
4092
4093 lea rbx,[160+rsp]
4094 lea rdi,[rsp]
4095 call __ecp_nistz256_sub_fromx
4096
4097 or r12,r13
4098 or r12,r8
4099 or r12,r9
4100
4101 DB 102,73,15,126,208
4102 DB 102,73,15,126,217
4103 or r12,r8
4104 DB 0x3e
4105 jnz NEAR $L$add_proceedx
4106
4107
4108
4109 test r9,r9
4110 jz NEAR $L$add_doublex
4111
4112
4113
4114
4115
4116
4117 DB 102,72,15,126,199
4118 pxor xmm0,xmm0
4119 movdqu XMMWORD[rdi],xmm0
4120 movdqu XMMWORD[16+rdi],xmm0
4121 movdqu XMMWORD[32+rdi],xmm0
4122 movdqu XMMWORD[48+rdi],xmm0
4123 movdqu XMMWORD[64+rdi],xmm0
4124 movdqu XMMWORD[80+rdi],xmm0
4125 jmp NEAR $L$add_donex
4126
4127 ALIGN 32
4128 $L$add_doublex:
4129 DB 102,72,15,126,206
4130 DB 102,72,15,126,199
4131 add rsp,416
4132
4133 jmp NEAR $L$point_double_shortcutx
4134
4135
4136 ALIGN 32
4137 $L$add_proceedx:
4138 mov rdx,QWORD[((0+64))+rsp]
4139 mov r14,QWORD[((8+64))+rsp]
4140 lea rsi,[((-128+64))+rsp]
4141 mov r15,QWORD[((16+64))+rsp]
4142 mov r8,QWORD[((24+64))+rsp]
4143 lea rdi,[96+rsp]
4144 call __ecp_nistz256_sqr_montx
4145
4146 mov rdx,QWORD[448+rsp]
4147 lea rbx,[448+rsp]
4148 mov r9,QWORD[((0+0))+rsp]
4149 mov r10,QWORD[((8+0))+rsp]
4150 lea rsi,[((-128+0))+rsp]
4151 mov r11,QWORD[((16+0))+rsp]
4152 mov r12,QWORD[((24+0))+rsp]
4153 lea rdi,[352+rsp]
4154 call __ecp_nistz256_mul_montx
4155
4156 mov rdx,QWORD[((0+0))+rsp]
4157 mov r14,QWORD[((8+0))+rsp]
4158 lea rsi,[((-128+0))+rsp]
4159 mov r15,QWORD[((16+0))+rsp]
4160 mov r8,QWORD[((24+0))+rsp]
4161 lea rdi,[32+rsp]
4162 call __ecp_nistz256_sqr_montx
4163
4164 mov rdx,QWORD[544+rsp]
4165 lea rbx,[544+rsp]
4166 mov r9,QWORD[((0+352))+rsp]
4167 mov r10,QWORD[((8+352))+rsp]
4168 lea rsi,[((-128+352))+rsp]
4169 mov r11,QWORD[((16+352))+rsp]
4170 mov r12,QWORD[((24+352))+rsp]
4171 lea rdi,[352+rsp]
4172 call __ecp_nistz256_mul_montx
4173
4174 mov rdx,QWORD[rsp]
4175 lea rbx,[rsp]
4176 mov r9,QWORD[((0+32))+rsp]
4177 mov r10,QWORD[((8+32))+rsp]
4178 lea rsi,[((-128+32))+rsp]
4179 mov r11,QWORD[((16+32))+rsp]
4180 mov r12,QWORD[((24+32))+rsp]
4181 lea rdi,[128+rsp]
4182 call __ecp_nistz256_mul_montx
4183
4184 mov rdx,QWORD[160+rsp]
4185 lea rbx,[160+rsp]
4186 mov r9,QWORD[((0+32))+rsp]
4187 mov r10,QWORD[((8+32))+rsp]
4188 lea rsi,[((-128+32))+rsp]
4189 mov r11,QWORD[((16+32))+rsp]
4190 mov r12,QWORD[((24+32))+rsp]
4191 lea rdi,[192+rsp]
4192 call __ecp_nistz256_mul_montx
4193
4194
4195
4196
4197 xor r11,r11
4198 add r12,r12
4199 lea rsi,[96+rsp]
4200 adc r13,r13
4201 mov rax,r12
4202 adc r8,r8
4203 adc r9,r9
4204 mov rbp,r13
4205 adc r11,0
4206
4207 sub r12,-1
4208 mov rcx,r8
4209 sbb r13,r14
4210 sbb r8,0
4211 mov r10,r9
4212 sbb r9,r15
4213 sbb r11,0
4214
4215 cmovc r12,rax
4216 mov rax,QWORD[rsi]
4217 cmovc r13,rbp
4218 mov rbp,QWORD[8+rsi]
4219 cmovc r8,rcx
4220 mov rcx,QWORD[16+rsi]
4221 cmovc r9,r10
4222 mov r10,QWORD[24+rsi]
4223
4224 call __ecp_nistz256_subx
4225
4226 lea rbx,[128+rsp]
4227 lea rdi,[288+rsp]
4228 call __ecp_nistz256_sub_fromx
4229
4230 mov rax,QWORD[((192+0))+rsp]
4231 mov rbp,QWORD[((192+8))+rsp]
4232 mov rcx,QWORD[((192+16))+rsp]
4233 mov r10,QWORD[((192+24))+rsp]
4234 lea rdi,[320+rsp]
4235
4236 call __ecp_nistz256_subx
4237
4238 mov QWORD[rdi],r12
4239 mov QWORD[8+rdi],r13
4240 mov QWORD[16+rdi],r8
4241 mov QWORD[24+rdi],r9
4242 mov rdx,QWORD[128+rsp]
4243 lea rbx,[128+rsp]
4244 mov r9,QWORD[((0+224))+rsp]
4245 mov r10,QWORD[((8+224))+rsp]
4246 lea rsi,[((-128+224))+rsp]
4247 mov r11,QWORD[((16+224))+rsp]
4248 mov r12,QWORD[((24+224))+rsp]
4249 lea rdi,[256+rsp]
4250 call __ecp_nistz256_mul_montx
4251
4252 mov rdx,QWORD[320+rsp]
4253 lea rbx,[320+rsp]
4254 mov r9,QWORD[((0+64))+rsp]
4255 mov r10,QWORD[((8+64))+rsp]
4256 lea rsi,[((-128+64))+rsp]
4257 mov r11,QWORD[((16+64))+rsp]
4258 mov r12,QWORD[((24+64))+rsp]
4259 lea rdi,[320+rsp]
4260 call __ecp_nistz256_mul_montx
4261
4262 lea rbx,[256+rsp]
4263 lea rdi,[320+rsp]
4264 call __ecp_nistz256_sub_fromx
4265
4266 DB 102,72,15,126,199
4267
4268 movdqa xmm0,xmm5
4269 movdqa xmm1,xmm5
4270 pandn xmm0,XMMWORD[352+rsp]
4271 movdqa xmm2,xmm5
4272 pandn xmm1,XMMWORD[((352+16))+rsp]
4273 movdqa xmm3,xmm5
4274 pand xmm2,XMMWORD[544+rsp]
4275 pand xmm3,XMMWORD[((544+16))+rsp]
4276 por xmm2,xmm0
4277 por xmm3,xmm1
4278
4279 movdqa xmm0,xmm4
4280 movdqa xmm1,xmm4
4281 pandn xmm0,xmm2
4282 movdqa xmm2,xmm4
4283 pandn xmm1,xmm3
4284 movdqa xmm3,xmm4
4285 pand xmm2,XMMWORD[448+rsp]
4286 pand xmm3,XMMWORD[((448+16))+rsp]
4287 por xmm2,xmm0
4288 por xmm3,xmm1
4289 movdqu XMMWORD[64+rdi],xmm2
4290 movdqu XMMWORD[80+rdi],xmm3
4291
4292 movdqa xmm0,xmm5
4293 movdqa xmm1,xmm5
4294 pandn xmm0,XMMWORD[288+rsp]
4295 movdqa xmm2,xmm5
4296 pandn xmm1,XMMWORD[((288+16))+rsp]
4297 movdqa xmm3,xmm5
4298 pand xmm2,XMMWORD[480+rsp]
4299 pand xmm3,XMMWORD[((480+16))+rsp]
4300 por xmm2,xmm0
4301 por xmm3,xmm1
4302
4303 movdqa xmm0,xmm4
4304 movdqa xmm1,xmm4
4305 pandn xmm0,xmm2
4306 movdqa xmm2,xmm4
4307 pandn xmm1,xmm3
4308 movdqa xmm3,xmm4
4309 pand xmm2,XMMWORD[384+rsp]
4310 pand xmm3,XMMWORD[((384+16))+rsp]
4311 por xmm2,xmm0
4312 por xmm3,xmm1
4313 movdqu XMMWORD[rdi],xmm2
4314 movdqu XMMWORD[16+rdi],xmm3
4315
4316 movdqa xmm0,xmm5
4317 movdqa xmm1,xmm5
4318 pandn xmm0,XMMWORD[320+rsp]
4319 movdqa xmm2,xmm5
4320 pandn xmm1,XMMWORD[((320+16))+rsp]
4321 movdqa xmm3,xmm5
4322 pand xmm2,XMMWORD[512+rsp]
4323 pand xmm3,XMMWORD[((512+16))+rsp]
4324 por xmm2,xmm0
4325 por xmm3,xmm1
4326
4327 movdqa xmm0,xmm4
4328 movdqa xmm1,xmm4
4329 pandn xmm0,xmm2
4330 movdqa xmm2,xmm4
4331 pandn xmm1,xmm3
4332 movdqa xmm3,xmm4
4333 pand xmm2,XMMWORD[416+rsp]
4334 pand xmm3,XMMWORD[((416+16))+rsp]
4335 por xmm2,xmm0
4336 por xmm3,xmm1
4337 movdqu XMMWORD[32+rdi],xmm2
4338 movdqu XMMWORD[48+rdi],xmm3
4339
4340 $L$add_donex:
4341 lea rsi,[((576+56))+rsp]
4342
4343 mov r15,QWORD[((-48))+rsi]
4344
4345 mov r14,QWORD[((-40))+rsi]
4346
4347 mov r13,QWORD[((-32))+rsi]
4348
4349 mov r12,QWORD[((-24))+rsi]
4350
4351 mov rbx,QWORD[((-16))+rsi]
4352
4353 mov rbp,QWORD[((-8))+rsi]
4354
4355 lea rsp,[rsi]
4356
4357 $L$point_addx_epilogue:
4358 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
4359 mov rsi,QWORD[16+rsp]
4360 DB 0F3h,0C3h ;repret
4361
4362 $L$SEH_end_ecp_nistz256_point_addx:
4363
4364 ALIGN 32
4365 ecp_nistz256_point_add_affinex:
4366 mov QWORD[8+rsp],rdi ;WIN64 prologue
4367 mov QWORD[16+rsp],rsi
4368 mov rax,rsp
4369 $L$SEH_begin_ecp_nistz256_point_add_affinex:
4370 mov rdi,rcx
4371 mov rsi,rdx
4372 mov rdx,r8
4373
4374
4375
4376 $L$point_add_affinex:
4377 push rbp
4378
4379 push rbx
4380
4381 push r12
4382
4383 push r13
4384
4385 push r14
4386
4387 push r15
4388
4389 sub rsp,32*15+8
4390
4391 $L$add_affinex_body:
4392
4393 movdqu xmm0,XMMWORD[rsi]
4394 mov rbx,rdx
4395 movdqu xmm1,XMMWORD[16+rsi]
4396 movdqu xmm2,XMMWORD[32+rsi]
4397 movdqu xmm3,XMMWORD[48+rsi]
4398 movdqu xmm4,XMMWORD[64+rsi]
4399 movdqu xmm5,XMMWORD[80+rsi]
4400 mov rdx,QWORD[((64+0))+rsi]
4401 mov r14,QWORD[((64+8))+rsi]
4402 mov r15,QWORD[((64+16))+rsi]
4403 mov r8,QWORD[((64+24))+rsi]
4404 movdqa XMMWORD[320+rsp],xmm0
4405 movdqa XMMWORD[(320+16)+rsp],xmm1
4406 movdqa XMMWORD[352+rsp],xmm2
4407 movdqa XMMWORD[(352+16)+rsp],xmm3
4408 movdqa XMMWORD[384+rsp],xmm4
4409 movdqa XMMWORD[(384+16)+rsp],xmm5
4410 por xmm5,xmm4
4411
4412 movdqu xmm0,XMMWORD[rbx]
4413 pshufd xmm3,xmm5,0xb1
4414 movdqu xmm1,XMMWORD[16+rbx]
4415 movdqu xmm2,XMMWORD[32+rbx]
4416 por xmm5,xmm3
4417 movdqu xmm3,XMMWORD[48+rbx]
4418 movdqa XMMWORD[416+rsp],xmm0
4419 pshufd xmm4,xmm5,0x1e
4420 movdqa XMMWORD[(416+16)+rsp],xmm1
4421 por xmm1,xmm0
4422 DB 102,72,15,110,199
4423 movdqa XMMWORD[448+rsp],xmm2
4424 movdqa XMMWORD[(448+16)+rsp],xmm3
4425 por xmm3,xmm2
4426 por xmm5,xmm4
4427 pxor xmm4,xmm4
4428 por xmm3,xmm1
4429
4430 lea rsi,[((64-128))+rsi]
4431 lea rdi,[32+rsp]
4432 call __ecp_nistz256_sqr_montx
4433
4434 pcmpeqd xmm5,xmm4
4435 pshufd xmm4,xmm3,0xb1
4436 mov rdx,QWORD[rbx]
4437
4438 mov r9,r12
4439 por xmm4,xmm3
4440 pshufd xmm5,xmm5,0
4441 pshufd xmm3,xmm4,0x1e
4442 mov r10,r13
4443 por xmm4,xmm3
4444 pxor xmm3,xmm3
4445 mov r11,r14
4446 pcmpeqd xmm4,xmm3
4447 pshufd xmm4,xmm4,0
4448
4449 lea rsi,[((32-128))+rsp]
4450 mov r12,r15
4451 lea rdi,[rsp]
4452 call __ecp_nistz256_mul_montx
4453
4454 lea rbx,[320+rsp]
4455 lea rdi,[64+rsp]
4456 call __ecp_nistz256_sub_fromx
4457
4458 mov rdx,QWORD[384+rsp]
4459 lea rbx,[384+rsp]
4460 mov r9,QWORD[((0+32))+rsp]
4461 mov r10,QWORD[((8+32))+rsp]
4462 lea rsi,[((-128+32))+rsp]
4463 mov r11,QWORD[((16+32))+rsp]
4464 mov r12,QWORD[((24+32))+rsp]
4465 lea rdi,[32+rsp]
4466 call __ecp_nistz256_mul_montx
4467
4468 mov rdx,QWORD[384+rsp]
4469 lea rbx,[384+rsp]
4470 mov r9,QWORD[((0+64))+rsp]
4471 mov r10,QWORD[((8+64))+rsp]
4472 lea rsi,[((-128+64))+rsp]
4473 mov r11,QWORD[((16+64))+rsp]
4474 mov r12,QWORD[((24+64))+rsp]
4475 lea rdi,[288+rsp]
4476 call __ecp_nistz256_mul_montx
4477
4478 mov rdx,QWORD[448+rsp]
4479 lea rbx,[448+rsp]
4480 mov r9,QWORD[((0+32))+rsp]
4481 mov r10,QWORD[((8+32))+rsp]
4482 lea rsi,[((-128+32))+rsp]
4483 mov r11,QWORD[((16+32))+rsp]
4484 mov r12,QWORD[((24+32))+rsp]
4485 lea rdi,[32+rsp]
4486 call __ecp_nistz256_mul_montx
4487
4488 lea rbx,[352+rsp]
4489 lea rdi,[96+rsp]
4490 call __ecp_nistz256_sub_fromx
4491
4492 mov rdx,QWORD[((0+64))+rsp]
4493 mov r14,QWORD[((8+64))+rsp]
4494 lea rsi,[((-128+64))+rsp]
4495 mov r15,QWORD[((16+64))+rsp]
4496 mov r8,QWORD[((24+64))+rsp]
4497 lea rdi,[128+rsp]
4498 call __ecp_nistz256_sqr_montx
4499
4500 mov rdx,QWORD[((0+96))+rsp]
4501 mov r14,QWORD[((8+96))+rsp]
4502 lea rsi,[((-128+96))+rsp]
4503 mov r15,QWORD[((16+96))+rsp]
4504 mov r8,QWORD[((24+96))+rsp]
4505 lea rdi,[192+rsp]
4506 call __ecp_nistz256_sqr_montx
4507
4508 mov rdx,QWORD[128+rsp]
4509 lea rbx,[128+rsp]
4510 mov r9,QWORD[((0+64))+rsp]
4511 mov r10,QWORD[((8+64))+rsp]
4512 lea rsi,[((-128+64))+rsp]
4513 mov r11,QWORD[((16+64))+rsp]
4514 mov r12,QWORD[((24+64))+rsp]
4515 lea rdi,[160+rsp]
4516 call __ecp_nistz256_mul_montx
4517
4518 mov rdx,QWORD[320+rsp]
4519 lea rbx,[320+rsp]
4520 mov r9,QWORD[((0+128))+rsp]
4521 mov r10,QWORD[((8+128))+rsp]
4522 lea rsi,[((-128+128))+rsp]
4523 mov r11,QWORD[((16+128))+rsp]
4524 mov r12,QWORD[((24+128))+rsp]
4525 lea rdi,[rsp]
4526 call __ecp_nistz256_mul_montx
4527
4528
4529
4530
4531 xor r11,r11
4532 add r12,r12
4533 lea rsi,[192+rsp]
4534 adc r13,r13
4535 mov rax,r12
4536 adc r8,r8
4537 adc r9,r9
4538 mov rbp,r13
4539 adc r11,0
4540
4541 sub r12,-1
4542 mov rcx,r8
4543 sbb r13,r14
4544 sbb r8,0
4545 mov r10,r9
4546 sbb r9,r15
4547 sbb r11,0
4548
4549 cmovc r12,rax
4550 mov rax,QWORD[rsi]
4551 cmovc r13,rbp
4552 mov rbp,QWORD[8+rsi]
4553 cmovc r8,rcx
4554 mov rcx,QWORD[16+rsi]
4555 cmovc r9,r10
4556 mov r10,QWORD[24+rsi]
4557
4558 call __ecp_nistz256_subx
4559
4560 lea rbx,[160+rsp]
4561 lea rdi,[224+rsp]
4562 call __ecp_nistz256_sub_fromx
4563
4564 mov rax,QWORD[((0+0))+rsp]
4565 mov rbp,QWORD[((0+8))+rsp]
4566 mov rcx,QWORD[((0+16))+rsp]
4567 mov r10,QWORD[((0+24))+rsp]
4568 lea rdi,[64+rsp]
4569
4570 call __ecp_nistz256_subx
4571
4572 mov QWORD[rdi],r12
4573 mov QWORD[8+rdi],r13
4574 mov QWORD[16+rdi],r8
4575 mov QWORD[24+rdi],r9
4576 mov rdx,QWORD[352+rsp]
4577 lea rbx,[352+rsp]
4578 mov r9,QWORD[((0+160))+rsp]
4579 mov r10,QWORD[((8+160))+rsp]
4580 lea rsi,[((-128+160))+rsp]
4581 mov r11,QWORD[((16+160))+rsp]
4582 mov r12,QWORD[((24+160))+rsp]
4583 lea rdi,[32+rsp]
4584 call __ecp_nistz256_mul_montx
4585
4586 mov rdx,QWORD[96+rsp]
4587 lea rbx,[96+rsp]
4588 mov r9,QWORD[((0+64))+rsp]
4589 mov r10,QWORD[((8+64))+rsp]
4590 lea rsi,[((-128+64))+rsp]
4591 mov r11,QWORD[((16+64))+rsp]
4592 mov r12,QWORD[((24+64))+rsp]
4593 lea rdi,[64+rsp]
4594 call __ecp_nistz256_mul_montx
4595
4596 lea rbx,[32+rsp]
4597 lea rdi,[256+rsp]
4598 call __ecp_nistz256_sub_fromx
4599
4600 DB 102,72,15,126,199
4601
4602 movdqa xmm0,xmm5
4603 movdqa xmm1,xmm5
4604 pandn xmm0,XMMWORD[288+rsp]
4605 movdqa xmm2,xmm5
4606 pandn xmm1,XMMWORD[((288+16))+rsp]
4607 movdqa xmm3,xmm5
4608 pand xmm2,XMMWORD[$L$ONE_mont]
4609 pand xmm3,XMMWORD[(($L$ONE_mont+16))]
4610 por xmm2,xmm0
4611 por xmm3,xmm1
4612
4613 movdqa xmm0,xmm4
4614 movdqa xmm1,xmm4
4615 pandn xmm0,xmm2
4616 movdqa xmm2,xmm4
4617 pandn xmm1,xmm3
4618 movdqa xmm3,xmm4
4619 pand xmm2,XMMWORD[384+rsp]
4620 pand xmm3,XMMWORD[((384+16))+rsp]
4621 por xmm2,xmm0
4622 por xmm3,xmm1
4623 movdqu XMMWORD[64+rdi],xmm2
4624 movdqu XMMWORD[80+rdi],xmm3
4625
4626 movdqa xmm0,xmm5
4627 movdqa xmm1,xmm5
4628 pandn xmm0,XMMWORD[224+rsp]
4629 movdqa xmm2,xmm5
4630 pandn xmm1,XMMWORD[((224+16))+rsp]
4631 movdqa xmm3,xmm5
4632 pand xmm2,XMMWORD[416+rsp]
4633 pand xmm3,XMMWORD[((416+16))+rsp]
4634 por xmm2,xmm0
4635 por xmm3,xmm1
4636
4637 movdqa xmm0,xmm4
4638 movdqa xmm1,xmm4
4639 pandn xmm0,xmm2
4640 movdqa xmm2,xmm4
4641 pandn xmm1,xmm3
4642 movdqa xmm3,xmm4
4643 pand xmm2,XMMWORD[320+rsp]
4644 pand xmm3,XMMWORD[((320+16))+rsp]
4645 por xmm2,xmm0
4646 por xmm3,xmm1
4647 movdqu XMMWORD[rdi],xmm2
4648 movdqu XMMWORD[16+rdi],xmm3
4649
4650 movdqa xmm0,xmm5
4651 movdqa xmm1,xmm5
4652 pandn xmm0,XMMWORD[256+rsp]
4653 movdqa xmm2,xmm5
4654 pandn xmm1,XMMWORD[((256+16))+rsp]
4655 movdqa xmm3,xmm5
4656 pand xmm2,XMMWORD[448+rsp]
4657 pand xmm3,XMMWORD[((448+16))+rsp]
4658 por xmm2,xmm0
4659 por xmm3,xmm1
4660
4661 movdqa xmm0,xmm4
4662 movdqa xmm1,xmm4
4663 pandn xmm0,xmm2
4664 movdqa xmm2,xmm4
4665 pandn xmm1,xmm3
4666 movdqa xmm3,xmm4
4667 pand xmm2,XMMWORD[352+rsp]
4668 pand xmm3,XMMWORD[((352+16))+rsp]
4669 por xmm2,xmm0
4670 por xmm3,xmm1
4671 movdqu XMMWORD[32+rdi],xmm2
4672 movdqu XMMWORD[48+rdi],xmm3
4673
4674 lea rsi,[((480+56))+rsp]
4675
4676 mov r15,QWORD[((-48))+rsi]
4677
4678 mov r14,QWORD[((-40))+rsi]
4679
4680 mov r13,QWORD[((-32))+rsi]
4681
4682 mov r12,QWORD[((-24))+rsi]
4683
4684 mov rbx,QWORD[((-16))+rsi]
4685
4686 mov rbp,QWORD[((-8))+rsi]
4687
4688 lea rsp,[rsi]
4689
4690 $L$add_affinex_epilogue:
4691 mov rdi,QWORD[8+rsp] ;WIN64 epilogue
4692 mov rsi,QWORD[16+rsp]
4693 DB 0F3h,0C3h ;repret
4694
4695 $L$SEH_end_ecp_nistz256_point_add_affinex:
4696 EXTERN __imp_RtlVirtualUnwind
4697
4698
4699 ALIGN 16
4700 short_handler:
4701 push rsi
4702 push rdi
4703 push rbx
4704 push rbp
4705 push r12
4706 push r13
4707 push r14
4708 push r15
4709 pushfq
4710 sub rsp,64
4711
4712 mov rax,QWORD[120+r8]
4713 mov rbx,QWORD[248+r8]
4714
4715 mov rsi,QWORD[8+r9]
4716 mov r11,QWORD[56+r9]
4717
4718 mov r10d,DWORD[r11]
4719 lea r10,[r10*1+rsi]
4720 cmp rbx,r10
4721 jb NEAR $L$common_seh_tail
4722
4723 mov rax,QWORD[152+r8]
4724
4725 mov r10d,DWORD[4+r11]
4726 lea r10,[r10*1+rsi]
4727 cmp rbx,r10
4728 jae NEAR $L$common_seh_tail
4729
4730 lea rax,[16+rax]
4731
4732 mov r12,QWORD[((-8))+rax]
4733 mov r13,QWORD[((-16))+rax]
4734 mov QWORD[216+r8],r12
4735 mov QWORD[224+r8],r13
4736
4737 jmp NEAR $L$common_seh_tail
4738
4739
4740
4741 ALIGN 16
4742 full_handler:
4743 push rsi
4744 push rdi
4745 push rbx
4746 push rbp
4747 push r12
4748 push r13
4749 push r14
4750 push r15
4751 pushfq
4752 sub rsp,64
4753
4754 mov rax,QWORD[120+r8]
4755 mov rbx,QWORD[248+r8]
4756
4757 mov rsi,QWORD[8+r9]
4758 mov r11,QWORD[56+r9]
4759
4760 mov r10d,DWORD[r11]
4761 lea r10,[r10*1+rsi]
4762 cmp rbx,r10
4763 jb NEAR $L$common_seh_tail
4764
4765 mov rax,QWORD[152+r8]
4766
4767 mov r10d,DWORD[4+r11]
4768 lea r10,[r10*1+rsi]
4769 cmp rbx,r10
4770 jae NEAR $L$common_seh_tail
4771
4772 mov r10d,DWORD[8+r11]
4773 lea rax,[r10*1+rax]
4774
4775 mov rbp,QWORD[((-8))+rax]
4776 mov rbx,QWORD[((-16))+rax]
4777 mov r12,QWORD[((-24))+rax]
4778 mov r13,QWORD[((-32))+rax]
4779 mov r14,QWORD[((-40))+rax]
4780 mov r15,QWORD[((-48))+rax]
4781 mov QWORD[144+r8],rbx
4782 mov QWORD[160+r8],rbp
4783 mov QWORD[216+r8],r12
4784 mov QWORD[224+r8],r13
4785 mov QWORD[232+r8],r14
4786 mov QWORD[240+r8],r15
4787
4788 $L$common_seh_tail:
4789 mov rdi,QWORD[8+rax]
4790 mov rsi,QWORD[16+rax]
4791 mov QWORD[152+r8],rax
4792 mov QWORD[168+r8],rsi
4793 mov QWORD[176+r8],rdi
4794
4795 mov rdi,QWORD[40+r9]
4796 mov rsi,r8
4797 mov ecx,154
4798 DD 0xa548f3fc
4799
4800 mov rsi,r9
4801 xor rcx,rcx
4802 mov rdx,QWORD[8+rsi]
4803 mov r8,QWORD[rsi]
4804 mov r9,QWORD[16+rsi]
4805 mov r10,QWORD[40+rsi]
4806 lea r11,[56+rsi]
4807 lea r12,[24+rsi]
4808 mov QWORD[32+rsp],r10
4809 mov QWORD[40+rsp],r11
4810 mov QWORD[48+rsp],r12
4811 mov QWORD[56+rsp],rcx
4812 call QWORD[__imp_RtlVirtualUnwind]
4813
4814 mov eax,1
4815 add rsp,64
4816 popfq
4817 pop r15
4818 pop r14
4819 pop r13
4820 pop r12
4821 pop rbp
4822 pop rbx
4823 pop rdi
4824 pop rsi
4825 DB 0F3h,0C3h ;repret
4826
4827
4828 section .pdata rdata align=4
4829 ALIGN 4
4830 DD $L$SEH_begin_ecp_nistz256_neg wrt ..imagebase
4831 DD $L$SEH_end_ecp_nistz256_neg wrt ..imagebase
4832 DD $L$SEH_info_ecp_nistz256_neg wrt ..imagebase
4833
4834 DD $L$SEH_begin_ecp_nistz256_ord_mul_mont wrt ..imagebase
4835 DD $L$SEH_end_ecp_nistz256_ord_mul_mont wrt ..imagebase
4836 DD $L$SEH_info_ecp_nistz256_ord_mul_mont wrt ..imagebase
4837
4838 DD $L$SEH_begin_ecp_nistz256_ord_sqr_mont wrt ..imagebase
4839 DD $L$SEH_end_ecp_nistz256_ord_sqr_mont wrt ..imagebase
4840 DD $L$SEH_info_ecp_nistz256_ord_sqr_mont wrt ..imagebase
4841 DD $L$SEH_begin_ecp_nistz256_ord_mul_montx wrt ..imagebase
4842 DD $L$SEH_end_ecp_nistz256_ord_mul_montx wrt ..imagebase
4843 DD $L$SEH_info_ecp_nistz256_ord_mul_montx wrt ..imagebase
4844
4845 DD $L$SEH_begin_ecp_nistz256_ord_sqr_montx wrt ..imagebase
4846 DD $L$SEH_end_ecp_nistz256_ord_sqr_montx wrt ..imagebase
4847 DD $L$SEH_info_ecp_nistz256_ord_sqr_montx wrt ..imagebase
4848 DD $L$SEH_begin_ecp_nistz256_mul_mont wrt ..imagebase
4849 DD $L$SEH_end_ecp_nistz256_mul_mont wrt ..imagebase
4850 DD $L$SEH_info_ecp_nistz256_mul_mont wrt ..imagebase
4851
4852 DD $L$SEH_begin_ecp_nistz256_sqr_mont wrt ..imagebase
4853 DD $L$SEH_end_ecp_nistz256_sqr_mont wrt ..imagebase
4854 DD $L$SEH_info_ecp_nistz256_sqr_mont wrt ..imagebase
4855
4856 DD $L$SEH_begin_ecp_nistz256_select_w5 wrt ..imagebase
4857 DD $L$SEH_end_ecp_nistz256_select_w5 wrt ..imagebase
4858 DD $L$SEH_info_ecp_nistz256_select_wX wrt ..imagebase
4859
4860 DD $L$SEH_begin_ecp_nistz256_select_w7 wrt ..imagebase
4861 DD $L$SEH_end_ecp_nistz256_select_w7 wrt ..imagebase
4862 DD $L$SEH_info_ecp_nistz256_select_wX wrt ..imagebase
4863 DD $L$SEH_begin_ecp_nistz256_avx2_select_w5 wrt ..imagebase
4864 DD $L$SEH_end_ecp_nistz256_avx2_select_w5 wrt ..imagebase
4865 DD $L$SEH_info_ecp_nistz256_avx2_select_wX wrt ..imagebase
4866
4867 DD $L$SEH_begin_ecp_nistz256_avx2_select_w7 wrt ..imagebase
4868 DD $L$SEH_end_ecp_nistz256_avx2_select_w7 wrt ..imagebase
4869 DD $L$SEH_info_ecp_nistz256_avx2_select_wX wrt ..imagebase
4870 DD $L$SEH_begin_ecp_nistz256_point_double wrt ..imagebase
4871 DD $L$SEH_end_ecp_nistz256_point_double wrt ..imagebase
4872 DD $L$SEH_info_ecp_nistz256_point_double wrt ..imagebase
4873
4874 DD $L$SEH_begin_ecp_nistz256_point_add wrt ..imagebase
4875 DD $L$SEH_end_ecp_nistz256_point_add wrt ..imagebase
4876 DD $L$SEH_info_ecp_nistz256_point_add wrt ..imagebase
4877
4878 DD $L$SEH_begin_ecp_nistz256_point_add_affine wrt ..imagebase
4879 DD $L$SEH_end_ecp_nistz256_point_add_affine wrt ..imagebase
4880 DD $L$SEH_info_ecp_nistz256_point_add_affine wrt ..imagebase
4881 DD $L$SEH_begin_ecp_nistz256_point_doublex wrt ..imagebase
4882 DD $L$SEH_end_ecp_nistz256_point_doublex wrt ..imagebase
4883 DD $L$SEH_info_ecp_nistz256_point_doublex wrt ..imagebase
4884
4885 DD $L$SEH_begin_ecp_nistz256_point_addx wrt ..imagebase
4886 DD $L$SEH_end_ecp_nistz256_point_addx wrt ..imagebase
4887 DD $L$SEH_info_ecp_nistz256_point_addx wrt ..imagebase
4888
4889 DD $L$SEH_begin_ecp_nistz256_point_add_affinex wrt ..imagebase
4890 DD $L$SEH_end_ecp_nistz256_point_add_affinex wrt ..imagebase
4891 DD $L$SEH_info_ecp_nistz256_point_add_affinex wrt ..imagebase
4892
4893 section .xdata rdata align=8
4894 ALIGN 8
4895 $L$SEH_info_ecp_nistz256_neg:
4896 DB 9,0,0,0
4897 DD short_handler wrt ..imagebase
4898 DD $L$neg_body wrt ..imagebase,$L$neg_epilogue wrt ..imagebase
4899 $L$SEH_info_ecp_nistz256_ord_mul_mont:
4900 DB 9,0,0,0
4901 DD full_handler wrt ..imagebase
4902 DD $L$ord_mul_body wrt ..imagebase,$L$ord_mul_epilogue wrt ..imagebase
4903 DD 48,0
4904 $L$SEH_info_ecp_nistz256_ord_sqr_mont:
4905 DB 9,0,0,0
4906 DD full_handler wrt ..imagebase
4907 DD $L$ord_sqr_body wrt ..imagebase,$L$ord_sqr_epilogue wrt ..imagebase
4908 DD 48,0
4909 $L$SEH_info_ecp_nistz256_ord_mul_montx:
4910 DB 9,0,0,0
4911 DD full_handler wrt ..imagebase
4912 DD $L$ord_mulx_body wrt ..imagebase,$L$ord_mulx_epilogue wrt ..imagebase
4913 DD 48,0
4914 $L$SEH_info_ecp_nistz256_ord_sqr_montx:
4915 DB 9,0,0,0
4916 DD full_handler wrt ..imagebase
4917 DD $L$ord_sqrx_body wrt ..imagebase,$L$ord_sqrx_epilogue wrt ..imagebase
4918 DD 48,0
4919 $L$SEH_info_ecp_nistz256_mul_mont:
4920 DB 9,0,0,0
4921 DD full_handler wrt ..imagebase
4922 DD $L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase
4923 DD 48,0
4924 $L$SEH_info_ecp_nistz256_sqr_mont:
4925 DB 9,0,0,0
4926 DD full_handler wrt ..imagebase
4927 DD $L$sqr_body wrt ..imagebase,$L$sqr_epilogue wrt ..imagebase
4928 DD 48,0
4929 $L$SEH_info_ecp_nistz256_select_wX:
4930 DB 0x01,0x33,0x16,0x00
4931 DB 0x33,0xf8,0x09,0x00
4932 DB 0x2e,0xe8,0x08,0x00
4933 DB 0x29,0xd8,0x07,0x00
4934 DB 0x24,0xc8,0x06,0x00
4935 DB 0x1f,0xb8,0x05,0x00
4936 DB 0x1a,0xa8,0x04,0x00
4937 DB 0x15,0x98,0x03,0x00
4938 DB 0x10,0x88,0x02,0x00
4939 DB 0x0c,0x78,0x01,0x00
4940 DB 0x08,0x68,0x00,0x00
4941 DB 0x04,0x01,0x15,0x00
4942 ALIGN 8
4943 $L$SEH_info_ecp_nistz256_avx2_select_wX:
4944 DB 0x01,0x36,0x17,0x0b
4945 DB 0x36,0xf8,0x09,0x00
4946 DB 0x31,0xe8,0x08,0x00
4947 DB 0x2c,0xd8,0x07,0x00
4948 DB 0x27,0xc8,0x06,0x00
4949 DB 0x22,0xb8,0x05,0x00
4950 DB 0x1d,0xa8,0x04,0x00
4951 DB 0x18,0x98,0x03,0x00
4952 DB 0x13,0x88,0x02,0x00
4953 DB 0x0e,0x78,0x01,0x00
4954 DB 0x09,0x68,0x00,0x00
4955 DB 0x04,0x01,0x15,0x00
4956 DB 0x00,0xb3,0x00,0x00
4957 ALIGN 8
4958 $L$SEH_info_ecp_nistz256_point_double:
4959 DB 9,0,0,0
4960 DD full_handler wrt ..imagebase
4961 DD $L$point_doubleq_body wrt ..imagebase,$L$point_doubleq_epilogue wrt ..imagebase
4962 DD 32*5+56,0
4963 $L$SEH_info_ecp_nistz256_point_add:
4964 DB 9,0,0,0
4965 DD full_handler wrt ..imagebase
4966 DD $L$point_addq_body wrt ..imagebase,$L$point_addq_epilogue wrt ..imagebase
4967 DD 32*18+56,0
4968 $L$SEH_info_ecp_nistz256_point_add_affine:
4969 DB 9,0,0,0
4970 DD full_handler wrt ..imagebase
4971 DD $L$add_affineq_body wrt ..imagebase,$L$add_affineq_epilogue wrt ..imagebase
4972 DD 32*15+56,0
4973 ALIGN 8
4974 $L$SEH_info_ecp_nistz256_point_doublex:
4975 DB 9,0,0,0
4976 DD full_handler wrt ..imagebase
4977 DD $L$point_doublex_body wrt ..imagebase,$L$point_doublex_epilogue wrt ..imagebase
4978 DD 32*5+56,0
4979 $L$SEH_info_ecp_nistz256_point_addx:
4980 DB 9,0,0,0
4981 DD full_handler wrt ..imagebase
4982 DD $L$point_addx_body wrt ..imagebase,$L$point_addx_epilogue wrt ..imagebase
4983 DD 32*18+56,0
4984 $L$SEH_info_ecp_nistz256_point_add_affinex:
4985 DB 9,0,0,0
4986 DD full_handler wrt ..imagebase
4987 DD $L$add_affinex_body wrt ..imagebase,$L$add_affinex_epilogue wrt ..imagebase
4988 DD 32*15+56,0
4989 %else
4990 ; Work around https://bugzilla.nasm.us/show_bug.cgi?id=3392738
4991 ret
4992 %endif