Workaround for xkbcommon dead keys.
[chromium-blink-merge.git] / third_party / boringssl / win-x86 / crypto / bn / bn-586.asm
blob04420a999a54a66f0bd616b56ec1c36e71a8c3e7
1 %ifidn __OUTPUT_FORMAT__,obj
2 section code use32 class=code align=64
3 %elifidn __OUTPUT_FORMAT__,win32
4 %ifdef __YASM_VERSION_ID__
5 %if __YASM_VERSION_ID__ < 01010000h
6 %error yasm version 1.1.0 or later needed.
7 %endif
8 ; Yasm automatically includes .00 and complains about redefining it.
9 ; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
10 %else
11 $@feat.00 equ 1
12 %endif
13 section .text code align=64
14 %else
15 section .text code
16 %endif
17 global _bn_mul_add_words
18 align 16
19 _bn_mul_add_words:
20 L$_bn_mul_add_words_begin:
21 push ebp
22 push ebx
23 push esi
24 push edi
26 xor esi,esi
27 mov edi,DWORD [20+esp]
28 mov ecx,DWORD [28+esp]
29 mov ebx,DWORD [24+esp]
30 and ecx,4294967288
31 mov ebp,DWORD [32+esp]
32 push ecx
33 jz NEAR L$000maw_finish
34 align 16
35 L$001maw_loop:
36 ; Round 0
37 mov eax,DWORD [ebx]
38 mul ebp
39 add eax,esi
40 adc edx,0
41 add eax,DWORD [edi]
42 adc edx,0
43 mov DWORD [edi],eax
44 mov esi,edx
45 ; Round 4
46 mov eax,DWORD [4+ebx]
47 mul ebp
48 add eax,esi
49 adc edx,0
50 add eax,DWORD [4+edi]
51 adc edx,0
52 mov DWORD [4+edi],eax
53 mov esi,edx
54 ; Round 8
55 mov eax,DWORD [8+ebx]
56 mul ebp
57 add eax,esi
58 adc edx,0
59 add eax,DWORD [8+edi]
60 adc edx,0
61 mov DWORD [8+edi],eax
62 mov esi,edx
63 ; Round 12
64 mov eax,DWORD [12+ebx]
65 mul ebp
66 add eax,esi
67 adc edx,0
68 add eax,DWORD [12+edi]
69 adc edx,0
70 mov DWORD [12+edi],eax
71 mov esi,edx
72 ; Round 16
73 mov eax,DWORD [16+ebx]
74 mul ebp
75 add eax,esi
76 adc edx,0
77 add eax,DWORD [16+edi]
78 adc edx,0
79 mov DWORD [16+edi],eax
80 mov esi,edx
81 ; Round 20
82 mov eax,DWORD [20+ebx]
83 mul ebp
84 add eax,esi
85 adc edx,0
86 add eax,DWORD [20+edi]
87 adc edx,0
88 mov DWORD [20+edi],eax
89 mov esi,edx
90 ; Round 24
91 mov eax,DWORD [24+ebx]
92 mul ebp
93 add eax,esi
94 adc edx,0
95 add eax,DWORD [24+edi]
96 adc edx,0
97 mov DWORD [24+edi],eax
98 mov esi,edx
99 ; Round 28
100 mov eax,DWORD [28+ebx]
101 mul ebp
102 add eax,esi
103 adc edx,0
104 add eax,DWORD [28+edi]
105 adc edx,0
106 mov DWORD [28+edi],eax
107 mov esi,edx
109 sub ecx,8
110 lea ebx,[32+ebx]
111 lea edi,[32+edi]
112 jnz NEAR L$001maw_loop
113 L$000maw_finish:
114 mov ecx,DWORD [32+esp]
115 and ecx,7
116 jnz NEAR L$002maw_finish2
117 jmp NEAR L$003maw_end
118 L$002maw_finish2:
119 ; Tail Round 0
120 mov eax,DWORD [ebx]
121 mul ebp
122 add eax,esi
123 adc edx,0
124 add eax,DWORD [edi]
125 adc edx,0
126 dec ecx
127 mov DWORD [edi],eax
128 mov esi,edx
129 jz NEAR L$003maw_end
130 ; Tail Round 1
131 mov eax,DWORD [4+ebx]
132 mul ebp
133 add eax,esi
134 adc edx,0
135 add eax,DWORD [4+edi]
136 adc edx,0
137 dec ecx
138 mov DWORD [4+edi],eax
139 mov esi,edx
140 jz NEAR L$003maw_end
141 ; Tail Round 2
142 mov eax,DWORD [8+ebx]
143 mul ebp
144 add eax,esi
145 adc edx,0
146 add eax,DWORD [8+edi]
147 adc edx,0
148 dec ecx
149 mov DWORD [8+edi],eax
150 mov esi,edx
151 jz NEAR L$003maw_end
152 ; Tail Round 3
153 mov eax,DWORD [12+ebx]
154 mul ebp
155 add eax,esi
156 adc edx,0
157 add eax,DWORD [12+edi]
158 adc edx,0
159 dec ecx
160 mov DWORD [12+edi],eax
161 mov esi,edx
162 jz NEAR L$003maw_end
163 ; Tail Round 4
164 mov eax,DWORD [16+ebx]
165 mul ebp
166 add eax,esi
167 adc edx,0
168 add eax,DWORD [16+edi]
169 adc edx,0
170 dec ecx
171 mov DWORD [16+edi],eax
172 mov esi,edx
173 jz NEAR L$003maw_end
174 ; Tail Round 5
175 mov eax,DWORD [20+ebx]
176 mul ebp
177 add eax,esi
178 adc edx,0
179 add eax,DWORD [20+edi]
180 adc edx,0
181 dec ecx
182 mov DWORD [20+edi],eax
183 mov esi,edx
184 jz NEAR L$003maw_end
185 ; Tail Round 6
186 mov eax,DWORD [24+ebx]
187 mul ebp
188 add eax,esi
189 adc edx,0
190 add eax,DWORD [24+edi]
191 adc edx,0
192 mov DWORD [24+edi],eax
193 mov esi,edx
194 L$003maw_end:
195 mov eax,esi
196 pop ecx
197 pop edi
198 pop esi
199 pop ebx
200 pop ebp
202 global _bn_mul_words
203 align 16
204 _bn_mul_words:
205 L$_bn_mul_words_begin:
206 push ebp
207 push ebx
208 push esi
209 push edi
211 xor esi,esi
212 mov edi,DWORD [20+esp]
213 mov ebx,DWORD [24+esp]
214 mov ebp,DWORD [28+esp]
215 mov ecx,DWORD [32+esp]
216 and ebp,4294967288
217 jz NEAR L$004mw_finish
218 L$005mw_loop:
219 ; Round 0
220 mov eax,DWORD [ebx]
221 mul ecx
222 add eax,esi
223 adc edx,0
224 mov DWORD [edi],eax
225 mov esi,edx
226 ; Round 4
227 mov eax,DWORD [4+ebx]
228 mul ecx
229 add eax,esi
230 adc edx,0
231 mov DWORD [4+edi],eax
232 mov esi,edx
233 ; Round 8
234 mov eax,DWORD [8+ebx]
235 mul ecx
236 add eax,esi
237 adc edx,0
238 mov DWORD [8+edi],eax
239 mov esi,edx
240 ; Round 12
241 mov eax,DWORD [12+ebx]
242 mul ecx
243 add eax,esi
244 adc edx,0
245 mov DWORD [12+edi],eax
246 mov esi,edx
247 ; Round 16
248 mov eax,DWORD [16+ebx]
249 mul ecx
250 add eax,esi
251 adc edx,0
252 mov DWORD [16+edi],eax
253 mov esi,edx
254 ; Round 20
255 mov eax,DWORD [20+ebx]
256 mul ecx
257 add eax,esi
258 adc edx,0
259 mov DWORD [20+edi],eax
260 mov esi,edx
261 ; Round 24
262 mov eax,DWORD [24+ebx]
263 mul ecx
264 add eax,esi
265 adc edx,0
266 mov DWORD [24+edi],eax
267 mov esi,edx
268 ; Round 28
269 mov eax,DWORD [28+ebx]
270 mul ecx
271 add eax,esi
272 adc edx,0
273 mov DWORD [28+edi],eax
274 mov esi,edx
276 add ebx,32
277 add edi,32
278 sub ebp,8
279 jz NEAR L$004mw_finish
280 jmp NEAR L$005mw_loop
281 L$004mw_finish:
282 mov ebp,DWORD [28+esp]
283 and ebp,7
284 jnz NEAR L$006mw_finish2
285 jmp NEAR L$007mw_end
286 L$006mw_finish2:
287 ; Tail Round 0
288 mov eax,DWORD [ebx]
289 mul ecx
290 add eax,esi
291 adc edx,0
292 mov DWORD [edi],eax
293 mov esi,edx
294 dec ebp
295 jz NEAR L$007mw_end
296 ; Tail Round 1
297 mov eax,DWORD [4+ebx]
298 mul ecx
299 add eax,esi
300 adc edx,0
301 mov DWORD [4+edi],eax
302 mov esi,edx
303 dec ebp
304 jz NEAR L$007mw_end
305 ; Tail Round 2
306 mov eax,DWORD [8+ebx]
307 mul ecx
308 add eax,esi
309 adc edx,0
310 mov DWORD [8+edi],eax
311 mov esi,edx
312 dec ebp
313 jz NEAR L$007mw_end
314 ; Tail Round 3
315 mov eax,DWORD [12+ebx]
316 mul ecx
317 add eax,esi
318 adc edx,0
319 mov DWORD [12+edi],eax
320 mov esi,edx
321 dec ebp
322 jz NEAR L$007mw_end
323 ; Tail Round 4
324 mov eax,DWORD [16+ebx]
325 mul ecx
326 add eax,esi
327 adc edx,0
328 mov DWORD [16+edi],eax
329 mov esi,edx
330 dec ebp
331 jz NEAR L$007mw_end
332 ; Tail Round 5
333 mov eax,DWORD [20+ebx]
334 mul ecx
335 add eax,esi
336 adc edx,0
337 mov DWORD [20+edi],eax
338 mov esi,edx
339 dec ebp
340 jz NEAR L$007mw_end
341 ; Tail Round 6
342 mov eax,DWORD [24+ebx]
343 mul ecx
344 add eax,esi
345 adc edx,0
346 mov DWORD [24+edi],eax
347 mov esi,edx
348 L$007mw_end:
349 mov eax,esi
350 pop edi
351 pop esi
352 pop ebx
353 pop ebp
355 global _bn_sqr_words
356 align 16
357 _bn_sqr_words:
358 L$_bn_sqr_words_begin:
359 push ebp
360 push ebx
361 push esi
362 push edi
364 mov esi,DWORD [20+esp]
365 mov edi,DWORD [24+esp]
366 mov ebx,DWORD [28+esp]
367 and ebx,4294967288
368 jz NEAR L$008sw_finish
369 L$009sw_loop:
370 ; Round 0
371 mov eax,DWORD [edi]
372 mul eax
373 mov DWORD [esi],eax
374 mov DWORD [4+esi],edx
375 ; Round 4
376 mov eax,DWORD [4+edi]
377 mul eax
378 mov DWORD [8+esi],eax
379 mov DWORD [12+esi],edx
380 ; Round 8
381 mov eax,DWORD [8+edi]
382 mul eax
383 mov DWORD [16+esi],eax
384 mov DWORD [20+esi],edx
385 ; Round 12
386 mov eax,DWORD [12+edi]
387 mul eax
388 mov DWORD [24+esi],eax
389 mov DWORD [28+esi],edx
390 ; Round 16
391 mov eax,DWORD [16+edi]
392 mul eax
393 mov DWORD [32+esi],eax
394 mov DWORD [36+esi],edx
395 ; Round 20
396 mov eax,DWORD [20+edi]
397 mul eax
398 mov DWORD [40+esi],eax
399 mov DWORD [44+esi],edx
400 ; Round 24
401 mov eax,DWORD [24+edi]
402 mul eax
403 mov DWORD [48+esi],eax
404 mov DWORD [52+esi],edx
405 ; Round 28
406 mov eax,DWORD [28+edi]
407 mul eax
408 mov DWORD [56+esi],eax
409 mov DWORD [60+esi],edx
411 add edi,32
412 add esi,64
413 sub ebx,8
414 jnz NEAR L$009sw_loop
415 L$008sw_finish:
416 mov ebx,DWORD [28+esp]
417 and ebx,7
418 jz NEAR L$010sw_end
419 ; Tail Round 0
420 mov eax,DWORD [edi]
421 mul eax
422 mov DWORD [esi],eax
423 dec ebx
424 mov DWORD [4+esi],edx
425 jz NEAR L$010sw_end
426 ; Tail Round 1
427 mov eax,DWORD [4+edi]
428 mul eax
429 mov DWORD [8+esi],eax
430 dec ebx
431 mov DWORD [12+esi],edx
432 jz NEAR L$010sw_end
433 ; Tail Round 2
434 mov eax,DWORD [8+edi]
435 mul eax
436 mov DWORD [16+esi],eax
437 dec ebx
438 mov DWORD [20+esi],edx
439 jz NEAR L$010sw_end
440 ; Tail Round 3
441 mov eax,DWORD [12+edi]
442 mul eax
443 mov DWORD [24+esi],eax
444 dec ebx
445 mov DWORD [28+esi],edx
446 jz NEAR L$010sw_end
447 ; Tail Round 4
448 mov eax,DWORD [16+edi]
449 mul eax
450 mov DWORD [32+esi],eax
451 dec ebx
452 mov DWORD [36+esi],edx
453 jz NEAR L$010sw_end
454 ; Tail Round 5
455 mov eax,DWORD [20+edi]
456 mul eax
457 mov DWORD [40+esi],eax
458 dec ebx
459 mov DWORD [44+esi],edx
460 jz NEAR L$010sw_end
461 ; Tail Round 6
462 mov eax,DWORD [24+edi]
463 mul eax
464 mov DWORD [48+esi],eax
465 mov DWORD [52+esi],edx
466 L$010sw_end:
467 pop edi
468 pop esi
469 pop ebx
470 pop ebp
472 global _bn_div_words
473 align 16
474 _bn_div_words:
475 L$_bn_div_words_begin:
476 mov edx,DWORD [4+esp]
477 mov eax,DWORD [8+esp]
478 mov ecx,DWORD [12+esp]
479 div ecx
481 global _bn_add_words
482 align 16
483 _bn_add_words:
484 L$_bn_add_words_begin:
485 push ebp
486 push ebx
487 push esi
488 push edi
490 mov ebx,DWORD [20+esp]
491 mov esi,DWORD [24+esp]
492 mov edi,DWORD [28+esp]
493 mov ebp,DWORD [32+esp]
494 xor eax,eax
495 and ebp,4294967288
496 jz NEAR L$011aw_finish
497 L$012aw_loop:
498 ; Round 0
499 mov ecx,DWORD [esi]
500 mov edx,DWORD [edi]
501 add ecx,eax
502 mov eax,0
503 adc eax,eax
504 add ecx,edx
505 adc eax,0
506 mov DWORD [ebx],ecx
507 ; Round 1
508 mov ecx,DWORD [4+esi]
509 mov edx,DWORD [4+edi]
510 add ecx,eax
511 mov eax,0
512 adc eax,eax
513 add ecx,edx
514 adc eax,0
515 mov DWORD [4+ebx],ecx
516 ; Round 2
517 mov ecx,DWORD [8+esi]
518 mov edx,DWORD [8+edi]
519 add ecx,eax
520 mov eax,0
521 adc eax,eax
522 add ecx,edx
523 adc eax,0
524 mov DWORD [8+ebx],ecx
525 ; Round 3
526 mov ecx,DWORD [12+esi]
527 mov edx,DWORD [12+edi]
528 add ecx,eax
529 mov eax,0
530 adc eax,eax
531 add ecx,edx
532 adc eax,0
533 mov DWORD [12+ebx],ecx
534 ; Round 4
535 mov ecx,DWORD [16+esi]
536 mov edx,DWORD [16+edi]
537 add ecx,eax
538 mov eax,0
539 adc eax,eax
540 add ecx,edx
541 adc eax,0
542 mov DWORD [16+ebx],ecx
543 ; Round 5
544 mov ecx,DWORD [20+esi]
545 mov edx,DWORD [20+edi]
546 add ecx,eax
547 mov eax,0
548 adc eax,eax
549 add ecx,edx
550 adc eax,0
551 mov DWORD [20+ebx],ecx
552 ; Round 6
553 mov ecx,DWORD [24+esi]
554 mov edx,DWORD [24+edi]
555 add ecx,eax
556 mov eax,0
557 adc eax,eax
558 add ecx,edx
559 adc eax,0
560 mov DWORD [24+ebx],ecx
561 ; Round 7
562 mov ecx,DWORD [28+esi]
563 mov edx,DWORD [28+edi]
564 add ecx,eax
565 mov eax,0
566 adc eax,eax
567 add ecx,edx
568 adc eax,0
569 mov DWORD [28+ebx],ecx
571 add esi,32
572 add edi,32
573 add ebx,32
574 sub ebp,8
575 jnz NEAR L$012aw_loop
576 L$011aw_finish:
577 mov ebp,DWORD [32+esp]
578 and ebp,7
579 jz NEAR L$013aw_end
580 ; Tail Round 0
581 mov ecx,DWORD [esi]
582 mov edx,DWORD [edi]
583 add ecx,eax
584 mov eax,0
585 adc eax,eax
586 add ecx,edx
587 adc eax,0
588 dec ebp
589 mov DWORD [ebx],ecx
590 jz NEAR L$013aw_end
591 ; Tail Round 1
592 mov ecx,DWORD [4+esi]
593 mov edx,DWORD [4+edi]
594 add ecx,eax
595 mov eax,0
596 adc eax,eax
597 add ecx,edx
598 adc eax,0
599 dec ebp
600 mov DWORD [4+ebx],ecx
601 jz NEAR L$013aw_end
602 ; Tail Round 2
603 mov ecx,DWORD [8+esi]
604 mov edx,DWORD [8+edi]
605 add ecx,eax
606 mov eax,0
607 adc eax,eax
608 add ecx,edx
609 adc eax,0
610 dec ebp
611 mov DWORD [8+ebx],ecx
612 jz NEAR L$013aw_end
613 ; Tail Round 3
614 mov ecx,DWORD [12+esi]
615 mov edx,DWORD [12+edi]
616 add ecx,eax
617 mov eax,0
618 adc eax,eax
619 add ecx,edx
620 adc eax,0
621 dec ebp
622 mov DWORD [12+ebx],ecx
623 jz NEAR L$013aw_end
624 ; Tail Round 4
625 mov ecx,DWORD [16+esi]
626 mov edx,DWORD [16+edi]
627 add ecx,eax
628 mov eax,0
629 adc eax,eax
630 add ecx,edx
631 adc eax,0
632 dec ebp
633 mov DWORD [16+ebx],ecx
634 jz NEAR L$013aw_end
635 ; Tail Round 5
636 mov ecx,DWORD [20+esi]
637 mov edx,DWORD [20+edi]
638 add ecx,eax
639 mov eax,0
640 adc eax,eax
641 add ecx,edx
642 adc eax,0
643 dec ebp
644 mov DWORD [20+ebx],ecx
645 jz NEAR L$013aw_end
646 ; Tail Round 6
647 mov ecx,DWORD [24+esi]
648 mov edx,DWORD [24+edi]
649 add ecx,eax
650 mov eax,0
651 adc eax,eax
652 add ecx,edx
653 adc eax,0
654 mov DWORD [24+ebx],ecx
655 L$013aw_end:
656 pop edi
657 pop esi
658 pop ebx
659 pop ebp
661 global _bn_sub_words
662 align 16
663 _bn_sub_words:
664 L$_bn_sub_words_begin:
665 push ebp
666 push ebx
667 push esi
668 push edi
670 mov ebx,DWORD [20+esp]
671 mov esi,DWORD [24+esp]
672 mov edi,DWORD [28+esp]
673 mov ebp,DWORD [32+esp]
674 xor eax,eax
675 and ebp,4294967288
676 jz NEAR L$014aw_finish
677 L$015aw_loop:
678 ; Round 0
679 mov ecx,DWORD [esi]
680 mov edx,DWORD [edi]
681 sub ecx,eax
682 mov eax,0
683 adc eax,eax
684 sub ecx,edx
685 adc eax,0
686 mov DWORD [ebx],ecx
687 ; Round 1
688 mov ecx,DWORD [4+esi]
689 mov edx,DWORD [4+edi]
690 sub ecx,eax
691 mov eax,0
692 adc eax,eax
693 sub ecx,edx
694 adc eax,0
695 mov DWORD [4+ebx],ecx
696 ; Round 2
697 mov ecx,DWORD [8+esi]
698 mov edx,DWORD [8+edi]
699 sub ecx,eax
700 mov eax,0
701 adc eax,eax
702 sub ecx,edx
703 adc eax,0
704 mov DWORD [8+ebx],ecx
705 ; Round 3
706 mov ecx,DWORD [12+esi]
707 mov edx,DWORD [12+edi]
708 sub ecx,eax
709 mov eax,0
710 adc eax,eax
711 sub ecx,edx
712 adc eax,0
713 mov DWORD [12+ebx],ecx
714 ; Round 4
715 mov ecx,DWORD [16+esi]
716 mov edx,DWORD [16+edi]
717 sub ecx,eax
718 mov eax,0
719 adc eax,eax
720 sub ecx,edx
721 adc eax,0
722 mov DWORD [16+ebx],ecx
723 ; Round 5
724 mov ecx,DWORD [20+esi]
725 mov edx,DWORD [20+edi]
726 sub ecx,eax
727 mov eax,0
728 adc eax,eax
729 sub ecx,edx
730 adc eax,0
731 mov DWORD [20+ebx],ecx
732 ; Round 6
733 mov ecx,DWORD [24+esi]
734 mov edx,DWORD [24+edi]
735 sub ecx,eax
736 mov eax,0
737 adc eax,eax
738 sub ecx,edx
739 adc eax,0
740 mov DWORD [24+ebx],ecx
741 ; Round 7
742 mov ecx,DWORD [28+esi]
743 mov edx,DWORD [28+edi]
744 sub ecx,eax
745 mov eax,0
746 adc eax,eax
747 sub ecx,edx
748 adc eax,0
749 mov DWORD [28+ebx],ecx
751 add esi,32
752 add edi,32
753 add ebx,32
754 sub ebp,8
755 jnz NEAR L$015aw_loop
756 L$014aw_finish:
757 mov ebp,DWORD [32+esp]
758 and ebp,7
759 jz NEAR L$016aw_end
760 ; Tail Round 0
761 mov ecx,DWORD [esi]
762 mov edx,DWORD [edi]
763 sub ecx,eax
764 mov eax,0
765 adc eax,eax
766 sub ecx,edx
767 adc eax,0
768 dec ebp
769 mov DWORD [ebx],ecx
770 jz NEAR L$016aw_end
771 ; Tail Round 1
772 mov ecx,DWORD [4+esi]
773 mov edx,DWORD [4+edi]
774 sub ecx,eax
775 mov eax,0
776 adc eax,eax
777 sub ecx,edx
778 adc eax,0
779 dec ebp
780 mov DWORD [4+ebx],ecx
781 jz NEAR L$016aw_end
782 ; Tail Round 2
783 mov ecx,DWORD [8+esi]
784 mov edx,DWORD [8+edi]
785 sub ecx,eax
786 mov eax,0
787 adc eax,eax
788 sub ecx,edx
789 adc eax,0
790 dec ebp
791 mov DWORD [8+ebx],ecx
792 jz NEAR L$016aw_end
793 ; Tail Round 3
794 mov ecx,DWORD [12+esi]
795 mov edx,DWORD [12+edi]
796 sub ecx,eax
797 mov eax,0
798 adc eax,eax
799 sub ecx,edx
800 adc eax,0
801 dec ebp
802 mov DWORD [12+ebx],ecx
803 jz NEAR L$016aw_end
804 ; Tail Round 4
805 mov ecx,DWORD [16+esi]
806 mov edx,DWORD [16+edi]
807 sub ecx,eax
808 mov eax,0
809 adc eax,eax
810 sub ecx,edx
811 adc eax,0
812 dec ebp
813 mov DWORD [16+ebx],ecx
814 jz NEAR L$016aw_end
815 ; Tail Round 5
816 mov ecx,DWORD [20+esi]
817 mov edx,DWORD [20+edi]
818 sub ecx,eax
819 mov eax,0
820 adc eax,eax
821 sub ecx,edx
822 adc eax,0
823 dec ebp
824 mov DWORD [20+ebx],ecx
825 jz NEAR L$016aw_end
826 ; Tail Round 6
827 mov ecx,DWORD [24+esi]
828 mov edx,DWORD [24+edi]
829 sub ecx,eax
830 mov eax,0
831 adc eax,eax
832 sub ecx,edx
833 adc eax,0
834 mov DWORD [24+ebx],ecx
835 L$016aw_end:
836 pop edi
837 pop esi
838 pop ebx
839 pop ebp
841 global _bn_sub_part_words
842 align 16
843 _bn_sub_part_words:
844 L$_bn_sub_part_words_begin:
845 push ebp
846 push ebx
847 push esi
848 push edi
850 mov ebx,DWORD [20+esp]
851 mov esi,DWORD [24+esp]
852 mov edi,DWORD [28+esp]
853 mov ebp,DWORD [32+esp]
854 xor eax,eax
855 and ebp,4294967288
856 jz NEAR L$017aw_finish
857 L$018aw_loop:
858 ; Round 0
859 mov ecx,DWORD [esi]
860 mov edx,DWORD [edi]
861 sub ecx,eax
862 mov eax,0
863 adc eax,eax
864 sub ecx,edx
865 adc eax,0
866 mov DWORD [ebx],ecx
867 ; Round 1
868 mov ecx,DWORD [4+esi]
869 mov edx,DWORD [4+edi]
870 sub ecx,eax
871 mov eax,0
872 adc eax,eax
873 sub ecx,edx
874 adc eax,0
875 mov DWORD [4+ebx],ecx
876 ; Round 2
877 mov ecx,DWORD [8+esi]
878 mov edx,DWORD [8+edi]
879 sub ecx,eax
880 mov eax,0
881 adc eax,eax
882 sub ecx,edx
883 adc eax,0
884 mov DWORD [8+ebx],ecx
885 ; Round 3
886 mov ecx,DWORD [12+esi]
887 mov edx,DWORD [12+edi]
888 sub ecx,eax
889 mov eax,0
890 adc eax,eax
891 sub ecx,edx
892 adc eax,0
893 mov DWORD [12+ebx],ecx
894 ; Round 4
895 mov ecx,DWORD [16+esi]
896 mov edx,DWORD [16+edi]
897 sub ecx,eax
898 mov eax,0
899 adc eax,eax
900 sub ecx,edx
901 adc eax,0
902 mov DWORD [16+ebx],ecx
903 ; Round 5
904 mov ecx,DWORD [20+esi]
905 mov edx,DWORD [20+edi]
906 sub ecx,eax
907 mov eax,0
908 adc eax,eax
909 sub ecx,edx
910 adc eax,0
911 mov DWORD [20+ebx],ecx
912 ; Round 6
913 mov ecx,DWORD [24+esi]
914 mov edx,DWORD [24+edi]
915 sub ecx,eax
916 mov eax,0
917 adc eax,eax
918 sub ecx,edx
919 adc eax,0
920 mov DWORD [24+ebx],ecx
921 ; Round 7
922 mov ecx,DWORD [28+esi]
923 mov edx,DWORD [28+edi]
924 sub ecx,eax
925 mov eax,0
926 adc eax,eax
927 sub ecx,edx
928 adc eax,0
929 mov DWORD [28+ebx],ecx
931 add esi,32
932 add edi,32
933 add ebx,32
934 sub ebp,8
935 jnz NEAR L$018aw_loop
936 L$017aw_finish:
937 mov ebp,DWORD [32+esp]
938 and ebp,7
939 jz NEAR L$019aw_end
940 ; Tail Round 0
941 mov ecx,DWORD [esi]
942 mov edx,DWORD [edi]
943 sub ecx,eax
944 mov eax,0
945 adc eax,eax
946 sub ecx,edx
947 adc eax,0
948 mov DWORD [ebx],ecx
949 add esi,4
950 add edi,4
951 add ebx,4
952 dec ebp
953 jz NEAR L$019aw_end
954 ; Tail Round 1
955 mov ecx,DWORD [esi]
956 mov edx,DWORD [edi]
957 sub ecx,eax
958 mov eax,0
959 adc eax,eax
960 sub ecx,edx
961 adc eax,0
962 mov DWORD [ebx],ecx
963 add esi,4
964 add edi,4
965 add ebx,4
966 dec ebp
967 jz NEAR L$019aw_end
968 ; Tail Round 2
969 mov ecx,DWORD [esi]
970 mov edx,DWORD [edi]
971 sub ecx,eax
972 mov eax,0
973 adc eax,eax
974 sub ecx,edx
975 adc eax,0
976 mov DWORD [ebx],ecx
977 add esi,4
978 add edi,4
979 add ebx,4
980 dec ebp
981 jz NEAR L$019aw_end
982 ; Tail Round 3
983 mov ecx,DWORD [esi]
984 mov edx,DWORD [edi]
985 sub ecx,eax
986 mov eax,0
987 adc eax,eax
988 sub ecx,edx
989 adc eax,0
990 mov DWORD [ebx],ecx
991 add esi,4
992 add edi,4
993 add ebx,4
994 dec ebp
995 jz NEAR L$019aw_end
996 ; Tail Round 4
997 mov ecx,DWORD [esi]
998 mov edx,DWORD [edi]
999 sub ecx,eax
1000 mov eax,0
1001 adc eax,eax
1002 sub ecx,edx
1003 adc eax,0
1004 mov DWORD [ebx],ecx
1005 add esi,4
1006 add edi,4
1007 add ebx,4
1008 dec ebp
1009 jz NEAR L$019aw_end
1010 ; Tail Round 5
1011 mov ecx,DWORD [esi]
1012 mov edx,DWORD [edi]
1013 sub ecx,eax
1014 mov eax,0
1015 adc eax,eax
1016 sub ecx,edx
1017 adc eax,0
1018 mov DWORD [ebx],ecx
1019 add esi,4
1020 add edi,4
1021 add ebx,4
1022 dec ebp
1023 jz NEAR L$019aw_end
1024 ; Tail Round 6
1025 mov ecx,DWORD [esi]
1026 mov edx,DWORD [edi]
1027 sub ecx,eax
1028 mov eax,0
1029 adc eax,eax
1030 sub ecx,edx
1031 adc eax,0
1032 mov DWORD [ebx],ecx
1033 add esi,4
1034 add edi,4
1035 add ebx,4
1036 L$019aw_end:
1037 cmp DWORD [36+esp],0
1038 je NEAR L$020pw_end
1039 mov ebp,DWORD [36+esp]
1040 cmp ebp,0
1041 je NEAR L$020pw_end
1042 jge NEAR L$021pw_pos
1043 ; pw_neg
1044 mov edx,0
1045 sub edx,ebp
1046 mov ebp,edx
1047 and ebp,4294967288
1048 jz NEAR L$022pw_neg_finish
1049 L$023pw_neg_loop:
1050 ; dl<0 Round 0
1051 mov ecx,0
1052 mov edx,DWORD [edi]
1053 sub ecx,eax
1054 mov eax,0
1055 adc eax,eax
1056 sub ecx,edx
1057 adc eax,0
1058 mov DWORD [ebx],ecx
1059 ; dl<0 Round 1
1060 mov ecx,0
1061 mov edx,DWORD [4+edi]
1062 sub ecx,eax
1063 mov eax,0
1064 adc eax,eax
1065 sub ecx,edx
1066 adc eax,0
1067 mov DWORD [4+ebx],ecx
1068 ; dl<0 Round 2
1069 mov ecx,0
1070 mov edx,DWORD [8+edi]
1071 sub ecx,eax
1072 mov eax,0
1073 adc eax,eax
1074 sub ecx,edx
1075 adc eax,0
1076 mov DWORD [8+ebx],ecx
1077 ; dl<0 Round 3
1078 mov ecx,0
1079 mov edx,DWORD [12+edi]
1080 sub ecx,eax
1081 mov eax,0
1082 adc eax,eax
1083 sub ecx,edx
1084 adc eax,0
1085 mov DWORD [12+ebx],ecx
1086 ; dl<0 Round 4
1087 mov ecx,0
1088 mov edx,DWORD [16+edi]
1089 sub ecx,eax
1090 mov eax,0
1091 adc eax,eax
1092 sub ecx,edx
1093 adc eax,0
1094 mov DWORD [16+ebx],ecx
1095 ; dl<0 Round 5
1096 mov ecx,0
1097 mov edx,DWORD [20+edi]
1098 sub ecx,eax
1099 mov eax,0
1100 adc eax,eax
1101 sub ecx,edx
1102 adc eax,0
1103 mov DWORD [20+ebx],ecx
1104 ; dl<0 Round 6
1105 mov ecx,0
1106 mov edx,DWORD [24+edi]
1107 sub ecx,eax
1108 mov eax,0
1109 adc eax,eax
1110 sub ecx,edx
1111 adc eax,0
1112 mov DWORD [24+ebx],ecx
1113 ; dl<0 Round 7
1114 mov ecx,0
1115 mov edx,DWORD [28+edi]
1116 sub ecx,eax
1117 mov eax,0
1118 adc eax,eax
1119 sub ecx,edx
1120 adc eax,0
1121 mov DWORD [28+ebx],ecx
1123 add edi,32
1124 add ebx,32
1125 sub ebp,8
1126 jnz NEAR L$023pw_neg_loop
1127 L$022pw_neg_finish:
1128 mov edx,DWORD [36+esp]
1129 mov ebp,0
1130 sub ebp,edx
1131 and ebp,7
1132 jz NEAR L$020pw_end
1133 ; dl<0 Tail Round 0
1134 mov ecx,0
1135 mov edx,DWORD [edi]
1136 sub ecx,eax
1137 mov eax,0
1138 adc eax,eax
1139 sub ecx,edx
1140 adc eax,0
1141 dec ebp
1142 mov DWORD [ebx],ecx
1143 jz NEAR L$020pw_end
1144 ; dl<0 Tail Round 1
1145 mov ecx,0
1146 mov edx,DWORD [4+edi]
1147 sub ecx,eax
1148 mov eax,0
1149 adc eax,eax
1150 sub ecx,edx
1151 adc eax,0
1152 dec ebp
1153 mov DWORD [4+ebx],ecx
1154 jz NEAR L$020pw_end
1155 ; dl<0 Tail Round 2
1156 mov ecx,0
1157 mov edx,DWORD [8+edi]
1158 sub ecx,eax
1159 mov eax,0
1160 adc eax,eax
1161 sub ecx,edx
1162 adc eax,0
1163 dec ebp
1164 mov DWORD [8+ebx],ecx
1165 jz NEAR L$020pw_end
1166 ; dl<0 Tail Round 3
1167 mov ecx,0
1168 mov edx,DWORD [12+edi]
1169 sub ecx,eax
1170 mov eax,0
1171 adc eax,eax
1172 sub ecx,edx
1173 adc eax,0
1174 dec ebp
1175 mov DWORD [12+ebx],ecx
1176 jz NEAR L$020pw_end
1177 ; dl<0 Tail Round 4
1178 mov ecx,0
1179 mov edx,DWORD [16+edi]
1180 sub ecx,eax
1181 mov eax,0
1182 adc eax,eax
1183 sub ecx,edx
1184 adc eax,0
1185 dec ebp
1186 mov DWORD [16+ebx],ecx
1187 jz NEAR L$020pw_end
1188 ; dl<0 Tail Round 5
1189 mov ecx,0
1190 mov edx,DWORD [20+edi]
1191 sub ecx,eax
1192 mov eax,0
1193 adc eax,eax
1194 sub ecx,edx
1195 adc eax,0
1196 dec ebp
1197 mov DWORD [20+ebx],ecx
1198 jz NEAR L$020pw_end
1199 ; dl<0 Tail Round 6
1200 mov ecx,0
1201 mov edx,DWORD [24+edi]
1202 sub ecx,eax
1203 mov eax,0
1204 adc eax,eax
1205 sub ecx,edx
1206 adc eax,0
1207 mov DWORD [24+ebx],ecx
1208 jmp NEAR L$020pw_end
1209 L$021pw_pos:
1210 and ebp,4294967288
1211 jz NEAR L$024pw_pos_finish
1212 L$025pw_pos_loop:
1213 ; dl>0 Round 0
1214 mov ecx,DWORD [esi]
1215 sub ecx,eax
1216 mov DWORD [ebx],ecx
1217 jnc NEAR L$026pw_nc0
1218 ; dl>0 Round 1
1219 mov ecx,DWORD [4+esi]
1220 sub ecx,eax
1221 mov DWORD [4+ebx],ecx
1222 jnc NEAR L$027pw_nc1
1223 ; dl>0 Round 2
1224 mov ecx,DWORD [8+esi]
1225 sub ecx,eax
1226 mov DWORD [8+ebx],ecx
1227 jnc NEAR L$028pw_nc2
1228 ; dl>0 Round 3
1229 mov ecx,DWORD [12+esi]
1230 sub ecx,eax
1231 mov DWORD [12+ebx],ecx
1232 jnc NEAR L$029pw_nc3
1233 ; dl>0 Round 4
1234 mov ecx,DWORD [16+esi]
1235 sub ecx,eax
1236 mov DWORD [16+ebx],ecx
1237 jnc NEAR L$030pw_nc4
1238 ; dl>0 Round 5
1239 mov ecx,DWORD [20+esi]
1240 sub ecx,eax
1241 mov DWORD [20+ebx],ecx
1242 jnc NEAR L$031pw_nc5
1243 ; dl>0 Round 6
1244 mov ecx,DWORD [24+esi]
1245 sub ecx,eax
1246 mov DWORD [24+ebx],ecx
1247 jnc NEAR L$032pw_nc6
1248 ; dl>0 Round 7
1249 mov ecx,DWORD [28+esi]
1250 sub ecx,eax
1251 mov DWORD [28+ebx],ecx
1252 jnc NEAR L$033pw_nc7
1254 add esi,32
1255 add ebx,32
1256 sub ebp,8
1257 jnz NEAR L$025pw_pos_loop
1258 L$024pw_pos_finish:
1259 mov ebp,DWORD [36+esp]
1260 and ebp,7
1261 jz NEAR L$020pw_end
1262 ; dl>0 Tail Round 0
1263 mov ecx,DWORD [esi]
1264 sub ecx,eax
1265 mov DWORD [ebx],ecx
1266 jnc NEAR L$034pw_tail_nc0
1267 dec ebp
1268 jz NEAR L$020pw_end
1269 ; dl>0 Tail Round 1
1270 mov ecx,DWORD [4+esi]
1271 sub ecx,eax
1272 mov DWORD [4+ebx],ecx
1273 jnc NEAR L$035pw_tail_nc1
1274 dec ebp
1275 jz NEAR L$020pw_end
1276 ; dl>0 Tail Round 2
1277 mov ecx,DWORD [8+esi]
1278 sub ecx,eax
1279 mov DWORD [8+ebx],ecx
1280 jnc NEAR L$036pw_tail_nc2
1281 dec ebp
1282 jz NEAR L$020pw_end
1283 ; dl>0 Tail Round 3
1284 mov ecx,DWORD [12+esi]
1285 sub ecx,eax
1286 mov DWORD [12+ebx],ecx
1287 jnc NEAR L$037pw_tail_nc3
1288 dec ebp
1289 jz NEAR L$020pw_end
1290 ; dl>0 Tail Round 4
1291 mov ecx,DWORD [16+esi]
1292 sub ecx,eax
1293 mov DWORD [16+ebx],ecx
1294 jnc NEAR L$038pw_tail_nc4
1295 dec ebp
1296 jz NEAR L$020pw_end
1297 ; dl>0 Tail Round 5
1298 mov ecx,DWORD [20+esi]
1299 sub ecx,eax
1300 mov DWORD [20+ebx],ecx
1301 jnc NEAR L$039pw_tail_nc5
1302 dec ebp
1303 jz NEAR L$020pw_end
1304 ; dl>0 Tail Round 6
1305 mov ecx,DWORD [24+esi]
1306 sub ecx,eax
1307 mov DWORD [24+ebx],ecx
1308 jnc NEAR L$040pw_tail_nc6
1309 mov eax,1
1310 jmp NEAR L$020pw_end
1311 L$041pw_nc_loop:
1312 mov ecx,DWORD [esi]
1313 mov DWORD [ebx],ecx
1314 L$026pw_nc0:
1315 mov ecx,DWORD [4+esi]
1316 mov DWORD [4+ebx],ecx
1317 L$027pw_nc1:
1318 mov ecx,DWORD [8+esi]
1319 mov DWORD [8+ebx],ecx
1320 L$028pw_nc2:
1321 mov ecx,DWORD [12+esi]
1322 mov DWORD [12+ebx],ecx
1323 L$029pw_nc3:
1324 mov ecx,DWORD [16+esi]
1325 mov DWORD [16+ebx],ecx
1326 L$030pw_nc4:
1327 mov ecx,DWORD [20+esi]
1328 mov DWORD [20+ebx],ecx
1329 L$031pw_nc5:
1330 mov ecx,DWORD [24+esi]
1331 mov DWORD [24+ebx],ecx
1332 L$032pw_nc6:
1333 mov ecx,DWORD [28+esi]
1334 mov DWORD [28+ebx],ecx
1335 L$033pw_nc7:
1337 add esi,32
1338 add ebx,32
1339 sub ebp,8
1340 jnz NEAR L$041pw_nc_loop
1341 mov ebp,DWORD [36+esp]
1342 and ebp,7
1343 jz NEAR L$042pw_nc_end
1344 mov ecx,DWORD [esi]
1345 mov DWORD [ebx],ecx
1346 L$034pw_tail_nc0:
1347 dec ebp
1348 jz NEAR L$042pw_nc_end
1349 mov ecx,DWORD [4+esi]
1350 mov DWORD [4+ebx],ecx
1351 L$035pw_tail_nc1:
1352 dec ebp
1353 jz NEAR L$042pw_nc_end
1354 mov ecx,DWORD [8+esi]
1355 mov DWORD [8+ebx],ecx
1356 L$036pw_tail_nc2:
1357 dec ebp
1358 jz NEAR L$042pw_nc_end
1359 mov ecx,DWORD [12+esi]
1360 mov DWORD [12+ebx],ecx
1361 L$037pw_tail_nc3:
1362 dec ebp
1363 jz NEAR L$042pw_nc_end
1364 mov ecx,DWORD [16+esi]
1365 mov DWORD [16+ebx],ecx
1366 L$038pw_tail_nc4:
1367 dec ebp
1368 jz NEAR L$042pw_nc_end
1369 mov ecx,DWORD [20+esi]
1370 mov DWORD [20+ebx],ecx
1371 L$039pw_tail_nc5:
1372 dec ebp
1373 jz NEAR L$042pw_nc_end
1374 mov ecx,DWORD [24+esi]
1375 mov DWORD [24+ebx],ecx
1376 L$040pw_tail_nc6:
1377 L$042pw_nc_end:
1378 mov eax,0
1379 L$020pw_end:
1380 pop edi
1381 pop esi
1382 pop ebx
1383 pop ebp