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