1%ifidn __OUTPUT_FORMAT__,obj 2section code use32 class=code align=64 3%elifidn __OUTPUT_FORMAT__,win32 4$@feat.00 equ 1 5section .text code align=64 6%else 7section .text code 8%endif 9global _padlock_capability 10align 16 11_padlock_capability: 12L$_padlock_capability_begin: 13 push ebx 14 pushfd 15 pop eax 16 mov ecx,eax 17 xor eax,2097152 18 push eax 19 popfd 20 pushfd 21 pop eax 22 xor ecx,eax 23 xor eax,eax 24 bt ecx,21 25 jnc NEAR L$000noluck 26 cpuid 27 xor eax,eax 28 cmp ebx,0x746e6543 29 jne NEAR L$001zhaoxin 30 cmp edx,0x48727561 31 jne NEAR L$000noluck 32 cmp ecx,0x736c7561 33 jne NEAR L$000noluck 34 jmp NEAR L$002zhaoxinEnd 35L$001zhaoxin: 36 cmp ebx,0x68532020 37 jne NEAR L$000noluck 38 cmp edx,0x68676e61 39 jne NEAR L$000noluck 40 cmp ecx,0x20206961 41 jne NEAR L$000noluck 42L$002zhaoxinEnd: 43 mov eax,3221225472 44 cpuid 45 mov edx,eax 46 xor eax,eax 47 cmp edx,3221225473 48 jb NEAR L$000noluck 49 mov eax,1 50 cpuid 51 or eax,15 52 xor ebx,ebx 53 and eax,4095 54 cmp eax,1791 55 sete bl 56 mov eax,3221225473 57 push ebx 58 cpuid 59 pop ebx 60 mov eax,edx 61 shl ebx,4 62 and eax,4294967279 63 or eax,ebx 64L$000noluck: 65 pop ebx 66 ret 67global _padlock_key_bswap 68align 16 69_padlock_key_bswap: 70L$_padlock_key_bswap_begin: 71 mov edx,DWORD [4+esp] 72 mov ecx,DWORD [240+edx] 73 inc ecx 74 shl ecx,2 75L$003bswap_loop: 76 mov eax,DWORD [edx] 77 bswap eax 78 mov DWORD [edx],eax 79 lea edx,[4+edx] 80 sub ecx,1 81 jnz NEAR L$003bswap_loop 82 ret 83global _padlock_verify_context 84align 16 85_padlock_verify_context: 86L$_padlock_verify_context_begin: 87 mov edx,DWORD [4+esp] 88 lea eax,[L$padlock_saved_context] 89 pushfd 90 call __padlock_verify_ctx 91L$004verify_pic_point: 92 lea esp,[4+esp] 93 ret 94align 16 95__padlock_verify_ctx: 96 bt DWORD [4+esp],30 97 jnc NEAR L$005verified 98 cmp edx,DWORD [eax] 99 je NEAR L$005verified 100 pushfd 101 popfd 102L$005verified: 103 mov DWORD [eax],edx 104 ret 105global _padlock_reload_key 106align 16 107_padlock_reload_key: 108L$_padlock_reload_key_begin: 109 pushfd 110 popfd 111 ret 112global _padlock_aes_block 113align 16 114_padlock_aes_block: 115L$_padlock_aes_block_begin: 116 push edi 117 push esi 118 push ebx 119 mov edi,DWORD [16+esp] 120 mov esi,DWORD [20+esp] 121 mov edx,DWORD [24+esp] 122 mov ecx,1 123 lea ebx,[32+edx] 124 lea edx,[16+edx] 125db 243,15,167,200 126 pop ebx 127 pop esi 128 pop edi 129 ret 130global _padlock_ecb_encrypt 131align 16 132_padlock_ecb_encrypt: 133L$_padlock_ecb_encrypt_begin: 134 push ebp 135 push ebx 136 push esi 137 push edi 138 mov edi,DWORD [20+esp] 139 mov esi,DWORD [24+esp] 140 mov edx,DWORD [28+esp] 141 mov ecx,DWORD [32+esp] 142 test edx,15 143 jnz NEAR L$006ecb_abort 144 test ecx,15 145 jnz NEAR L$006ecb_abort 146 lea eax,[L$padlock_saved_context] 147 pushfd 148 cld 149 call __padlock_verify_ctx 150L$007ecb_pic_point: 151 lea edx,[16+edx] 152 xor eax,eax 153 xor ebx,ebx 154 test DWORD [edx],32 155 jnz NEAR L$008ecb_aligned 156 test edi,15 157 setz al 158 test esi,15 159 setz bl 160 test eax,ebx 161 jnz NEAR L$008ecb_aligned 162 neg eax 163 mov ebx,512 164 not eax 165 lea ebp,[esp-24] 166 cmp ecx,ebx 167 cmovc ebx,ecx 168 and eax,ebx 169 mov ebx,ecx 170 neg eax 171 and ebx,511 172 lea esp,[ebp*1+eax] 173 mov eax,512 174 cmovz ebx,eax 175 mov eax,ebp 176 and ebp,-16 177 and esp,-16 178 mov DWORD [16+ebp],eax 179 cmp ecx,ebx 180 ja NEAR L$009ecb_loop 181 mov eax,esi 182 cmp ebp,esp 183 cmove eax,edi 184 add eax,ecx 185 neg eax 186 and eax,4095 187 cmp eax,128 188 mov eax,-128 189 cmovae eax,ebx 190 and ebx,eax 191 jz NEAR L$010ecb_unaligned_tail 192 jmp NEAR L$009ecb_loop 193align 16 194L$009ecb_loop: 195 mov DWORD [ebp],edi 196 mov DWORD [4+ebp],esi 197 mov DWORD [8+ebp],ecx 198 mov ecx,ebx 199 mov DWORD [12+ebp],ebx 200 test edi,15 201 cmovnz edi,esp 202 test esi,15 203 jz NEAR L$011ecb_inp_aligned 204 shr ecx,2 205db 243,165 206 sub edi,ebx 207 mov ecx,ebx 208 mov esi,edi 209L$011ecb_inp_aligned: 210 lea eax,[edx-16] 211 lea ebx,[16+edx] 212 shr ecx,4 213db 243,15,167,200 214 mov edi,DWORD [ebp] 215 mov ebx,DWORD [12+ebp] 216 test edi,15 217 jz NEAR L$012ecb_out_aligned 218 mov ecx,ebx 219 lea esi,[esp] 220 shr ecx,2 221db 243,165 222 sub edi,ebx 223L$012ecb_out_aligned: 224 mov esi,DWORD [4+ebp] 225 mov ecx,DWORD [8+ebp] 226 add edi,ebx 227 add esi,ebx 228 sub ecx,ebx 229 mov ebx,512 230 jz NEAR L$013ecb_break 231 cmp ecx,ebx 232 jae NEAR L$009ecb_loop 233L$010ecb_unaligned_tail: 234 xor eax,eax 235 cmp esp,ebp 236 cmove eax,ecx 237 sub esp,eax 238 mov eax,edi 239 mov ebx,ecx 240 shr ecx,2 241 lea edi,[esp] 242db 243,165 243 mov esi,esp 244 mov edi,eax 245 mov ecx,ebx 246 jmp NEAR L$009ecb_loop 247align 16 248L$013ecb_break: 249 cmp esp,ebp 250 je NEAR L$014ecb_done 251 pxor xmm0,xmm0 252 lea eax,[esp] 253L$015ecb_bzero: 254 movaps [eax],xmm0 255 lea eax,[16+eax] 256 cmp ebp,eax 257 ja NEAR L$015ecb_bzero 258L$014ecb_done: 259 mov ebp,DWORD [16+ebp] 260 lea esp,[24+ebp] 261 jmp NEAR L$016ecb_exit 262align 16 263L$008ecb_aligned: 264 lea ebp,[ecx*1+esi] 265 neg ebp 266 and ebp,4095 267 xor eax,eax 268 cmp ebp,128 269 mov ebp,127 270 cmovae ebp,eax 271 and ebp,ecx 272 sub ecx,ebp 273 jz NEAR L$017ecb_aligned_tail 274 lea eax,[edx-16] 275 lea ebx,[16+edx] 276 shr ecx,4 277db 243,15,167,200 278 test ebp,ebp 279 jz NEAR L$016ecb_exit 280L$017ecb_aligned_tail: 281 mov ecx,ebp 282 lea ebp,[esp-24] 283 mov esp,ebp 284 mov eax,ebp 285 sub esp,ecx 286 and ebp,-16 287 and esp,-16 288 mov DWORD [16+ebp],eax 289 mov eax,edi 290 mov ebx,ecx 291 shr ecx,2 292 lea edi,[esp] 293db 243,165 294 mov esi,esp 295 mov edi,eax 296 mov ecx,ebx 297 jmp NEAR L$009ecb_loop 298L$016ecb_exit: 299 mov eax,1 300 lea esp,[4+esp] 301L$006ecb_abort: 302 pop edi 303 pop esi 304 pop ebx 305 pop ebp 306 ret 307global _padlock_cbc_encrypt 308align 16 309_padlock_cbc_encrypt: 310L$_padlock_cbc_encrypt_begin: 311 push ebp 312 push ebx 313 push esi 314 push edi 315 mov edi,DWORD [20+esp] 316 mov esi,DWORD [24+esp] 317 mov edx,DWORD [28+esp] 318 mov ecx,DWORD [32+esp] 319 test edx,15 320 jnz NEAR L$018cbc_abort 321 test ecx,15 322 jnz NEAR L$018cbc_abort 323 lea eax,[L$padlock_saved_context] 324 pushfd 325 cld 326 call __padlock_verify_ctx 327L$019cbc_pic_point: 328 lea edx,[16+edx] 329 xor eax,eax 330 xor ebx,ebx 331 test DWORD [edx],32 332 jnz NEAR L$020cbc_aligned 333 test edi,15 334 setz al 335 test esi,15 336 setz bl 337 test eax,ebx 338 jnz NEAR L$020cbc_aligned 339 neg eax 340 mov ebx,512 341 not eax 342 lea ebp,[esp-24] 343 cmp ecx,ebx 344 cmovc ebx,ecx 345 and eax,ebx 346 mov ebx,ecx 347 neg eax 348 and ebx,511 349 lea esp,[ebp*1+eax] 350 mov eax,512 351 cmovz ebx,eax 352 mov eax,ebp 353 and ebp,-16 354 and esp,-16 355 mov DWORD [16+ebp],eax 356 cmp ecx,ebx 357 ja NEAR L$021cbc_loop 358 mov eax,esi 359 cmp ebp,esp 360 cmove eax,edi 361 add eax,ecx 362 neg eax 363 and eax,4095 364 cmp eax,64 365 mov eax,-64 366 cmovae eax,ebx 367 and ebx,eax 368 jz NEAR L$022cbc_unaligned_tail 369 jmp NEAR L$021cbc_loop 370align 16 371L$021cbc_loop: 372 mov DWORD [ebp],edi 373 mov DWORD [4+ebp],esi 374 mov DWORD [8+ebp],ecx 375 mov ecx,ebx 376 mov DWORD [12+ebp],ebx 377 test edi,15 378 cmovnz edi,esp 379 test esi,15 380 jz NEAR L$023cbc_inp_aligned 381 shr ecx,2 382db 243,165 383 sub edi,ebx 384 mov ecx,ebx 385 mov esi,edi 386L$023cbc_inp_aligned: 387 lea eax,[edx-16] 388 lea ebx,[16+edx] 389 shr ecx,4 390db 243,15,167,208 391 movaps xmm0,[eax] 392 movaps [edx-16],xmm0 393 mov edi,DWORD [ebp] 394 mov ebx,DWORD [12+ebp] 395 test edi,15 396 jz NEAR L$024cbc_out_aligned 397 mov ecx,ebx 398 lea esi,[esp] 399 shr ecx,2 400db 243,165 401 sub edi,ebx 402L$024cbc_out_aligned: 403 mov esi,DWORD [4+ebp] 404 mov ecx,DWORD [8+ebp] 405 add edi,ebx 406 add esi,ebx 407 sub ecx,ebx 408 mov ebx,512 409 jz NEAR L$025cbc_break 410 cmp ecx,ebx 411 jae NEAR L$021cbc_loop 412L$022cbc_unaligned_tail: 413 xor eax,eax 414 cmp esp,ebp 415 cmove eax,ecx 416 sub esp,eax 417 mov eax,edi 418 mov ebx,ecx 419 shr ecx,2 420 lea edi,[esp] 421db 243,165 422 mov esi,esp 423 mov edi,eax 424 mov ecx,ebx 425 jmp NEAR L$021cbc_loop 426align 16 427L$025cbc_break: 428 cmp esp,ebp 429 je NEAR L$026cbc_done 430 pxor xmm0,xmm0 431 lea eax,[esp] 432L$027cbc_bzero: 433 movaps [eax],xmm0 434 lea eax,[16+eax] 435 cmp ebp,eax 436 ja NEAR L$027cbc_bzero 437L$026cbc_done: 438 mov ebp,DWORD [16+ebp] 439 lea esp,[24+ebp] 440 jmp NEAR L$028cbc_exit 441align 16 442L$020cbc_aligned: 443 lea ebp,[ecx*1+esi] 444 neg ebp 445 and ebp,4095 446 xor eax,eax 447 cmp ebp,64 448 mov ebp,63 449 cmovae ebp,eax 450 and ebp,ecx 451 sub ecx,ebp 452 jz NEAR L$029cbc_aligned_tail 453 lea eax,[edx-16] 454 lea ebx,[16+edx] 455 shr ecx,4 456db 243,15,167,208 457 movaps xmm0,[eax] 458 movaps [edx-16],xmm0 459 test ebp,ebp 460 jz NEAR L$028cbc_exit 461L$029cbc_aligned_tail: 462 mov ecx,ebp 463 lea ebp,[esp-24] 464 mov esp,ebp 465 mov eax,ebp 466 sub esp,ecx 467 and ebp,-16 468 and esp,-16 469 mov DWORD [16+ebp],eax 470 mov eax,edi 471 mov ebx,ecx 472 shr ecx,2 473 lea edi,[esp] 474db 243,165 475 mov esi,esp 476 mov edi,eax 477 mov ecx,ebx 478 jmp NEAR L$021cbc_loop 479L$028cbc_exit: 480 mov eax,1 481 lea esp,[4+esp] 482L$018cbc_abort: 483 pop edi 484 pop esi 485 pop ebx 486 pop ebp 487 ret 488global _padlock_cfb_encrypt 489align 16 490_padlock_cfb_encrypt: 491L$_padlock_cfb_encrypt_begin: 492 push ebp 493 push ebx 494 push esi 495 push edi 496 mov edi,DWORD [20+esp] 497 mov esi,DWORD [24+esp] 498 mov edx,DWORD [28+esp] 499 mov ecx,DWORD [32+esp] 500 test edx,15 501 jnz NEAR L$030cfb_abort 502 test ecx,15 503 jnz NEAR L$030cfb_abort 504 lea eax,[L$padlock_saved_context] 505 pushfd 506 cld 507 call __padlock_verify_ctx 508L$031cfb_pic_point: 509 lea edx,[16+edx] 510 xor eax,eax 511 xor ebx,ebx 512 test DWORD [edx],32 513 jnz NEAR L$032cfb_aligned 514 test edi,15 515 setz al 516 test esi,15 517 setz bl 518 test eax,ebx 519 jnz NEAR L$032cfb_aligned 520 neg eax 521 mov ebx,512 522 not eax 523 lea ebp,[esp-24] 524 cmp ecx,ebx 525 cmovc ebx,ecx 526 and eax,ebx 527 mov ebx,ecx 528 neg eax 529 and ebx,511 530 lea esp,[ebp*1+eax] 531 mov eax,512 532 cmovz ebx,eax 533 mov eax,ebp 534 and ebp,-16 535 and esp,-16 536 mov DWORD [16+ebp],eax 537 jmp NEAR L$033cfb_loop 538align 16 539L$033cfb_loop: 540 mov DWORD [ebp],edi 541 mov DWORD [4+ebp],esi 542 mov DWORD [8+ebp],ecx 543 mov ecx,ebx 544 mov DWORD [12+ebp],ebx 545 test edi,15 546 cmovnz edi,esp 547 test esi,15 548 jz NEAR L$034cfb_inp_aligned 549 shr ecx,2 550db 243,165 551 sub edi,ebx 552 mov ecx,ebx 553 mov esi,edi 554L$034cfb_inp_aligned: 555 lea eax,[edx-16] 556 lea ebx,[16+edx] 557 shr ecx,4 558db 243,15,167,224 559 movaps xmm0,[eax] 560 movaps [edx-16],xmm0 561 mov edi,DWORD [ebp] 562 mov ebx,DWORD [12+ebp] 563 test edi,15 564 jz NEAR L$035cfb_out_aligned 565 mov ecx,ebx 566 lea esi,[esp] 567 shr ecx,2 568db 243,165 569 sub edi,ebx 570L$035cfb_out_aligned: 571 mov esi,DWORD [4+ebp] 572 mov ecx,DWORD [8+ebp] 573 add edi,ebx 574 add esi,ebx 575 sub ecx,ebx 576 mov ebx,512 577 jnz NEAR L$033cfb_loop 578 cmp esp,ebp 579 je NEAR L$036cfb_done 580 pxor xmm0,xmm0 581 lea eax,[esp] 582L$037cfb_bzero: 583 movaps [eax],xmm0 584 lea eax,[16+eax] 585 cmp ebp,eax 586 ja NEAR L$037cfb_bzero 587L$036cfb_done: 588 mov ebp,DWORD [16+ebp] 589 lea esp,[24+ebp] 590 jmp NEAR L$038cfb_exit 591align 16 592L$032cfb_aligned: 593 lea eax,[edx-16] 594 lea ebx,[16+edx] 595 shr ecx,4 596db 243,15,167,224 597 movaps xmm0,[eax] 598 movaps [edx-16],xmm0 599L$038cfb_exit: 600 mov eax,1 601 lea esp,[4+esp] 602L$030cfb_abort: 603 pop edi 604 pop esi 605 pop ebx 606 pop ebp 607 ret 608global _padlock_ofb_encrypt 609align 16 610_padlock_ofb_encrypt: 611L$_padlock_ofb_encrypt_begin: 612 push ebp 613 push ebx 614 push esi 615 push edi 616 mov edi,DWORD [20+esp] 617 mov esi,DWORD [24+esp] 618 mov edx,DWORD [28+esp] 619 mov ecx,DWORD [32+esp] 620 test edx,15 621 jnz NEAR L$039ofb_abort 622 test ecx,15 623 jnz NEAR L$039ofb_abort 624 lea eax,[L$padlock_saved_context] 625 pushfd 626 cld 627 call __padlock_verify_ctx 628L$040ofb_pic_point: 629 lea edx,[16+edx] 630 xor eax,eax 631 xor ebx,ebx 632 test DWORD [edx],32 633 jnz NEAR L$041ofb_aligned 634 test edi,15 635 setz al 636 test esi,15 637 setz bl 638 test eax,ebx 639 jnz NEAR L$041ofb_aligned 640 neg eax 641 mov ebx,512 642 not eax 643 lea ebp,[esp-24] 644 cmp ecx,ebx 645 cmovc ebx,ecx 646 and eax,ebx 647 mov ebx,ecx 648 neg eax 649 and ebx,511 650 lea esp,[ebp*1+eax] 651 mov eax,512 652 cmovz ebx,eax 653 mov eax,ebp 654 and ebp,-16 655 and esp,-16 656 mov DWORD [16+ebp],eax 657 jmp NEAR L$042ofb_loop 658align 16 659L$042ofb_loop: 660 mov DWORD [ebp],edi 661 mov DWORD [4+ebp],esi 662 mov DWORD [8+ebp],ecx 663 mov ecx,ebx 664 mov DWORD [12+ebp],ebx 665 test edi,15 666 cmovnz edi,esp 667 test esi,15 668 jz NEAR L$043ofb_inp_aligned 669 shr ecx,2 670db 243,165 671 sub edi,ebx 672 mov ecx,ebx 673 mov esi,edi 674L$043ofb_inp_aligned: 675 lea eax,[edx-16] 676 lea ebx,[16+edx] 677 shr ecx,4 678db 243,15,167,232 679 movaps xmm0,[eax] 680 movaps [edx-16],xmm0 681 mov edi,DWORD [ebp] 682 mov ebx,DWORD [12+ebp] 683 test edi,15 684 jz NEAR L$044ofb_out_aligned 685 mov ecx,ebx 686 lea esi,[esp] 687 shr ecx,2 688db 243,165 689 sub edi,ebx 690L$044ofb_out_aligned: 691 mov esi,DWORD [4+ebp] 692 mov ecx,DWORD [8+ebp] 693 add edi,ebx 694 add esi,ebx 695 sub ecx,ebx 696 mov ebx,512 697 jnz NEAR L$042ofb_loop 698 cmp esp,ebp 699 je NEAR L$045ofb_done 700 pxor xmm0,xmm0 701 lea eax,[esp] 702L$046ofb_bzero: 703 movaps [eax],xmm0 704 lea eax,[16+eax] 705 cmp ebp,eax 706 ja NEAR L$046ofb_bzero 707L$045ofb_done: 708 mov ebp,DWORD [16+ebp] 709 lea esp,[24+ebp] 710 jmp NEAR L$047ofb_exit 711align 16 712L$041ofb_aligned: 713 lea eax,[edx-16] 714 lea ebx,[16+edx] 715 shr ecx,4 716db 243,15,167,232 717 movaps xmm0,[eax] 718 movaps [edx-16],xmm0 719L$047ofb_exit: 720 mov eax,1 721 lea esp,[4+esp] 722L$039ofb_abort: 723 pop edi 724 pop esi 725 pop ebx 726 pop ebp 727 ret 728global _padlock_ctr32_encrypt 729align 16 730_padlock_ctr32_encrypt: 731L$_padlock_ctr32_encrypt_begin: 732 push ebp 733 push ebx 734 push esi 735 push edi 736 mov edi,DWORD [20+esp] 737 mov esi,DWORD [24+esp] 738 mov edx,DWORD [28+esp] 739 mov ecx,DWORD [32+esp] 740 test edx,15 741 jnz NEAR L$048ctr32_abort 742 test ecx,15 743 jnz NEAR L$048ctr32_abort 744 lea eax,[L$padlock_saved_context] 745 pushfd 746 cld 747 call __padlock_verify_ctx 748L$049ctr32_pic_point: 749 lea edx,[16+edx] 750 xor eax,eax 751 movq mm0,[edx-16] 752 mov ebx,512 753 not eax 754 lea ebp,[esp-24] 755 cmp ecx,ebx 756 cmovc ebx,ecx 757 and eax,ebx 758 mov ebx,ecx 759 neg eax 760 and ebx,511 761 lea esp,[ebp*1+eax] 762 mov eax,512 763 cmovz ebx,eax 764 mov eax,ebp 765 and ebp,-16 766 and esp,-16 767 mov DWORD [16+ebp],eax 768 jmp NEAR L$050ctr32_loop 769align 16 770L$050ctr32_loop: 771 mov DWORD [ebp],edi 772 mov DWORD [4+ebp],esi 773 mov DWORD [8+ebp],ecx 774 mov ecx,ebx 775 mov DWORD [12+ebp],ebx 776 mov ecx,DWORD [edx-4] 777 xor edi,edi 778 mov eax,DWORD [edx-8] 779L$051ctr32_prepare: 780 mov DWORD [12+edi*1+esp],ecx 781 bswap ecx 782 movq [edi*1+esp],mm0 783 inc ecx 784 mov DWORD [8+edi*1+esp],eax 785 bswap ecx 786 lea edi,[16+edi] 787 cmp edi,ebx 788 jb NEAR L$051ctr32_prepare 789 mov DWORD [edx-4],ecx 790 lea esi,[esp] 791 lea edi,[esp] 792 mov ecx,ebx 793 lea eax,[edx-16] 794 lea ebx,[16+edx] 795 shr ecx,4 796db 243,15,167,200 797 mov edi,DWORD [ebp] 798 mov ebx,DWORD [12+ebp] 799 mov esi,DWORD [4+ebp] 800 xor ecx,ecx 801L$052ctr32_xor: 802 movups xmm1,[ecx*1+esi] 803 lea ecx,[16+ecx] 804 pxor xmm1,[ecx*1+esp-16] 805 movups [ecx*1+edi-16],xmm1 806 cmp ecx,ebx 807 jb NEAR L$052ctr32_xor 808 mov ecx,DWORD [8+ebp] 809 add edi,ebx 810 add esi,ebx 811 sub ecx,ebx 812 mov ebx,512 813 jnz NEAR L$050ctr32_loop 814 pxor xmm0,xmm0 815 lea eax,[esp] 816L$053ctr32_bzero: 817 movaps [eax],xmm0 818 lea eax,[16+eax] 819 cmp ebp,eax 820 ja NEAR L$053ctr32_bzero 821L$054ctr32_done: 822 mov ebp,DWORD [16+ebp] 823 lea esp,[24+ebp] 824 mov eax,1 825 lea esp,[4+esp] 826 emms 827L$048ctr32_abort: 828 pop edi 829 pop esi 830 pop ebx 831 pop ebp 832 ret 833global _padlock_xstore 834align 16 835_padlock_xstore: 836L$_padlock_xstore_begin: 837 push edi 838 mov edi,DWORD [8+esp] 839 mov edx,DWORD [12+esp] 840db 15,167,192 841 pop edi 842 ret 843align 16 844__win32_segv_handler: 845 mov eax,1 846 mov edx,DWORD [4+esp] 847 mov ecx,DWORD [12+esp] 848 cmp DWORD [edx],3221225477 849 jne NEAR L$055ret 850 add DWORD [184+ecx],4 851 mov eax,0 852L$055ret: 853 ret 854%if __NASM_VERSION_ID__ >= 0x02030000 855safeseh __win32_segv_handler 856%endif 857global _padlock_sha1_oneshot 858align 16 859_padlock_sha1_oneshot: 860L$_padlock_sha1_oneshot_begin: 861 push edi 862 push esi 863 xor eax,eax 864 mov edi,DWORD [12+esp] 865 mov esi,DWORD [16+esp] 866 mov ecx,DWORD [20+esp] 867 push __win32_segv_handler 868db 100,255,48 869db 100,137,32 870 mov edx,esp 871 add esp,-128 872 movups xmm0,[edi] 873 and esp,-16 874 mov eax,DWORD [16+edi] 875 movaps [esp],xmm0 876 mov edi,esp 877 mov DWORD [16+esp],eax 878 xor eax,eax 879db 243,15,166,200 880 movaps xmm0,[esp] 881 mov eax,DWORD [16+esp] 882 mov esp,edx 883db 100,143,5,0,0,0,0 884 lea esp,[4+esp] 885 mov edi,DWORD [16+esp] 886 movups [edi],xmm0 887 mov DWORD [16+edi],eax 888 pop esi 889 pop edi 890 ret 891global _padlock_sha1_blocks 892align 16 893_padlock_sha1_blocks: 894L$_padlock_sha1_blocks_begin: 895 push edi 896 push esi 897 mov edi,DWORD [12+esp] 898 mov esi,DWORD [16+esp] 899 mov edx,esp 900 mov ecx,DWORD [20+esp] 901 add esp,-128 902 movups xmm0,[edi] 903 and esp,-16 904 mov eax,DWORD [16+edi] 905 movaps [esp],xmm0 906 mov edi,esp 907 mov DWORD [16+esp],eax 908 mov eax,-1 909db 243,15,166,200 910 movaps xmm0,[esp] 911 mov eax,DWORD [16+esp] 912 mov esp,edx 913 mov edi,DWORD [12+esp] 914 movups [edi],xmm0 915 mov DWORD [16+edi],eax 916 pop esi 917 pop edi 918 ret 919global _padlock_sha256_oneshot 920align 16 921_padlock_sha256_oneshot: 922L$_padlock_sha256_oneshot_begin: 923 push edi 924 push esi 925 xor eax,eax 926 mov edi,DWORD [12+esp] 927 mov esi,DWORD [16+esp] 928 mov ecx,DWORD [20+esp] 929 push __win32_segv_handler 930db 100,255,48 931db 100,137,32 932 mov edx,esp 933 add esp,-128 934 movups xmm0,[edi] 935 and esp,-16 936 movups xmm1,[16+edi] 937 movaps [esp],xmm0 938 mov edi,esp 939 movaps [16+esp],xmm1 940 xor eax,eax 941db 243,15,166,208 942 movaps xmm0,[esp] 943 movaps xmm1,[16+esp] 944 mov esp,edx 945db 100,143,5,0,0,0,0 946 lea esp,[4+esp] 947 mov edi,DWORD [16+esp] 948 movups [edi],xmm0 949 movups [16+edi],xmm1 950 pop esi 951 pop edi 952 ret 953global _padlock_sha256_blocks 954align 16 955_padlock_sha256_blocks: 956L$_padlock_sha256_blocks_begin: 957 push edi 958 push esi 959 mov edi,DWORD [12+esp] 960 mov esi,DWORD [16+esp] 961 mov ecx,DWORD [20+esp] 962 mov edx,esp 963 add esp,-128 964 movups xmm0,[edi] 965 and esp,-16 966 movups xmm1,[16+edi] 967 movaps [esp],xmm0 968 mov edi,esp 969 movaps [16+esp],xmm1 970 mov eax,-1 971db 243,15,166,208 972 movaps xmm0,[esp] 973 movaps xmm1,[16+esp] 974 mov esp,edx 975 mov edi,DWORD [12+esp] 976 movups [edi],xmm0 977 movups [16+edi],xmm1 978 pop esi 979 pop edi 980 ret 981global _padlock_sha512_blocks 982align 16 983_padlock_sha512_blocks: 984L$_padlock_sha512_blocks_begin: 985 push edi 986 push esi 987 mov edi,DWORD [12+esp] 988 mov esi,DWORD [16+esp] 989 mov ecx,DWORD [20+esp] 990 mov edx,esp 991 add esp,-128 992 movups xmm0,[edi] 993 and esp,-16 994 movups xmm1,[16+edi] 995 movups xmm2,[32+edi] 996 movups xmm3,[48+edi] 997 movaps [esp],xmm0 998 mov edi,esp 999 movaps [16+esp],xmm1 1000 movaps [32+esp],xmm2 1001 movaps [48+esp],xmm3 1002db 243,15,166,224 1003 movaps xmm0,[esp] 1004 movaps xmm1,[16+esp] 1005 movaps xmm2,[32+esp] 1006 movaps xmm3,[48+esp] 1007 mov esp,edx 1008 mov edi,DWORD [12+esp] 1009 movups [edi],xmm0 1010 movups [16+edi],xmm1 1011 movups [32+edi],xmm2 1012 movups [48+edi],xmm3 1013 pop esi 1014 pop edi 1015 ret 1016db 86,73,65,32,80,97,100,108,111,99,107,32,120,56,54,32 1017db 109,111,100,117,108,101,44,32,67,82,89,80,84,79,71,65 1018db 77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101 1019db 110,115,115,108,46,111,114,103,62,0 1020align 16 1021section .data align=4 1022align 4 1023L$padlock_saved_context: 1024dd 0 1025