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 5default rel 6%define XMMWORD 7%define YMMWORD 8%define ZMMWORD 9%define _CET_ENDBR 10 11%ifdef BORINGSSL_PREFIX 12%include "boringssl_prefix_symbols_nasm.inc" 13%endif 14section .text code align=64 15 16ALIGN 16 17 18global md5_block_asm_data_order 19 20md5_block_asm_data_order: 21 mov QWORD[8+rsp],rdi ;WIN64 prologue 22 mov QWORD[16+rsp],rsi 23 mov rax,rsp 24$L$SEH_begin_md5_block_asm_data_order: 25 mov rdi,rcx 26 mov rsi,rdx 27 mov rdx,r8 28 29 30 31_CET_ENDBR 32 push rbp 33 34 push rbx 35 36 push r12 37 38 push r14 39 40 push r15 41 42$L$prologue: 43 44 45 46 47 mov rbp,rdi 48 shl rdx,6 49 lea rdi,[rdx*1+rsi] 50 mov eax,DWORD[rbp] 51 mov ebx,DWORD[4+rbp] 52 mov ecx,DWORD[8+rbp] 53 mov edx,DWORD[12+rbp] 54 55 56 57 58 59 60 61 cmp rsi,rdi 62 je NEAR $L$end 63 64 65$L$loop: 66 mov r8d,eax 67 mov r9d,ebx 68 mov r14d,ecx 69 mov r15d,edx 70 mov r10d,DWORD[rsi] 71 mov r11d,edx 72 xor r11d,ecx 73 lea eax,[((-680876936))+r10*1+rax] 74 and r11d,ebx 75 xor r11d,edx 76 mov r10d,DWORD[4+rsi] 77 add eax,r11d 78 rol eax,7 79 mov r11d,ecx 80 add eax,ebx 81 xor r11d,ebx 82 lea edx,[((-389564586))+r10*1+rdx] 83 and r11d,eax 84 xor r11d,ecx 85 mov r10d,DWORD[8+rsi] 86 add edx,r11d 87 rol edx,12 88 mov r11d,ebx 89 add edx,eax 90 xor r11d,eax 91 lea ecx,[606105819+r10*1+rcx] 92 and r11d,edx 93 xor r11d,ebx 94 mov r10d,DWORD[12+rsi] 95 add ecx,r11d 96 rol ecx,17 97 mov r11d,eax 98 add ecx,edx 99 xor r11d,edx 100 lea ebx,[((-1044525330))+r10*1+rbx] 101 and r11d,ecx 102 xor r11d,eax 103 mov r10d,DWORD[16+rsi] 104 add ebx,r11d 105 rol ebx,22 106 mov r11d,edx 107 add ebx,ecx 108 xor r11d,ecx 109 lea eax,[((-176418897))+r10*1+rax] 110 and r11d,ebx 111 xor r11d,edx 112 mov r10d,DWORD[20+rsi] 113 add eax,r11d 114 rol eax,7 115 mov r11d,ecx 116 add eax,ebx 117 xor r11d,ebx 118 lea edx,[1200080426+r10*1+rdx] 119 and r11d,eax 120 xor r11d,ecx 121 mov r10d,DWORD[24+rsi] 122 add edx,r11d 123 rol edx,12 124 mov r11d,ebx 125 add edx,eax 126 xor r11d,eax 127 lea ecx,[((-1473231341))+r10*1+rcx] 128 and r11d,edx 129 xor r11d,ebx 130 mov r10d,DWORD[28+rsi] 131 add ecx,r11d 132 rol ecx,17 133 mov r11d,eax 134 add ecx,edx 135 xor r11d,edx 136 lea ebx,[((-45705983))+r10*1+rbx] 137 and r11d,ecx 138 xor r11d,eax 139 mov r10d,DWORD[32+rsi] 140 add ebx,r11d 141 rol ebx,22 142 mov r11d,edx 143 add ebx,ecx 144 xor r11d,ecx 145 lea eax,[1770035416+r10*1+rax] 146 and r11d,ebx 147 xor r11d,edx 148 mov r10d,DWORD[36+rsi] 149 add eax,r11d 150 rol eax,7 151 mov r11d,ecx 152 add eax,ebx 153 xor r11d,ebx 154 lea edx,[((-1958414417))+r10*1+rdx] 155 and r11d,eax 156 xor r11d,ecx 157 mov r10d,DWORD[40+rsi] 158 add edx,r11d 159 rol edx,12 160 mov r11d,ebx 161 add edx,eax 162 xor r11d,eax 163 lea ecx,[((-42063))+r10*1+rcx] 164 and r11d,edx 165 xor r11d,ebx 166 mov r10d,DWORD[44+rsi] 167 add ecx,r11d 168 rol ecx,17 169 mov r11d,eax 170 add ecx,edx 171 xor r11d,edx 172 lea ebx,[((-1990404162))+r10*1+rbx] 173 and r11d,ecx 174 xor r11d,eax 175 mov r10d,DWORD[48+rsi] 176 add ebx,r11d 177 rol ebx,22 178 mov r11d,edx 179 add ebx,ecx 180 xor r11d,ecx 181 lea eax,[1804603682+r10*1+rax] 182 and r11d,ebx 183 xor r11d,edx 184 mov r10d,DWORD[52+rsi] 185 add eax,r11d 186 rol eax,7 187 mov r11d,ecx 188 add eax,ebx 189 xor r11d,ebx 190 lea edx,[((-40341101))+r10*1+rdx] 191 and r11d,eax 192 xor r11d,ecx 193 mov r10d,DWORD[56+rsi] 194 add edx,r11d 195 rol edx,12 196 mov r11d,ebx 197 add edx,eax 198 xor r11d,eax 199 lea ecx,[((-1502002290))+r10*1+rcx] 200 and r11d,edx 201 xor r11d,ebx 202 mov r10d,DWORD[60+rsi] 203 add ecx,r11d 204 rol ecx,17 205 mov r11d,eax 206 add ecx,edx 207 xor r11d,edx 208 lea ebx,[1236535329+r10*1+rbx] 209 and r11d,ecx 210 xor r11d,eax 211 mov r10d,DWORD[rsi] 212 add ebx,r11d 213 rol ebx,22 214 mov r11d,edx 215 add ebx,ecx 216 mov r10d,DWORD[4+rsi] 217 mov r11d,edx 218 mov r12d,edx 219 not r11d 220 lea eax,[((-165796510))+r10*1+rax] 221 and r12d,ebx 222 and r11d,ecx 223 mov r10d,DWORD[24+rsi] 224 or r12d,r11d 225 mov r11d,ecx 226 add eax,r12d 227 mov r12d,ecx 228 rol eax,5 229 add eax,ebx 230 not r11d 231 lea edx,[((-1069501632))+r10*1+rdx] 232 and r12d,eax 233 and r11d,ebx 234 mov r10d,DWORD[44+rsi] 235 or r12d,r11d 236 mov r11d,ebx 237 add edx,r12d 238 mov r12d,ebx 239 rol edx,9 240 add edx,eax 241 not r11d 242 lea ecx,[643717713+r10*1+rcx] 243 and r12d,edx 244 and r11d,eax 245 mov r10d,DWORD[rsi] 246 or r12d,r11d 247 mov r11d,eax 248 add ecx,r12d 249 mov r12d,eax 250 rol ecx,14 251 add ecx,edx 252 not r11d 253 lea ebx,[((-373897302))+r10*1+rbx] 254 and r12d,ecx 255 and r11d,edx 256 mov r10d,DWORD[20+rsi] 257 or r12d,r11d 258 mov r11d,edx 259 add ebx,r12d 260 mov r12d,edx 261 rol ebx,20 262 add ebx,ecx 263 not r11d 264 lea eax,[((-701558691))+r10*1+rax] 265 and r12d,ebx 266 and r11d,ecx 267 mov r10d,DWORD[40+rsi] 268 or r12d,r11d 269 mov r11d,ecx 270 add eax,r12d 271 mov r12d,ecx 272 rol eax,5 273 add eax,ebx 274 not r11d 275 lea edx,[38016083+r10*1+rdx] 276 and r12d,eax 277 and r11d,ebx 278 mov r10d,DWORD[60+rsi] 279 or r12d,r11d 280 mov r11d,ebx 281 add edx,r12d 282 mov r12d,ebx 283 rol edx,9 284 add edx,eax 285 not r11d 286 lea ecx,[((-660478335))+r10*1+rcx] 287 and r12d,edx 288 and r11d,eax 289 mov r10d,DWORD[16+rsi] 290 or r12d,r11d 291 mov r11d,eax 292 add ecx,r12d 293 mov r12d,eax 294 rol ecx,14 295 add ecx,edx 296 not r11d 297 lea ebx,[((-405537848))+r10*1+rbx] 298 and r12d,ecx 299 and r11d,edx 300 mov r10d,DWORD[36+rsi] 301 or r12d,r11d 302 mov r11d,edx 303 add ebx,r12d 304 mov r12d,edx 305 rol ebx,20 306 add ebx,ecx 307 not r11d 308 lea eax,[568446438+r10*1+rax] 309 and r12d,ebx 310 and r11d,ecx 311 mov r10d,DWORD[56+rsi] 312 or r12d,r11d 313 mov r11d,ecx 314 add eax,r12d 315 mov r12d,ecx 316 rol eax,5 317 add eax,ebx 318 not r11d 319 lea edx,[((-1019803690))+r10*1+rdx] 320 and r12d,eax 321 and r11d,ebx 322 mov r10d,DWORD[12+rsi] 323 or r12d,r11d 324 mov r11d,ebx 325 add edx,r12d 326 mov r12d,ebx 327 rol edx,9 328 add edx,eax 329 not r11d 330 lea ecx,[((-187363961))+r10*1+rcx] 331 and r12d,edx 332 and r11d,eax 333 mov r10d,DWORD[32+rsi] 334 or r12d,r11d 335 mov r11d,eax 336 add ecx,r12d 337 mov r12d,eax 338 rol ecx,14 339 add ecx,edx 340 not r11d 341 lea ebx,[1163531501+r10*1+rbx] 342 and r12d,ecx 343 and r11d,edx 344 mov r10d,DWORD[52+rsi] 345 or r12d,r11d 346 mov r11d,edx 347 add ebx,r12d 348 mov r12d,edx 349 rol ebx,20 350 add ebx,ecx 351 not r11d 352 lea eax,[((-1444681467))+r10*1+rax] 353 and r12d,ebx 354 and r11d,ecx 355 mov r10d,DWORD[8+rsi] 356 or r12d,r11d 357 mov r11d,ecx 358 add eax,r12d 359 mov r12d,ecx 360 rol eax,5 361 add eax,ebx 362 not r11d 363 lea edx,[((-51403784))+r10*1+rdx] 364 and r12d,eax 365 and r11d,ebx 366 mov r10d,DWORD[28+rsi] 367 or r12d,r11d 368 mov r11d,ebx 369 add edx,r12d 370 mov r12d,ebx 371 rol edx,9 372 add edx,eax 373 not r11d 374 lea ecx,[1735328473+r10*1+rcx] 375 and r12d,edx 376 and r11d,eax 377 mov r10d,DWORD[48+rsi] 378 or r12d,r11d 379 mov r11d,eax 380 add ecx,r12d 381 mov r12d,eax 382 rol ecx,14 383 add ecx,edx 384 not r11d 385 lea ebx,[((-1926607734))+r10*1+rbx] 386 and r12d,ecx 387 and r11d,edx 388 mov r10d,DWORD[rsi] 389 or r12d,r11d 390 mov r11d,edx 391 add ebx,r12d 392 mov r12d,edx 393 rol ebx,20 394 add ebx,ecx 395 mov r10d,DWORD[20+rsi] 396 mov r11d,ecx 397 lea eax,[((-378558))+r10*1+rax] 398 mov r10d,DWORD[32+rsi] 399 xor r11d,edx 400 xor r11d,ebx 401 add eax,r11d 402 rol eax,4 403 mov r11d,ebx 404 add eax,ebx 405 lea edx,[((-2022574463))+r10*1+rdx] 406 mov r10d,DWORD[44+rsi] 407 xor r11d,ecx 408 xor r11d,eax 409 add edx,r11d 410 rol edx,11 411 mov r11d,eax 412 add edx,eax 413 lea ecx,[1839030562+r10*1+rcx] 414 mov r10d,DWORD[56+rsi] 415 xor r11d,ebx 416 xor r11d,edx 417 add ecx,r11d 418 rol ecx,16 419 mov r11d,edx 420 add ecx,edx 421 lea ebx,[((-35309556))+r10*1+rbx] 422 mov r10d,DWORD[4+rsi] 423 xor r11d,eax 424 xor r11d,ecx 425 add ebx,r11d 426 rol ebx,23 427 mov r11d,ecx 428 add ebx,ecx 429 lea eax,[((-1530992060))+r10*1+rax] 430 mov r10d,DWORD[16+rsi] 431 xor r11d,edx 432 xor r11d,ebx 433 add eax,r11d 434 rol eax,4 435 mov r11d,ebx 436 add eax,ebx 437 lea edx,[1272893353+r10*1+rdx] 438 mov r10d,DWORD[28+rsi] 439 xor r11d,ecx 440 xor r11d,eax 441 add edx,r11d 442 rol edx,11 443 mov r11d,eax 444 add edx,eax 445 lea ecx,[((-155497632))+r10*1+rcx] 446 mov r10d,DWORD[40+rsi] 447 xor r11d,ebx 448 xor r11d,edx 449 add ecx,r11d 450 rol ecx,16 451 mov r11d,edx 452 add ecx,edx 453 lea ebx,[((-1094730640))+r10*1+rbx] 454 mov r10d,DWORD[52+rsi] 455 xor r11d,eax 456 xor r11d,ecx 457 add ebx,r11d 458 rol ebx,23 459 mov r11d,ecx 460 add ebx,ecx 461 lea eax,[681279174+r10*1+rax] 462 mov r10d,DWORD[rsi] 463 xor r11d,edx 464 xor r11d,ebx 465 add eax,r11d 466 rol eax,4 467 mov r11d,ebx 468 add eax,ebx 469 lea edx,[((-358537222))+r10*1+rdx] 470 mov r10d,DWORD[12+rsi] 471 xor r11d,ecx 472 xor r11d,eax 473 add edx,r11d 474 rol edx,11 475 mov r11d,eax 476 add edx,eax 477 lea ecx,[((-722521979))+r10*1+rcx] 478 mov r10d,DWORD[24+rsi] 479 xor r11d,ebx 480 xor r11d,edx 481 add ecx,r11d 482 rol ecx,16 483 mov r11d,edx 484 add ecx,edx 485 lea ebx,[76029189+r10*1+rbx] 486 mov r10d,DWORD[36+rsi] 487 xor r11d,eax 488 xor r11d,ecx 489 add ebx,r11d 490 rol ebx,23 491 mov r11d,ecx 492 add ebx,ecx 493 lea eax,[((-640364487))+r10*1+rax] 494 mov r10d,DWORD[48+rsi] 495 xor r11d,edx 496 xor r11d,ebx 497 add eax,r11d 498 rol eax,4 499 mov r11d,ebx 500 add eax,ebx 501 lea edx,[((-421815835))+r10*1+rdx] 502 mov r10d,DWORD[60+rsi] 503 xor r11d,ecx 504 xor r11d,eax 505 add edx,r11d 506 rol edx,11 507 mov r11d,eax 508 add edx,eax 509 lea ecx,[530742520+r10*1+rcx] 510 mov r10d,DWORD[8+rsi] 511 xor r11d,ebx 512 xor r11d,edx 513 add ecx,r11d 514 rol ecx,16 515 mov r11d,edx 516 add ecx,edx 517 lea ebx,[((-995338651))+r10*1+rbx] 518 mov r10d,DWORD[rsi] 519 xor r11d,eax 520 xor r11d,ecx 521 add ebx,r11d 522 rol ebx,23 523 mov r11d,ecx 524 add ebx,ecx 525 mov r10d,DWORD[rsi] 526 mov r11d,0xffffffff 527 xor r11d,edx 528 lea eax,[((-198630844))+r10*1+rax] 529 or r11d,ebx 530 xor r11d,ecx 531 add eax,r11d 532 mov r10d,DWORD[28+rsi] 533 mov r11d,0xffffffff 534 rol eax,6 535 xor r11d,ecx 536 add eax,ebx 537 lea edx,[1126891415+r10*1+rdx] 538 or r11d,eax 539 xor r11d,ebx 540 add edx,r11d 541 mov r10d,DWORD[56+rsi] 542 mov r11d,0xffffffff 543 rol edx,10 544 xor r11d,ebx 545 add edx,eax 546 lea ecx,[((-1416354905))+r10*1+rcx] 547 or r11d,edx 548 xor r11d,eax 549 add ecx,r11d 550 mov r10d,DWORD[20+rsi] 551 mov r11d,0xffffffff 552 rol ecx,15 553 xor r11d,eax 554 add ecx,edx 555 lea ebx,[((-57434055))+r10*1+rbx] 556 or r11d,ecx 557 xor r11d,edx 558 add ebx,r11d 559 mov r10d,DWORD[48+rsi] 560 mov r11d,0xffffffff 561 rol ebx,21 562 xor r11d,edx 563 add ebx,ecx 564 lea eax,[1700485571+r10*1+rax] 565 or r11d,ebx 566 xor r11d,ecx 567 add eax,r11d 568 mov r10d,DWORD[12+rsi] 569 mov r11d,0xffffffff 570 rol eax,6 571 xor r11d,ecx 572 add eax,ebx 573 lea edx,[((-1894986606))+r10*1+rdx] 574 or r11d,eax 575 xor r11d,ebx 576 add edx,r11d 577 mov r10d,DWORD[40+rsi] 578 mov r11d,0xffffffff 579 rol edx,10 580 xor r11d,ebx 581 add edx,eax 582 lea ecx,[((-1051523))+r10*1+rcx] 583 or r11d,edx 584 xor r11d,eax 585 add ecx,r11d 586 mov r10d,DWORD[4+rsi] 587 mov r11d,0xffffffff 588 rol ecx,15 589 xor r11d,eax 590 add ecx,edx 591 lea ebx,[((-2054922799))+r10*1+rbx] 592 or r11d,ecx 593 xor r11d,edx 594 add ebx,r11d 595 mov r10d,DWORD[32+rsi] 596 mov r11d,0xffffffff 597 rol ebx,21 598 xor r11d,edx 599 add ebx,ecx 600 lea eax,[1873313359+r10*1+rax] 601 or r11d,ebx 602 xor r11d,ecx 603 add eax,r11d 604 mov r10d,DWORD[60+rsi] 605 mov r11d,0xffffffff 606 rol eax,6 607 xor r11d,ecx 608 add eax,ebx 609 lea edx,[((-30611744))+r10*1+rdx] 610 or r11d,eax 611 xor r11d,ebx 612 add edx,r11d 613 mov r10d,DWORD[24+rsi] 614 mov r11d,0xffffffff 615 rol edx,10 616 xor r11d,ebx 617 add edx,eax 618 lea ecx,[((-1560198380))+r10*1+rcx] 619 or r11d,edx 620 xor r11d,eax 621 add ecx,r11d 622 mov r10d,DWORD[52+rsi] 623 mov r11d,0xffffffff 624 rol ecx,15 625 xor r11d,eax 626 add ecx,edx 627 lea ebx,[1309151649+r10*1+rbx] 628 or r11d,ecx 629 xor r11d,edx 630 add ebx,r11d 631 mov r10d,DWORD[16+rsi] 632 mov r11d,0xffffffff 633 rol ebx,21 634 xor r11d,edx 635 add ebx,ecx 636 lea eax,[((-145523070))+r10*1+rax] 637 or r11d,ebx 638 xor r11d,ecx 639 add eax,r11d 640 mov r10d,DWORD[44+rsi] 641 mov r11d,0xffffffff 642 rol eax,6 643 xor r11d,ecx 644 add eax,ebx 645 lea edx,[((-1120210379))+r10*1+rdx] 646 or r11d,eax 647 xor r11d,ebx 648 add edx,r11d 649 mov r10d,DWORD[8+rsi] 650 mov r11d,0xffffffff 651 rol edx,10 652 xor r11d,ebx 653 add edx,eax 654 lea ecx,[718787259+r10*1+rcx] 655 or r11d,edx 656 xor r11d,eax 657 add ecx,r11d 658 mov r10d,DWORD[36+rsi] 659 mov r11d,0xffffffff 660 rol ecx,15 661 xor r11d,eax 662 add ecx,edx 663 lea ebx,[((-343485551))+r10*1+rbx] 664 or r11d,ecx 665 xor r11d,edx 666 add ebx,r11d 667 mov r10d,DWORD[rsi] 668 mov r11d,0xffffffff 669 rol ebx,21 670 xor r11d,edx 671 add ebx,ecx 672 673 add eax,r8d 674 add ebx,r9d 675 add ecx,r14d 676 add edx,r15d 677 678 679 add rsi,64 680 cmp rsi,rdi 681 jb NEAR $L$loop 682 683 684$L$end: 685 mov DWORD[rbp],eax 686 mov DWORD[4+rbp],ebx 687 mov DWORD[8+rbp],ecx 688 mov DWORD[12+rbp],edx 689 690 mov r15,QWORD[rsp] 691 692 mov r14,QWORD[8+rsp] 693 694 mov r12,QWORD[16+rsp] 695 696 mov rbx,QWORD[24+rsp] 697 698 mov rbp,QWORD[32+rsp] 699 700 add rsp,40 701 702$L$epilogue: 703 mov rdi,QWORD[8+rsp] ;WIN64 epilogue 704 mov rsi,QWORD[16+rsp] 705 ret 706 707$L$SEH_end_md5_block_asm_data_order: 708EXTERN __imp_RtlVirtualUnwind 709 710ALIGN 16 711se_handler: 712 push rsi 713 push rdi 714 push rbx 715 push rbp 716 push r12 717 push r13 718 push r14 719 push r15 720 pushfq 721 sub rsp,64 722 723 mov rax,QWORD[120+r8] 724 mov rbx,QWORD[248+r8] 725 726 lea r10,[$L$prologue] 727 cmp rbx,r10 728 jb NEAR $L$in_prologue 729 730 mov rax,QWORD[152+r8] 731 732 lea r10,[$L$epilogue] 733 cmp rbx,r10 734 jae NEAR $L$in_prologue 735 736 lea rax,[40+rax] 737 738 mov rbp,QWORD[((-8))+rax] 739 mov rbx,QWORD[((-16))+rax] 740 mov r12,QWORD[((-24))+rax] 741 mov r14,QWORD[((-32))+rax] 742 mov r15,QWORD[((-40))+rax] 743 mov QWORD[144+r8],rbx 744 mov QWORD[160+r8],rbp 745 mov QWORD[216+r8],r12 746 mov QWORD[232+r8],r14 747 mov QWORD[240+r8],r15 748 749$L$in_prologue: 750 mov rdi,QWORD[8+rax] 751 mov rsi,QWORD[16+rax] 752 mov QWORD[152+r8],rax 753 mov QWORD[168+r8],rsi 754 mov QWORD[176+r8],rdi 755 756 mov rdi,QWORD[40+r9] 757 mov rsi,r8 758 mov ecx,154 759 DD 0xa548f3fc 760 761 mov rsi,r9 762 xor rcx,rcx 763 mov rdx,QWORD[8+rsi] 764 mov r8,QWORD[rsi] 765 mov r9,QWORD[16+rsi] 766 mov r10,QWORD[40+rsi] 767 lea r11,[56+rsi] 768 lea r12,[24+rsi] 769 mov QWORD[32+rsp],r10 770 mov QWORD[40+rsp],r11 771 mov QWORD[48+rsp],r12 772 mov QWORD[56+rsp],rcx 773 call QWORD[__imp_RtlVirtualUnwind] 774 775 mov eax,1 776 add rsp,64 777 popfq 778 pop r15 779 pop r14 780 pop r13 781 pop r12 782 pop rbp 783 pop rbx 784 pop rdi 785 pop rsi 786 ret 787 788 789section .pdata rdata align=4 790ALIGN 4 791 DD $L$SEH_begin_md5_block_asm_data_order wrt ..imagebase 792 DD $L$SEH_end_md5_block_asm_data_order wrt ..imagebase 793 DD $L$SEH_info_md5_block_asm_data_order wrt ..imagebase 794 795section .xdata rdata align=8 796ALIGN 8 797$L$SEH_info_md5_block_asm_data_order: 798 DB 9,0,0,0 799 DD se_handler wrt ..imagebase 800%else 801; Work around https://bugzilla.nasm.us/show_bug.cgi?id=3392738 802ret 803%endif 804