1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27/* 28 * Unified version for both position independent and non position independent 29 * for both v8plus and v9 30 * compile with: 31 * 32 * cc -c -xarch=v8plus des_crypt_asm.s or 33 * cc -c -arch=v9 des_crypt_asm.s 34 * for kernel use (no -KPIC) 35 * 36 * and with 37 * 38 * cc -c -xarch=v8plus -KPIC -DPIC des_crypt_asm.s or 39 * cc -c -arch=v9 -KPIC -DPIC des_crypt_asm.s 40 * for .so use 41 * 42 * The tables were generated by a C program, compiled into the C version 43 * of this function, from which a .s was generated by the C compiler and 44 * that .s was used as a starting point for this one, in particular for 45 * the data definitions. It is important, though that the tables and 46 * the code both remain in the text section and in this order, otherwise, 47 * at least on UltraSparc-II processors, collisions in the E-cache are 48 * highly probable between the code and the data it is using which can 49 * result in up to 40% performance loss 50 * 51 * For a description of the DES algithm, see NIST publication FIPS PUB 46-3 52 * 53 * In this implementation, the 16 rounds of DES are carried out by unrolling 54 * a loop that computes two rounds. For those 2 rounds, the two parts of 55 * the intermediate variable (L and R in the FIPS pub) are kept in their 56 * extended forms (i.e. in the one after applying the transformation E), 57 * with the appropriate bits repeated so that bits needed for the S-box 58 * lookups are in consecutive positions. So the bits of the L (or R) 59 * variable appear in the following order (X represents a bit that is not 60 * from L (R), these bits are always 0): 61 * 32 1 2 3 4 5 X X X X X X X X 4 5 62 * 6 7 8 9 8 9 10 11 12 13 12 13 14 15 16 17 63 * 16 17 18 19 20 21 X X X X X 20 21 22 23 24 64 * 25 24 25 26 27 28 29 28 29 30 31 32 1 X X X 65 * This arrangement makes it possible that 3 of the 8 S-box indices 66 * can be extracted by a single instruction: srlx by 55 for the S1 index, 67 * srl by 23 for the S5 index and and by 0x1f80 for the S8 index. The rest 68 * of the indices requires two operations, a shift and an and. 69 * The tables for the S-boxes are computed in such a way that when or-ed 70 * together, they give the result of the S-box, P and E computations. 71 * Also, the key schedule bits are computed to follow this bit-scheme. 72 * The initial permutation tables are also computed to produce this 73 * bit distribution and the final permutation works from these, too. 74 * 75 * The end of each round is overlapped with the beginning of the next 76 * one since after the first 6 S-box lookups all the bits necessary 77 * for one S-box lookup in the next round can be computed (by xor-ing 78 * the next key schedule item to the partially computed next R). 79 */ 80 81#if defined(lint) || defined(__lint) 82 /* LINTED */ 83 /* Nothing to be linted in this file, its pure assembly source */ 84#else /* lint || __lint */ 85 86 .register %g2,#scratch 87 .register %g3,#scratch 88 89 .file "encrypt_asm.S" 90 91 .section ".text",#alloc 92 .align 32 93 94! 95! CONSTANT POOL 96! 97 98des_sbox_table: 99 .word 5121 100 .word 1073872896 101 .word 0 102 .word 0 103 .word 1 104 .word 1073741824 105 .word 5121 106 .word 1073872928 107 .word 5121 108 .word 1073741856 109 .word 1 110 .word 1073872928 111 .word 0 112 .word 32 113 .word 1 114 .word 1073741824 115 .word 0 116 .word 131072 117 .word 5121 118 .word 1073872896 119 .word 5121 120 .word 1073872928 121 .word 0 122 .word 131072 123 .word 5120 124 .word 131104 125 .word 5121 126 .word 1073741856 127 .word 5120 128 .word 0 129 .word 0 130 .word 32 131 .word 0 132 .word 131104 133 .word 5120 134 .word 131072 135 .word 5120 136 .word 131072 137 .word 1 138 .word 1073872896 139 .word 1 140 .word 1073872896 141 .word 5121 142 .word 1073741824 143 .word 5121 144 .word 1073741824 145 .word 5120 146 .word 131104 147 .word 1 148 .word 1073741856 149 .word 5120 150 .word 32 151 .word 5120 152 .word 32 153 .word 1 154 .word 1073741856 155 .word 0 156 .word 0 157 .word 0 158 .word 131104 159 .word 1 160 .word 1073872928 161 .word 5120 162 .word 0 163 .word 1 164 .word 1073741824 165 .word 5121 166 .word 1073872928 167 .word 0 168 .word 32 169 .word 5121 170 .word 1073741824 171 .word 5121 172 .word 1073872896 173 .word 5120 174 .word 0 175 .word 5120 176 .word 0 177 .word 0 178 .word 131072 179 .word 5121 180 .word 1073741856 181 .word 1 182 .word 1073741824 183 .word 1 184 .word 1073872896 185 .word 5120 186 .word 32 187 .word 0 188 .word 131072 189 .word 0 190 .word 32 191 .word 5120 192 .word 131104 193 .word 1 194 .word 1073872928 195 .word 5121 196 .word 1073872928 197 .word 1 198 .word 1073741856 199 .word 5121 200 .word 1073741824 201 .word 5120 202 .word 131104 203 .word 5120 204 .word 32 205 .word 0 206 .word 131104 207 .word 1 208 .word 1073872928 209 .word 5121 210 .word 1073872896 211 .word 0 212 .word 131104 213 .word 5120 214 .word 131072 215 .word 5120 216 .word 131072 217 .word 0 218 .word 0 219 .word 1 220 .word 1073741856 221 .word 1 222 .word 1073872896 223 .word 0 224 .word 0 225 .word 5121 226 .word 1073741856 227 .word 536870992 228 .word 536872192 229 .word 536870912 230 .word 536870912 231 .word 0 232 .word 536870912 233 .word 80 234 .word 536872192 235 .word 80 236 .word 0 237 .word 0 238 .word 1280 239 .word 536870992 240 .word 1280 241 .word 536870912 242 .word 536872192 243 .word 536870912 244 .word 1280 245 .word 536870992 246 .word 536872192 247 .word 536870992 248 .word 536870912 249 .word 536870912 250 .word 0 251 .word 536870912 252 .word 536870912 253 .word 80 254 .word 0 255 .word 0 256 .word 1280 257 .word 536870992 258 .word 1280 259 .word 80 260 .word 536870912 261 .word 80 262 .word 1280 263 .word 536870912 264 .word 536872192 265 .word 0 266 .word 0 267 .word 536870912 268 .word 0 269 .word 0 270 .word 536870912 271 .word 80 272 .word 536872192 273 .word 536870992 274 .word 0 275 .word 80 276 .word 1280 277 .word 536870912 278 .word 1280 279 .word 0 280 .word 0 281 .word 80 282 .word 536870912 283 .word 0 284 .word 536872192 285 .word 536870992 286 .word 536870912 287 .word 536870992 288 .word 0 289 .word 0 290 .word 536872192 291 .word 0 292 .word 0 293 .word 80 294 .word 536872192 295 .word 536870992 296 .word 1280 297 .word 80 298 .word 0 299 .word 536870912 300 .word 536872192 301 .word 536870992 302 .word 0 303 .word 536870992 304 .word 536870912 305 .word 0 306 .word 536870912 307 .word 536870992 308 .word 0 309 .word 536870912 310 .word 536870912 311 .word 0 312 .word 1280 313 .word 536870992 314 .word 536872192 315 .word 80 316 .word 536872192 317 .word 0 318 .word 1280 319 .word 0 320 .word 536870912 321 .word 536870912 322 .word 0 323 .word 0 324 .word 536872192 325 .word 536870992 326 .word 536870912 327 .word 80 328 .word 0 329 .word 536870912 330 .word 1280 331 .word 80 332 .word 1280 333 .word 536870912 334 .word 536872192 335 .word 536870912 336 .word 1280 337 .word 80 338 .word 1280 339 .word 80 340 .word 536870912 341 .word 0 342 .word 0 343 .word 536870912 344 .word 536870912 345 .word 0 346 .word 536872192 347 .word 536870912 348 .word 0 349 .word 536870992 350 .word 1280 351 .word 536870992 352 .word 536872192 353 .word 80 354 .word 536870912 355 .word 0 356 .word 81984 357 .word 32770 358 .word -2147401728 359 .word 0 360 .word 0 361 .word 32770 362 .word -2147483584 363 .word 32768 364 .word 81920 365 .word 0 366 .word 0 367 .word 2 368 .word -2147401664 369 .word 32768 370 .word 81920 371 .word 2 372 .word -2147483584 373 .word 32768 374 .word 64 375 .word 32768 376 .word 64 377 .word 2 378 .word -2147483648 379 .word 32770 380 .word -2147401664 381 .word 2 382 .word -2147483584 383 .word 32770 384 .word -2147483648 385 .word 0 386 .word 81984 387 .word 32768 388 .word 0 389 .word 0 390 .word 64 391 .word 32770 392 .word -2147401728 393 .word 0 394 .word 81920 395 .word 2 396 .word -2147401728 397 .word 32770 398 .word -2147483648 399 .word 32770 400 .word -2147483584 401 .word 2 402 .word -2147401664 403 .word 32768 404 .word 81984 405 .word 2 406 .word -2147401728 407 .word 2 408 .word -2147483648 409 .word 32768 410 .word 81984 411 .word 0 412 .word 64 413 .word 32770 414 .word -2147401664 415 .word 0 416 .word 81920 417 .word 32768 418 .word 0 419 .word 32770 420 .word -2147401728 421 .word 32768 422 .word 0 423 .word 2 424 .word -2147483584 425 .word 0 426 .word 81984 427 .word 2 428 .word -2147483648 429 .word 32770 430 .word -2147401728 431 .word 32768 432 .word 81920 433 .word 0 434 .word 0 435 .word 0 436 .word 81920 437 .word 2 438 .word -2147483584 439 .word 32770 440 .word -2147401664 441 .word 32768 442 .word 81920 443 .word 32768 444 .word 64 445 .word 0 446 .word 81920 447 .word 0 448 .word 0 449 .word 32770 450 .word -2147483584 451 .word 32768 452 .word 81984 453 .word 2 454 .word -2147483648 455 .word 32768 456 .word 0 457 .word 32770 458 .word -2147401664 459 .word 0 460 .word 64 461 .word 2 462 .word -2147401664 463 .word 2 464 .word -2147401728 465 .word 32768 466 .word 64 467 .word 32770 468 .word -2147483648 469 .word 32768 470 .word 81984 471 .word 0 472 .word 81984 473 .word 32770 474 .word -2147483648 475 .word 2 476 .word -2147401664 477 .word 0 478 .word 64 479 .word 32770 480 .word -2147483584 481 .word 2 482 .word -2147401728 483 .word 1073742336 484 .word 135266312 485 .word 1073741824 486 .word 135270408 487 .word 1073741824 488 .word 135270408 489 .word 0 490 .word 4096 491 .word 512 492 .word 135270400 493 .word 1073742336 494 .word 4104 495 .word 1073742336 496 .word 8 497 .word 1073741824 498 .word 135266312 499 .word 0 500 .word 0 501 .word 512 502 .word 135266304 503 .word 512 504 .word 135266304 505 .word 1073742336 506 .word 135270408 507 .word 1073741824 508 .word 4104 509 .word 0 510 .word 0 511 .word 512 512 .word 4096 513 .word 1073742336 514 .word 8 515 .word 1073741824 516 .word 8 517 .word 0 518 .word 135266304 519 .word 512 520 .word 0 521 .word 1073742336 522 .word 135266312 523 .word 0 524 .word 4096 525 .word 512 526 .word 0 527 .word 1073741824 528 .word 135266312 529 .word 0 530 .word 135270400 531 .word 1073742336 532 .word 4104 533 .word 1073741824 534 .word 8 535 .word 0 536 .word 135270400 537 .word 512 538 .word 4096 539 .word 0 540 .word 135266304 541 .word 512 542 .word 135270400 543 .word 1073742336 544 .word 135270408 545 .word 1073741824 546 .word 4104 547 .word 512 548 .word 4096 549 .word 1073742336 550 .word 8 551 .word 512 552 .word 135266304 553 .word 1073742336 554 .word 135270408 555 .word 1073741824 556 .word 4104 557 .word 0 558 .word 0 559 .word 0 560 .word 0 561 .word 512 562 .word 135266304 563 .word 0 564 .word 135270400 565 .word 512 566 .word 4096 567 .word 1073742336 568 .word 4104 569 .word 1073741824 570 .word 8 571 .word 1073742336 572 .word 135266312 573 .word 1073741824 574 .word 135270408 575 .word 1073741824 576 .word 135270408 577 .word 0 578 .word 4096 579 .word 1073742336 580 .word 135270408 581 .word 1073741824 582 .word 4104 583 .word 1073741824 584 .word 8 585 .word 0 586 .word 135266304 587 .word 1073742336 588 .word 8 589 .word 1073741824 590 .word 135266312 591 .word 512 592 .word 135270400 593 .word 1073742336 594 .word 4104 595 .word 1073741824 596 .word 135266312 597 .word 0 598 .word 135270400 599 .word 512 600 .word 0 601 .word 1073742336 602 .word 135266312 603 .word 0 604 .word 4096 605 .word 512 606 .word 0 607 .word 0 608 .word 135266304 609 .word 512 610 .word 135270400 611 .word 0 612 .word 40960 613 .word 10248 614 .word 40960 615 .word 10248 616 .word 0 617 .word 268445696 618 .word 40960 619 .word 8 620 .word 0 621 .word 0 622 .word 40960 623 .word 268435456 624 .word 0 625 .word 10248 626 .word 0 627 .word 268435464 628 .word 40960 629 .word 8 630 .word 0 631 .word 10240 632 .word 40960 633 .word 268435464 634 .word 40960 635 .word 268445696 636 .word 40960 637 .word 268445704 638 .word 0 639 .word 8 640 .word 40960 641 .word 268435456 642 .word 0 643 .word 10240 644 .word 0 645 .word 268435464 646 .word 0 647 .word 268435464 648 .word 0 649 .word 0 650 .word 0 651 .word 268435456 652 .word 40960 653 .word 268445704 654 .word 40960 655 .word 268445704 656 .word 40960 657 .word 10240 658 .word 40960 659 .word 268445704 660 .word 0 661 .word 268435456 662 .word 40960 663 .word 0 664 .word 0 665 .word 268445696 666 .word 0 667 .word 10248 668 .word 40960 669 .word 10240 670 .word 0 671 .word 268445696 672 .word 0 673 .word 8 674 .word 40960 675 .word 8 676 .word 0 677 .word 268445696 678 .word 40960 679 .word 0 680 .word 40960 681 .word 10240 682 .word 0 683 .word 268435456 684 .word 0 685 .word 10248 686 .word 0 687 .word 268445696 688 .word 40960 689 .word 268435464 690 .word 40960 691 .word 10240 692 .word 40960 693 .word 268435456 694 .word 0 695 .word 268445704 696 .word 0 697 .word 10248 698 .word 40960 699 .word 268435464 700 .word 40960 701 .word 0 702 .word 40960 703 .word 10240 704 .word 0 705 .word 268445704 706 .word 0 707 .word 268445704 708 .word 40960 709 .word 8 710 .word 40960 711 .word 268445696 712 .word 0 713 .word 268445704 714 .word 40960 715 .word 10248 716 .word 0 717 .word 0 718 .word 0 719 .word 268435464 720 .word 0 721 .word 268445696 722 .word 0 723 .word 8 724 .word 40960 725 .word 10240 726 .word 40960 727 .word 268435456 728 .word 40960 729 .word 8 730 .word 0 731 .word 0 732 .word 0 733 .word 268435464 734 .word 0 735 .word 10248 736 .word 40960 737 .word 268435456 738 .word 40960 739 .word 134348800 740 .word 640 741 .word 134349056 742 .word 0 743 .word 0 744 .word 268435456 745 .word 134349056 746 .word 268436096 747 .word 134349056 748 .word 0 749 .word 0 750 .word 640 751 .word 134349056 752 .word 268436096 753 .word 256 754 .word 0 755 .word 134348800 756 .word 268435456 757 .word 256 758 .word 268436096 759 .word 256 760 .word 0 761 .word 134348800 762 .word 640 763 .word 256 764 .word 640 765 .word 134348800 766 .word 268435456 767 .word 134348800 768 .word 0 769 .word 0 770 .word 268436096 771 .word 0 772 .word 0 773 .word 256 774 .word 640 775 .word 134348800 776 .word 268436096 777 .word 0 778 .word 268435456 779 .word 256 780 .word 268435456 781 .word 134348800 782 .word 268436096 783 .word 0 784 .word 640 785 .word 134349056 786 .word 640 787 .word 134349056 788 .word 640 789 .word 0 790 .word 0 791 .word 256 792 .word 268436096 793 .word 134349056 794 .word 268435456 795 .word 0 796 .word 268436096 797 .word 256 798 .word 268435456 799 .word 134349056 800 .word 268435456 801 .word 134348800 802 .word 0 803 .word 134348800 804 .word 268435456 805 .word 0 806 .word 640 807 .word 134349056 808 .word 640 809 .word 256 810 .word 268435456 811 .word 134349056 812 .word 268436096 813 .word 256 814 .word 0 815 .word 0 816 .word 268436096 817 .word 134348800 818 .word 640 819 .word 256 820 .word 0 821 .word 134348800 822 .word 268435456 823 .word 134348800 824 .word 0 825 .word 0 826 .word 268436096 827 .word 134348800 828 .word 640 829 .word 134349056 830 .word 268436096 831 .word 256 832 .word 268435456 833 .word 134349056 834 .word 0 835 .word 256 836 .word 268436096 837 .word 134349056 838 .word 268435456 839 .word 0 840 .word 0 841 .word 134349056 842 .word 640 843 .word 0 844 .word 640 845 .word 0 846 .word 268435456 847 .word 134349056 848 .word 0 849 .word 256 850 .word 268436096 851 .word 0 852 .word 268435456 853 .word 256 854 .word 640 855 .word 134348800 856 .word 268436096 857 .word 0 858 .word 0 859 .word 134349056 860 .word 268435456 861 .word 134348800 862 .word 0 863 .word 256 864 .word 640 865 .word 134348800 866 .word 268436096 867 .word 160 868 .word 0 869 .word -2147467104 870 .word 16 871 .word -2147467264 872 .word 262160 873 .word 0 874 .word 0 875 .word 0 876 .word 262144 877 .word -2147467264 878 .word 262160 879 .word -2147483488 880 .word 262160 881 .word 16544 882 .word 262144 883 .word -2147467104 884 .word 262160 885 .word 160 886 .word 0 887 .word 0 888 .word 0 889 .word -2147467264 890 .word 16 891 .word -2147483648 892 .word 16 893 .word 16384 894 .word 0 895 .word -2147467104 896 .word 16 897 .word -2147483648 898 .word 262160 899 .word 16384 900 .word 262144 901 .word -2147483488 902 .word 262160 903 .word -2147483488 904 .word 16 905 .word 16384 906 .word 262144 907 .word -2147467264 908 .word 16 909 .word 16544 910 .word 0 911 .word 16544 912 .word 262144 913 .word -2147483488 914 .word 16 915 .word 16544 916 .word 0 917 .word 0 918 .word 262144 919 .word -2147483648 920 .word 262160 921 .word -2147467104 922 .word 262160 923 .word 160 924 .word 262144 925 .word -2147483648 926 .word 16 927 .word 16384 928 .word 0 929 .word 160 930 .word 262144 931 .word 16384 932 .word 0 933 .word 160 934 .word 262144 935 .word 160 936 .word 0 937 .word -2147467264 938 .word 262160 939 .word -2147467264 940 .word 262160 941 .word -2147467104 942 .word 16 943 .word -2147467104 944 .word 16 945 .word -2147483648 946 .word 16 947 .word -2147483488 948 .word 16 949 .word 16384 950 .word 0 951 .word 16384 952 .word 262144 953 .word 160 954 .word 0 955 .word 16544 956 .word 262144 957 .word -2147483648 958 .word 262160 959 .word -2147483488 960 .word 262160 961 .word 16544 962 .word 262144 963 .word -2147483648 964 .word 262160 965 .word -2147467264 966 .word 16 967 .word -2147467104 968 .word 262160 969 .word 16544 970 .word 0 971 .word 160 972 .word 262144 973 .word 0 974 .word 0 975 .word -2147483648 976 .word 16 977 .word -2147467104 978 .word 262160 979 .word 0 980 .word 0 981 .word -2147483488 982 .word 262160 983 .word 16544 984 .word 0 985 .word 0 986 .word 262144 987 .word -2147467264 988 .word 16 989 .word 16384 990 .word 262144 991 .word 0 992 .word 262144 993 .word -2147483488 994 .word 16 995 .word 67174400 996 .word 67635200 997 .word 0 998 .word 67633152 999 .word 4 1000 .word 0 1001 .word 67174404 1002 .word 67635200 1003 .word 67174400 1004 .word 0 1005 .word 67174400 1006 .word 67635200 1007 .word 0 1008 .word 2048 1009 .word 67174400 1010 .word 0 1011 .word 4 1012 .word 2048 1013 .word 67174404 1014 .word 0 1015 .word 67174404 1016 .word 67635200 1017 .word 4 1018 .word 67633152 1019 .word 67174404 1020 .word 67633152 1021 .word 4 1022 .word 67635200 1023 .word 0 1024 .word 67633152 1025 .word 0 1026 .word 2048 1027 .word 67174404 1028 .word 0 1029 .word 67174400 1030 .word 2048 1031 .word 67174400 1032 .word 67633152 1033 .word 0 1034 .word 67635200 1035 .word 4 1036 .word 67633152 1037 .word 4 1038 .word 2048 1039 .word 67174404 1040 .word 2048 1041 .word 67174404 1042 .word 67633152 1043 .word 0 1044 .word 67635200 1045 .word 0 1046 .word 0 1047 .word 0 1048 .word 0 1049 .word 67174404 1050 .word 2048 1051 .word 67174400 1052 .word 2048 1053 .word 67174400 1054 .word 67633152 1055 .word 4 1056 .word 67635200 1057 .word 4 1058 .word 0 1059 .word 4 1060 .word 67635200 1061 .word 4 1062 .word 0 1063 .word 67174404 1064 .word 67633152 1065 .word 0 1066 .word 67633152 1067 .word 0 1068 .word 2048 1069 .word 67174404 1070 .word 2048 1071 .word 0 1072 .word 67633152 1073 .word 4 1074 .word 67635200 1075 .word 67174400 1076 .word 67633152 1077 .word 0 1078 .word 2048 1079 .word 67174400 1080 .word 2048 1081 .word 67174404 1082 .word 0 1083 .word 67174404 1084 .word 2048 1085 .word 67174400 1086 .word 0 1087 .word 4 1088 .word 0 1089 .word 67174400 1090 .word 67635200 1091 .word 0 1092 .word 0 1093 .word 67174404 1094 .word 67635200 1095 .word 4 1096 .word 2048 1097 .word 67174400 1098 .word 2048 1099 .word 67174404 1100 .word 0 1101 .word 67174400 1102 .word 67633152 1103 .word 67174400 1104 .word 67635200 1105 .word 0 1106 .word 0 1107 .word 67174404 1108 .word 67635200 1109 .word 4 1110 .word 67633152 1111 .word 4 1112 .word 67633152 1113 .word 0 1114 .word 67635200 1115 .word 0 1116 .word 67635200 1117 .word 4 1118 .word 2048 1119 .word 67174400 1120 .word 0 1121 .word 67174404 1122 .word 67633152 1123 .type des_sbox_table,#object 1124 .size des_sbox_table,4096 1125 1126 .align 32 1127! 1128! CONSTANT POOL 1129! 1130 .section ".text",#alloc,#execinstr 1131 1132des_ip_table: 1133 .word 0 1134 .word 0 1135 .word 0 1136 .word 1024 1137 .word 8388608 1138 .word 640 1139 .word 8388608 1140 .word 1664 1141 .word 0 1142 .word 4194304 1143 .word 0 1144 .word 4195328 1145 .word 8388608 1146 .word 4194944 1147 .word 8388608 1148 .word 4195968 1149 .word 0 1150 .word 2621440 1151 .word 0 1152 .word 2622464 1153 .word 8388608 1154 .word 2622080 1155 .word 8388608 1156 .word 2623104 1157 .word 0 1158 .word 6815744 1159 .word 0 1160 .word 6816768 1161 .word 8388608 1162 .word 6816384 1163 .word 8388608 1164 .word 6817408 1165 .word 4 1166 .word 0 1167 .word 4 1168 .word 1024 1169 .word 8388612 1170 .word 640 1171 .word 8388612 1172 .word 1664 1173 .word 4 1174 .word 4194304 1175 .word 4 1176 .word 4195328 1177 .word 8388612 1178 .word 4194944 1179 .word 8388612 1180 .word 4195968 1181 .word 4 1182 .word 2621440 1183 .word 4 1184 .word 2622464 1185 .word 8388612 1186 .word 2622080 1187 .word 8388612 1188 .word 2623104 1189 .word 4 1190 .word 6815744 1191 .word 4 1192 .word 6816768 1193 .word 8388612 1194 .word 6816384 1195 .word 8388612 1196 .word 6817408 1197 .word 2 1198 .word -2147483648 1199 .word 2 1200 .word -2147482624 1201 .word 8388610 1202 .word -2147483008 1203 .word 8388610 1204 .word -2147481984 1205 .word 2 1206 .word -2143289344 1207 .word 2 1208 .word -2143288320 1209 .word 8388610 1210 .word -2143288704 1211 .word 8388610 1212 .word -2143287680 1213 .word 2 1214 .word -2144862208 1215 .word 2 1216 .word -2144861184 1217 .word 8388610 1218 .word -2144861568 1219 .word 8388610 1220 .word -2144860544 1221 .word 2 1222 .word -2140667904 1223 .word 2 1224 .word -2140666880 1225 .word 8388610 1226 .word -2140667264 1227 .word 8388610 1228 .word -2140666240 1229 .word 6 1230 .word -2147483648 1231 .word 6 1232 .word -2147482624 1233 .word 8388614 1234 .word -2147483008 1235 .word 8388614 1236 .word -2147481984 1237 .word 6 1238 .word -2143289344 1239 .word 6 1240 .word -2143288320 1241 .word 8388614 1242 .word -2143288704 1243 .word 8388614 1244 .word -2143287680 1245 .word 6 1246 .word -2144862208 1247 .word 6 1248 .word -2144861184 1249 .word 8388614 1250 .word -2144861568 1251 .word 8388614 1252 .word -2144860544 1253 .word 6 1254 .word -2140667904 1255 .word 6 1256 .word -2140666880 1257 .word 8388614 1258 .word -2140667264 1259 .word 8388614 1260 .word -2140666240 1261 .word 16384 1262 .word 0 1263 .word 16384 1264 .word 1024 1265 .word 8404992 1266 .word 640 1267 .word 8404992 1268 .word 1664 1269 .word 16384 1270 .word 4194304 1271 .word 16384 1272 .word 4195328 1273 .word 8404992 1274 .word 4194944 1275 .word 8404992 1276 .word 4195968 1277 .word 16384 1278 .word 2621440 1279 .word 16384 1280 .word 2622464 1281 .word 8404992 1282 .word 2622080 1283 .word 8404992 1284 .word 2623104 1285 .word 16384 1286 .word 6815744 1287 .word 16384 1288 .word 6816768 1289 .word 8404992 1290 .word 6816384 1291 .word 8404992 1292 .word 6817408 1293 .word 16388 1294 .word 0 1295 .word 16388 1296 .word 1024 1297 .word 8404996 1298 .word 640 1299 .word 8404996 1300 .word 1664 1301 .word 16388 1302 .word 4194304 1303 .word 16388 1304 .word 4195328 1305 .word 8404996 1306 .word 4194944 1307 .word 8404996 1308 .word 4195968 1309 .word 16388 1310 .word 2621440 1311 .word 16388 1312 .word 2622464 1313 .word 8404996 1314 .word 2622080 1315 .word 8404996 1316 .word 2623104 1317 .word 16388 1318 .word 6815744 1319 .word 16388 1320 .word 6816768 1321 .word 8404996 1322 .word 6816384 1323 .word 8404996 1324 .word 6817408 1325 .word 16386 1326 .word -2147483648 1327 .word 16386 1328 .word -2147482624 1329 .word 8404994 1330 .word -2147483008 1331 .word 8404994 1332 .word -2147481984 1333 .word 16386 1334 .word -2143289344 1335 .word 16386 1336 .word -2143288320 1337 .word 8404994 1338 .word -2143288704 1339 .word 8404994 1340 .word -2143287680 1341 .word 16386 1342 .word -2144862208 1343 .word 16386 1344 .word -2144861184 1345 .word 8404994 1346 .word -2144861568 1347 .word 8404994 1348 .word -2144860544 1349 .word 16386 1350 .word -2140667904 1351 .word 16386 1352 .word -2140666880 1353 .word 8404994 1354 .word -2140667264 1355 .word 8404994 1356 .word -2140666240 1357 .word 16390 1358 .word -2147483648 1359 .word 16390 1360 .word -2147482624 1361 .word 8404998 1362 .word -2147483008 1363 .word 8404998 1364 .word -2147481984 1365 .word 16390 1366 .word -2143289344 1367 .word 16390 1368 .word -2143288320 1369 .word 8404998 1370 .word -2143288704 1371 .word 8404998 1372 .word -2143287680 1373 .word 16390 1374 .word -2144862208 1375 .word 16390 1376 .word -2144861184 1377 .word 8404998 1378 .word -2144861568 1379 .word 8404998 1380 .word -2144860544 1381 .word 16390 1382 .word -2140667904 1383 .word 16390 1384 .word -2140666880 1385 .word 8404998 1386 .word -2140667264 1387 .word 8404998 1388 .word -2140666240 1389 .word 10240 1390 .word 0 1391 .word 10240 1392 .word 1024 1393 .word 8398848 1394 .word 640 1395 .word 8398848 1396 .word 1664 1397 .word 10240 1398 .word 4194304 1399 .word 10240 1400 .word 4195328 1401 .word 8398848 1402 .word 4194944 1403 .word 8398848 1404 .word 4195968 1405 .word 10240 1406 .word 2621440 1407 .word 10240 1408 .word 2622464 1409 .word 8398848 1410 .word 2622080 1411 .word 8398848 1412 .word 2623104 1413 .word 10240 1414 .word 6815744 1415 .word 10240 1416 .word 6816768 1417 .word 8398848 1418 .word 6816384 1419 .word 8398848 1420 .word 6817408 1421 .word 10244 1422 .word 0 1423 .word 10244 1424 .word 1024 1425 .word 8398852 1426 .word 640 1427 .word 8398852 1428 .word 1664 1429 .word 10244 1430 .word 4194304 1431 .word 10244 1432 .word 4195328 1433 .word 8398852 1434 .word 4194944 1435 .word 8398852 1436 .word 4195968 1437 .word 10244 1438 .word 2621440 1439 .word 10244 1440 .word 2622464 1441 .word 8398852 1442 .word 2622080 1443 .word 8398852 1444 .word 2623104 1445 .word 10244 1446 .word 6815744 1447 .word 10244 1448 .word 6816768 1449 .word 8398852 1450 .word 6816384 1451 .word 8398852 1452 .word 6817408 1453 .word 10242 1454 .word -2147483648 1455 .word 10242 1456 .word -2147482624 1457 .word 8398850 1458 .word -2147483008 1459 .word 8398850 1460 .word -2147481984 1461 .word 10242 1462 .word -2143289344 1463 .word 10242 1464 .word -2143288320 1465 .word 8398850 1466 .word -2143288704 1467 .word 8398850 1468 .word -2143287680 1469 .word 10242 1470 .word -2144862208 1471 .word 10242 1472 .word -2144861184 1473 .word 8398850 1474 .word -2144861568 1475 .word 8398850 1476 .word -2144860544 1477 .word 10242 1478 .word -2140667904 1479 .word 10242 1480 .word -2140666880 1481 .word 8398850 1482 .word -2140667264 1483 .word 8398850 1484 .word -2140666240 1485 .word 10246 1486 .word -2147483648 1487 .word 10246 1488 .word -2147482624 1489 .word 8398854 1490 .word -2147483008 1491 .word 8398854 1492 .word -2147481984 1493 .word 10246 1494 .word -2143289344 1495 .word 10246 1496 .word -2143288320 1497 .word 8398854 1498 .word -2143288704 1499 .word 8398854 1500 .word -2143287680 1501 .word 10246 1502 .word -2144862208 1503 .word 10246 1504 .word -2144861184 1505 .word 8398854 1506 .word -2144861568 1507 .word 8398854 1508 .word -2144860544 1509 .word 10246 1510 .word -2140667904 1511 .word 10246 1512 .word -2140666880 1513 .word 8398854 1514 .word -2140667264 1515 .word 8398854 1516 .word -2140666240 1517 .word 26624 1518 .word 0 1519 .word 26624 1520 .word 1024 1521 .word 8415232 1522 .word 640 1523 .word 8415232 1524 .word 1664 1525 .word 26624 1526 .word 4194304 1527 .word 26624 1528 .word 4195328 1529 .word 8415232 1530 .word 4194944 1531 .word 8415232 1532 .word 4195968 1533 .word 26624 1534 .word 2621440 1535 .word 26624 1536 .word 2622464 1537 .word 8415232 1538 .word 2622080 1539 .word 8415232 1540 .word 2623104 1541 .word 26624 1542 .word 6815744 1543 .word 26624 1544 .word 6816768 1545 .word 8415232 1546 .word 6816384 1547 .word 8415232 1548 .word 6817408 1549 .word 26628 1550 .word 0 1551 .word 26628 1552 .word 1024 1553 .word 8415236 1554 .word 640 1555 .word 8415236 1556 .word 1664 1557 .word 26628 1558 .word 4194304 1559 .word 26628 1560 .word 4195328 1561 .word 8415236 1562 .word 4194944 1563 .word 8415236 1564 .word 4195968 1565 .word 26628 1566 .word 2621440 1567 .word 26628 1568 .word 2622464 1569 .word 8415236 1570 .word 2622080 1571 .word 8415236 1572 .word 2623104 1573 .word 26628 1574 .word 6815744 1575 .word 26628 1576 .word 6816768 1577 .word 8415236 1578 .word 6816384 1579 .word 8415236 1580 .word 6817408 1581 .word 26626 1582 .word -2147483648 1583 .word 26626 1584 .word -2147482624 1585 .word 8415234 1586 .word -2147483008 1587 .word 8415234 1588 .word -2147481984 1589 .word 26626 1590 .word -2143289344 1591 .word 26626 1592 .word -2143288320 1593 .word 8415234 1594 .word -2143288704 1595 .word 8415234 1596 .word -2143287680 1597 .word 26626 1598 .word -2144862208 1599 .word 26626 1600 .word -2144861184 1601 .word 8415234 1602 .word -2144861568 1603 .word 8415234 1604 .word -2144860544 1605 .word 26626 1606 .word -2140667904 1607 .word 26626 1608 .word -2140666880 1609 .word 8415234 1610 .word -2140667264 1611 .word 8415234 1612 .word -2140666240 1613 .word 26630 1614 .word -2147483648 1615 .word 26630 1616 .word -2147482624 1617 .word 8415238 1618 .word -2147483008 1619 .word 8415238 1620 .word -2147481984 1621 .word 26630 1622 .word -2143289344 1623 .word 26630 1624 .word -2143288320 1625 .word 8415238 1626 .word -2143288704 1627 .word 8415238 1628 .word -2143287680 1629 .word 26630 1630 .word -2144862208 1631 .word 26630 1632 .word -2144861184 1633 .word 8415238 1634 .word -2144861568 1635 .word 8415238 1636 .word -2144860544 1637 .word 26630 1638 .word -2140667904 1639 .word 26630 1640 .word -2140666880 1641 .word 8415238 1642 .word -2140667264 1643 .word 8415238 1644 .word -2140666240 1645 .word 0 1646 .word 0 1647 .word 0 1648 .word 20480 1649 .word 0 1650 .word 2048 1651 .word 0 1652 .word 22528 1653 .word 0 1654 .word 83886080 1655 .word 0 1656 .word 83906560 1657 .word 0 1658 .word 83888128 1659 .word 0 1660 .word 83908608 1661 .word 0 1662 .word 8388608 1663 .word 0 1664 .word 8409088 1665 .word 0 1666 .word 8390656 1667 .word 0 1668 .word 8411136 1669 .word 0 1670 .word 92274688 1671 .word 0 1672 .word 92295168 1673 .word 0 1674 .word 92276736 1675 .word 0 1676 .word 92297216 1677 .word 80 1678 .word 0 1679 .word 80 1680 .word 20480 1681 .word 80 1682 .word 2048 1683 .word 80 1684 .word 22528 1685 .word 80 1686 .word 83886080 1687 .word 80 1688 .word 83906560 1689 .word 80 1690 .word 83888128 1691 .word 80 1692 .word 83908608 1693 .word 80 1694 .word 8388608 1695 .word 80 1696 .word 8409088 1697 .word 80 1698 .word 8390656 1699 .word 80 1700 .word 8411136 1701 .word 80 1702 .word 92274688 1703 .word 80 1704 .word 92295168 1705 .word 80 1706 .word 92276736 1707 .word 80 1708 .word 92297216 1709 .word 8 1710 .word 0 1711 .word 8 1712 .word 20480 1713 .word 8 1714 .word 2048 1715 .word 8 1716 .word 22528 1717 .word 8 1718 .word 83886080 1719 .word 8 1720 .word 83906560 1721 .word 8 1722 .word 83888128 1723 .word 8 1724 .word 83908608 1725 .word 8 1726 .word 8388608 1727 .word 8 1728 .word 8409088 1729 .word 8 1730 .word 8390656 1731 .word 8 1732 .word 8411136 1733 .word 8 1734 .word 92274688 1735 .word 8 1736 .word 92295168 1737 .word 8 1738 .word 92276736 1739 .word 8 1740 .word 92297216 1741 .word 88 1742 .word 0 1743 .word 88 1744 .word 20480 1745 .word 88 1746 .word 2048 1747 .word 88 1748 .word 22528 1749 .word 88 1750 .word 83886080 1751 .word 88 1752 .word 83906560 1753 .word 88 1754 .word 83888128 1755 .word 88 1756 .word 83908608 1757 .word 88 1758 .word 8388608 1759 .word 88 1760 .word 8409088 1761 .word 88 1762 .word 8390656 1763 .word 88 1764 .word 8411136 1765 .word 88 1766 .word 92274688 1767 .word 88 1768 .word 92295168 1769 .word 88 1770 .word 92276736 1771 .word 88 1772 .word 92297216 1773 .word 327680 1774 .word 4 1775 .word 327680 1776 .word 20484 1777 .word 327680 1778 .word 2052 1779 .word 327680 1780 .word 22532 1781 .word 327680 1782 .word 83886084 1783 .word 327680 1784 .word 83906564 1785 .word 327680 1786 .word 83888132 1787 .word 327680 1788 .word 83908612 1789 .word 327680 1790 .word 8388612 1791 .word 327680 1792 .word 8409092 1793 .word 327680 1794 .word 8390660 1795 .word 327680 1796 .word 8411140 1797 .word 327680 1798 .word 92274692 1799 .word 327680 1800 .word 92295172 1801 .word 327680 1802 .word 92276740 1803 .word 327680 1804 .word 92297220 1805 .word 327760 1806 .word 4 1807 .word 327760 1808 .word 20484 1809 .word 327760 1810 .word 2052 1811 .word 327760 1812 .word 22532 1813 .word 327760 1814 .word 83886084 1815 .word 327760 1816 .word 83906564 1817 .word 327760 1818 .word 83888132 1819 .word 327760 1820 .word 83908612 1821 .word 327760 1822 .word 8388612 1823 .word 327760 1824 .word 8409092 1825 .word 327760 1826 .word 8390660 1827 .word 327760 1828 .word 8411140 1829 .word 327760 1830 .word 92274692 1831 .word 327760 1832 .word 92295172 1833 .word 327760 1834 .word 92276740 1835 .word 327760 1836 .word 92297220 1837 .word 327688 1838 .word 4 1839 .word 327688 1840 .word 20484 1841 .word 327688 1842 .word 2052 1843 .word 327688 1844 .word 22532 1845 .word 327688 1846 .word 83886084 1847 .word 327688 1848 .word 83906564 1849 .word 327688 1850 .word 83888132 1851 .word 327688 1852 .word 83908612 1853 .word 327688 1854 .word 8388612 1855 .word 327688 1856 .word 8409092 1857 .word 327688 1858 .word 8390660 1859 .word 327688 1860 .word 8411140 1861 .word 327688 1862 .word 92274692 1863 .word 327688 1864 .word 92295172 1865 .word 327688 1866 .word 92276740 1867 .word 327688 1868 .word 92297220 1869 .word 327768 1870 .word 4 1871 .word 327768 1872 .word 20484 1873 .word 327768 1874 .word 2052 1875 .word 327768 1876 .word 22532 1877 .word 327768 1878 .word 83886084 1879 .word 327768 1880 .word 83906564 1881 .word 327768 1882 .word 83888132 1883 .word 327768 1884 .word 83908612 1885 .word 327768 1886 .word 8388612 1887 .word 327768 1888 .word 8409092 1889 .word 327768 1890 .word 8390660 1891 .word 327768 1892 .word 8411140 1893 .word 327768 1894 .word 92274692 1895 .word 327768 1896 .word 92295172 1897 .word 327768 1898 .word 92276740 1899 .word 327768 1900 .word 92297220 1901 .word 32768 1902 .word 0 1903 .word 32768 1904 .word 20480 1905 .word 32768 1906 .word 2048 1907 .word 32768 1908 .word 22528 1909 .word 32768 1910 .word 83886080 1911 .word 32768 1912 .word 83906560 1913 .word 32768 1914 .word 83888128 1915 .word 32768 1916 .word 83908608 1917 .word 32768 1918 .word 8388608 1919 .word 32768 1920 .word 8409088 1921 .word 32768 1922 .word 8390656 1923 .word 32768 1924 .word 8411136 1925 .word 32768 1926 .word 92274688 1927 .word 32768 1928 .word 92295168 1929 .word 32768 1930 .word 92276736 1931 .word 32768 1932 .word 92297216 1933 .word 32848 1934 .word 0 1935 .word 32848 1936 .word 20480 1937 .word 32848 1938 .word 2048 1939 .word 32848 1940 .word 22528 1941 .word 32848 1942 .word 83886080 1943 .word 32848 1944 .word 83906560 1945 .word 32848 1946 .word 83888128 1947 .word 32848 1948 .word 83908608 1949 .word 32848 1950 .word 8388608 1951 .word 32848 1952 .word 8409088 1953 .word 32848 1954 .word 8390656 1955 .word 32848 1956 .word 8411136 1957 .word 32848 1958 .word 92274688 1959 .word 32848 1960 .word 92295168 1961 .word 32848 1962 .word 92276736 1963 .word 32848 1964 .word 92297216 1965 .word 32776 1966 .word 0 1967 .word 32776 1968 .word 20480 1969 .word 32776 1970 .word 2048 1971 .word 32776 1972 .word 22528 1973 .word 32776 1974 .word 83886080 1975 .word 32776 1976 .word 83906560 1977 .word 32776 1978 .word 83888128 1979 .word 32776 1980 .word 83908608 1981 .word 32776 1982 .word 8388608 1983 .word 32776 1984 .word 8409088 1985 .word 32776 1986 .word 8390656 1987 .word 32776 1988 .word 8411136 1989 .word 32776 1990 .word 92274688 1991 .word 32776 1992 .word 92295168 1993 .word 32776 1994 .word 92276736 1995 .word 32776 1996 .word 92297216 1997 .word 32856 1998 .word 0 1999 .word 32856 2000 .word 20480 2001 .word 32856 2002 .word 2048 2003 .word 32856 2004 .word 22528 2005 .word 32856 2006 .word 83886080 2007 .word 32856 2008 .word 83906560 2009 .word 32856 2010 .word 83888128 2011 .word 32856 2012 .word 83908608 2013 .word 32856 2014 .word 8388608 2015 .word 32856 2016 .word 8409088 2017 .word 32856 2018 .word 8390656 2019 .word 32856 2020 .word 8411136 2021 .word 32856 2022 .word 92274688 2023 .word 32856 2024 .word 92295168 2025 .word 32856 2026 .word 92276736 2027 .word 32856 2028 .word 92297216 2029 .word 360448 2030 .word 4 2031 .word 360448 2032 .word 20484 2033 .word 360448 2034 .word 2052 2035 .word 360448 2036 .word 22532 2037 .word 360448 2038 .word 83886084 2039 .word 360448 2040 .word 83906564 2041 .word 360448 2042 .word 83888132 2043 .word 360448 2044 .word 83908612 2045 .word 360448 2046 .word 8388612 2047 .word 360448 2048 .word 8409092 2049 .word 360448 2050 .word 8390660 2051 .word 360448 2052 .word 8411140 2053 .word 360448 2054 .word 92274692 2055 .word 360448 2056 .word 92295172 2057 .word 360448 2058 .word 92276740 2059 .word 360448 2060 .word 92297220 2061 .word 360528 2062 .word 4 2063 .word 360528 2064 .word 20484 2065 .word 360528 2066 .word 2052 2067 .word 360528 2068 .word 22532 2069 .word 360528 2070 .word 83886084 2071 .word 360528 2072 .word 83906564 2073 .word 360528 2074 .word 83888132 2075 .word 360528 2076 .word 83908612 2077 .word 360528 2078 .word 8388612 2079 .word 360528 2080 .word 8409092 2081 .word 360528 2082 .word 8390660 2083 .word 360528 2084 .word 8411140 2085 .word 360528 2086 .word 92274692 2087 .word 360528 2088 .word 92295172 2089 .word 360528 2090 .word 92276740 2091 .word 360528 2092 .word 92297220 2093 .word 360456 2094 .word 4 2095 .word 360456 2096 .word 20484 2097 .word 360456 2098 .word 2052 2099 .word 360456 2100 .word 22532 2101 .word 360456 2102 .word 83886084 2103 .word 360456 2104 .word 83906564 2105 .word 360456 2106 .word 83888132 2107 .word 360456 2108 .word 83908612 2109 .word 360456 2110 .word 8388612 2111 .word 360456 2112 .word 8409092 2113 .word 360456 2114 .word 8390660 2115 .word 360456 2116 .word 8411140 2117 .word 360456 2118 .word 92274692 2119 .word 360456 2120 .word 92295172 2121 .word 360456 2122 .word 92276740 2123 .word 360456 2124 .word 92297220 2125 .word 360536 2126 .word 4 2127 .word 360536 2128 .word 20484 2129 .word 360536 2130 .word 2052 2131 .word 360536 2132 .word 22532 2133 .word 360536 2134 .word 83886084 2135 .word 360536 2136 .word 83906564 2137 .word 360536 2138 .word 83888132 2139 .word 360536 2140 .word 83908612 2141 .word 360536 2142 .word 8388612 2143 .word 360536 2144 .word 8409092 2145 .word 360536 2146 .word 8390660 2147 .word 360536 2148 .word 8411140 2149 .word 360536 2150 .word 92274692 2151 .word 360536 2152 .word 92295172 2153 .word 360536 2154 .word 92276740 2155 .word 360536 2156 .word 92297220 2157 .type des_ip_table,#object 2158 .size des_ip_table,4096 2159 2160 2161 .section ".data",#alloc 2162 .align 32 2163 2164 2165des_enc_const: 2166 2167#ifdef __sparcv9 2168 2169! 2170! For v9, the addresses ar 64-bit long, so we should use .xword 2171! instead of .word, this makes the constant table bigger 2172! 2173 .xword (des_ip_table+0x0) ! initial permutation table 2174 .xword (des_ip_table+0x800) 2175 2176 .xword (des_fp_table+0x0) ! final permutation table 2177 2178 .xword (des_sbox_table+0x0) ! sboxes table 2179 .xword (des_sbox_table+0x200) 2180 .xword (des_sbox_table+0x400) 2181 .xword (des_sbox_table+0x600) 2182 .xword (des_sbox_table+0x800) 2183 .xword (des_sbox_table+0xa00) 2184 .xword (des_sbox_table+0xc00) 2185 .xword (des_sbox_table+0xe00) 2186 2187 .word 0 ! for alignment 2188 .word 7 ! counter for encrypt loop 2189 2190 .word 16515072 ! top_1 2191 .word 0 ! 2192 2193 .word 262143 ! mid_4 2194 .word -67108864 ! 2195 2196 .word 0 ! low_3 2197 .word 67108608 ! 2198 2199 .word -1431655766 ! 0xaaaaaaaaaaaaaaaa 2200 .word -1431655766 ! 2201 2202 .word 1431655765 ! 0x5555555555555555 2203 .word 1431655765 ! 2204#else 2205 2206! 2207! For v8, the addresses are 32-bit long 2208! 2209 2210 .word (des_ip_table+0x0) ! initial permutation table 2211 .word (des_ip_table+0x800) 2212 2213 .word (des_fp_table+0x0) ! final permutation table 2214 2215 .word (des_sbox_table+0x0) ! sboxes table 2216 .word (des_sbox_table+0x200) 2217 .word (des_sbox_table+0x400) 2218 .word (des_sbox_table+0x600) 2219 .word (des_sbox_table+0x800) 2220 .word (des_sbox_table+0xa00) 2221 .word (des_sbox_table+0xc00) 2222 .word (des_sbox_table+0xe00) 2223 2224 .word 7 ! counter for encrypt loop 2225 2226 .word 16515072 ! top_1 2227 .word 0 ! 2228 2229 .word 262143 ! mid_4 2230 .word -67108864 ! 2231 2232 .word 0 ! low_3 2233 .word 67108608 ! 2234 2235 .word -1431655766 ! 0xaaaaaaaaaaaaaaaa 2236 .word -1431655766 ! 2237 2238 .word 1431655765 ! 0x5555555555555555 2239 .word 1431655765 ! 2240#endif 2241 .type des_enc_const,#object 2242 .size des_enc_const,(.-des_enc_const) 2243 2244 2245 .section ".text",#alloc,#execinstr 2246/* 000000 0 */ .align 32 2247/* 000000 */ .skip 32 2248! 2249! SUBROUTINE des_crypt_impl 2250! 2251! OFFSET SOURCE LINE LABEL INSTRUCTION 2252 2253.global des_crypt_impl 2254 2255! uint64_t des_crypt_impl(uint64_t *ks, uint64_t block, int one_or_three); 2256! 2257! ks is the key schedule, en/decryption is differentiated by computing 2258! an encryption key schedule for encryption and the reverse of it 2259! for decryption (for DES, 16 entries, for triple-DES, 48 entries) 2260! block is the 64-bit block to en/decrypt 2261! one_or_three is 1 for DES and 3 for triple-DES 2262 2263 des_crypt_impl: 2264 2265#ifdef __sparcv9 2266 save %sp,-192,%sp 2267#ifdef PIC 2268.L0: 2269 call . + 8 2270 sethi %hi(_GLOBAL_OFFSET_TABLE_ - (.L0 - .)), %o1 2271 sethi %hi(des_enc_const), %g1 2272 2273 or %o1, %lo(_GLOBAL_OFFSET_TABLE_ - (.L0 - .)), %o1 2274 or %g1, %lo(des_enc_const),%g1 2275 2276 add %o1, %o7, %o1 2277#else 2278 sethi %hh(des_enc_const),%o1 2279 sethi %lm(des_enc_const),%g1 2280 2281 or %o1,%hm(des_enc_const),%o1 2282 or %g1,%lo(des_enc_const),%g1 2283 2284 sllx %o1,32,%o1 2285#endif 2286 sethi %hi(0xaaaaaaaa), %g3 2287 2288#ifdef PIC 2289 ldx [%o1 + %g1], %i5 2290#else 2291 or %o1,%g1,%i5 ! &des_enc_const 2292#endif 2293 or %g3, %lo(0xaaaaaaaa), %g3 2294 2295 sllx %g3, 32, %o0 2296 2297 or %g3, %o0, %g3 ! 0xaaaaaaaaaaaaaaaa 2298 2299 srlx %g3, 1, %g2 ! 0x5555555555555555 2300 and %i1, %g3, %g1 2301 2302 sllx %g1, 7, %g3 2303 ldx [%i5 + 0], %l7 ! &(des_ip_table[0][0]) 2304 and %i1, %g2, %g2 2305 2306 srlx %g2, 7, %g4 2307 ldx [%i5 + 8], %l6 ! &(des_ip_table[1][0]) 2308 or %g1, %g3, %g1 2309 2310 srlx %g1, 21, %o0 2311 ld [%i5 + 92], %i4 ! 7 (for iteration counter) 2312 or %g2, %g4, %g2 2313 2314 srlx %g1, 5, %o1 2315 ldx [%i5 + 24], %l0 ! &(des_sbox_table[0][0]) 2316 and %o0, 0x7f8, %o0 2317 2318 srlx %g2, 13, %o2 2319 ldx [%l7 + %o0], %o0 2320 and %o1, 0x7f8, %o1 2321 2322 sllx %g2, 3, %o3 2323 ldx [%l6 + %o1], %o1 2324 and %o2, 0x7f8, %o2 2325 2326 srlx %g1, 53, %o4 2327 ldx [%l7 + %o2], %o2 2328 and %o3, 0x7f8, %o3 2329 2330 srlx %g1, 37, %o5 2331 ldx [%l6 + %o3], %o3 2332 and %o4, 0x7f8, %o4 2333 2334 srlx %g2, 45, %g1 2335 ldx [%l7 + %o4], %o4 2336 and %o5, 0x7f8, %o5 2337 2338 srlx %g2, 29, %g2 2339 ldx [%l6 + %o5], %o5 2340 and %g1, 0x7f8, %g1 2341 2342 sllx %o0, 6, %o0 2343 ldx [%l7 + %g1], %g1 2344 and %g2, 0x7f8, %g2 2345 2346 sllx %o1, 6, %o1 2347 ldx [%l6 + %g2], %g2 2348 or %o4, %o5, %o4 2349 2350 sllx %o2, 6, %o2 2351 ldx [%i5 + 32], %l1 ! &(des_sbox_table[1][0]) 2352 or %o0, %o1, %o0 2353 2354 sllx %o3, 6, %o3 2355 ldx [%i5 + 96], %g3 ! top_1 2356 or %o0, %o4, %o0 2357 2358 or %g1, %g2, %g1 2359 ldx [%i5 + 104], %g4 ! mid_4 2360 or %o2, %o3, %o2 2361 2362 and %o0, %g3, %o4 2363 ldx [%i5 + 112], %g2 ! low_3 2364 or %o2, %g1, %o1 2365 2366 sllx %o4, 8, %o4 2367 ldx [%i5 + 40], %l2 ! &(des_sbox_table[2][0]) 2368 and %o1, %g3, %o5 2369 2370 sllx %o5, 8, %o5 2371 ldx [%i5 + 48], %l3 ! &(des_sbox_table[3][0]) 2372 and %o0, %g2, %o2 2373 2374 srlx %o2, 5, %o2 2375 ldx [%i5 + 56], %l4 ! &(des_sbox_table[4][0]) 2376 and %o1, %g2, %o3 2377 2378 srlx %o3, 5, %o3 2379 ldx [%i0], %g2 ! ks[0] 2380 and %o0, %g4, %o0 2381 2382 or %o0, %o2, %o0 2383 ldx [%i5 + 64], %l5 ! &(des_sbox_table[5][0]) 2384 and %o1, %g4, %o1 2385 2386 or %o0, %o4, %o0 2387 ldx [%i5 + 72], %l6 ! &(des_sbox_table[6][0]) 2388 or %o1, %o3, %o1 2389 2390 xor %o0, %g2, %g1 2391 ldx [%i5 + 80], %l7 ! &(des_sbox_table[7][0]) 2392 or %o1, %o5, %o1 2393#else 2394 2395! v8 version 2396 2397 save %sp,-144,%sp 2398 sethi %hi(des_enc_const), %g2 2399 2400#ifdef PIC 2401.L1: 2402 call .+8 2403 2404 sethi %hi(_GLOBAL_OFFSET_TABLE_ - (.L1 - .)), %g1 2405 2406 or %g1, %lo(_GLOBAL_OFFSET_TABLE_ - (.L1 - .)), %g1 2407 or %g2, %lo(des_enc_const), %g2 2408#else 2409 or %g2, %lo(des_enc_const), %i5 2410#endif 2411 srl %i2, 0, %g4 2412 sethi %hi(0xaaaaaaaa), %g3 2413 2414 sllx %i1, 32, %g5 2415 or %g3, %lo(0xaaaaaaaa), %g3 2416 2417 sllx %g3, 32, %o0 2418 add %o7, %g1, %g1 2419 2420 or %g3, %o0, %g3 ! 0xaaaaaaaaaaaaaaaa 2421#ifdef PIC 2422 ld [%g1 + %g2], %i5 2423#endif 2424 or %g4, %g5, %g4 2425 2426 srlx %g3, 1, %g2 ! 0x5555555555555555 2427 and %g4, %g3, %g1 2428 2429 sllx %g1, 7, %g3 2430 ld [%i5 + 0], %l7 ! &(des_ip_table[0][0]) 2431 and %g4, %g2, %g2 2432 2433 srlx %g2, 7, %g4 2434 ld [%i5 + 4], %l6 ! &(des_ip_table[1][0]) 2435 or %g1, %g3, %g1 2436 2437 srlx %g1, 21, %o0 2438 ld [%i5 + 44], %i4 ! 7 (for iteration counter) 2439 or %g2, %g4, %g2 2440 2441 srlx %g1, 5, %o1 2442 ld [%i5 + 12], %l0 ! &(des_sbox_table[0][0]) 2443 and %o0, 0x7f8, %o0 2444 2445 srlx %g2, 13, %o2 2446 ldx [%l7 + %o0], %o0 2447 and %o1, 0x7f8, %o1 2448 2449 sllx %g2, 3, %o3 2450 ldx [%l6 + %o1], %o1 2451 and %o2, 0x7f8, %o2 2452 2453 srlx %g1, 53, %o4 2454 ldx [%l7 + %o2], %o2 2455 and %o3, 0x7f8, %o3 2456 2457 srlx %g1, 37, %o5 2458 ldx [%l6 + %o3], %o3 2459 and %o4, 0x7f8, %o4 2460 2461 srlx %g2, 45, %g1 2462 ldx [%l7 + %o4], %o4 2463 and %o5, 0x7f8, %o5 2464 2465 srlx %g2, 29, %g2 2466 ldx [%l6 + %o5], %o5 2467 and %g1, 0x7f8, %g1 2468 2469 sllx %o0, 6, %o0 2470 ldx [%l7 + %g1], %g1 2471 and %g2, 0x7f8, %g2 2472 2473 sllx %o1, 6, %o1 2474 ldx [%l6 + %g2], %g2 2475 or %o4, %o5, %o4 2476 2477 sllx %o2, 6, %o2 2478 ld [%i5 + 16], %l1 ! &(des_sbox_table[1][0]) 2479 or %o0, %o1, %o0 2480 2481 sllx %o3, 6, %o3 2482 ldx [%i5 + 48], %g3 ! top_1 2483 or %o0, %o4, %o0 2484 2485 or %g1, %g2, %g1 2486 ldx [%i5 + 56], %g4 ! mid_4 2487 or %o2, %o3, %o2 2488 2489 and %o0, %g3, %o4 2490 ldx [%i5 + 64], %g2 ! low_3 2491 or %o2, %g1, %o1 2492 2493 sllx %o4, 8, %o4 2494 ld [%i5 + 20], %l2 ! &(des_sbox_table[2][0]) 2495 and %o1, %g3, %o5 2496 2497 sllx %o5, 8, %o5 2498 ld [%i5 + 24], %l3 ! &(des_sbox_table[3][0]) 2499 and %o0, %g2, %o2 2500 2501 srlx %o2, 5, %o2 2502 ld [%i5 + 28], %l4 ! &(des_sbox_table[4][0]) 2503 and %o1, %g2, %o3 2504 2505 srlx %o3, 5, %o3 2506 ldx [%i0], %g2 ! ks[0] 2507 and %o0, %g4, %o0 2508 2509 or %o0, %o2, %o0 2510 ld [%i5 + 32], %l5 ! &(des_sbox_table[5][0]) 2511 and %o1, %g4, %o1 2512 2513 or %o0, %o4, %o0 2514 ld [%i5 + 36], %l6 ! &(des_sbox_table[6][0]) 2515 or %o1, %o3, %o1 2516 2517 xor %o0, %g2, %g1 2518 ld [%i5 + 40], %l7 ! &(des_sbox_table[7][0]) 2519 or %o1, %o5, %o1 2520 2521#endif 2522.L2: 2523 srlx %g1, 55, %g1 2524 xor %o0, %g2, %o5 2525.L3: 2526 srlx %o5, 41, %g3 2527 ldx [%l0 + %g1], %g1 2528 and %o5, 0x1f8, %g2 2529 2530 srlx %o5, 29, %g4 2531 ldx [%l7 + %g2], %g2 2532 and %g3, 0x1f8, %g3 2533 2534 srlx %o5, 12, %o2 2535 ldx [%l1 + %g3], %g3 2536 and %g4, 0x1f8, %g4 2537 2538 srlx %o5, 35, %o3 2539 ldx [%l3 + %g4], %g4 2540 and %o2, 0x1f8, %o2 2541 2542 srlx %o5, 6, %o4 2543 ldx [%l5 + %o2], %o2 2544 and %o3, 0x1f8, %o3 2545 2546 or %g1, %g2, %g2 2547 ldx [%l2 + %o3], %o3 2548 and %o4, 0x1f8, %o4 2549 2550 srl %o5, 23, %o5 2551 ldx [%l6 + %o4], %o4 2552 or %g3, %g4, %g4 2553 2554 or %g2, %g4, %g4 2555 ldx [%l4 + %o5], %o5 2556 or %o2, %o3, %o3 2557 2558 or %g4, %o3, %o3 2559 ldx [%i0 + 8], %g2 2560 add %i0, 16, %i0 2561 2562 xor %o1, %o3, %o1 2563 or %o4, %o5, %o5 2564 2565 xor %o1, %g2, %g1 2566 xor %o1, %o5, %o1 2567 2568 srl %g1, 23, %g1 2569 xor %o1, %g2, %o5 2570 2571 srlx %o5, 41, %g3 2572 ldx [%l4 + %g1], %g1 2573 and %o5, 0x1f8, %g2 2574 2575 srlx %o5, 29, %g4 2576 ldx [%l7 + %g2], %g2 2577 and %g3, 0x1f8, %g3 2578 2579 srlx %o5, 12, %o2 2580 ldx [%l1 + %g3], %g3 2581 and %g4, 0x1f8, %g4 2582 2583 srlx %o5, 6, %o3 2584 ldx [%l3 + %g4], %g4 2585 and %o2, 0x1f8, %o2 2586 2587 srlx %o5, 35, %o4 2588 ldx [%l5 + %o2], %o2 2589 and %o3, 0x1f8, %o3 2590 2591 or %g1, %g2, %g2 2592 ldx [%l6 + %o3], %o3 2593 and %o4, 0x1f8, %o4 2594 2595 srlx %o5, 55, %o5 2596 ldx [%l2 + %o4], %o4 2597 or %g3, %g4, %g4 2598 2599 or %g2, %g4, %g4 2600 ldx [%l0 + %o5], %o5 2601 or %o2, %o3, %o3 2602 2603 or %g4, %o3, %o3 2604 ldx [%i0], %g2 2605 subcc %i4,1,%i4 2606 2607 xor %o0, %o3, %o0 2608 or %o4, %o5, %o5 2609 2610 xor %o0, %g2, %g1 2611! bnz %icc, .L2 2612 xor %o0, %o5, %o0 2613 2614 srlx %g1, 55, %g1 2615 xor %o0, %g2, %o5 2616 2617 srlx %o5, 41, %g3 2618 ldx [%l0 + %g1], %g1 2619 and %o5, 0x1f8, %g2 2620 2621 srlx %o5, 29, %g4 2622 ldx [%l7 + %g2], %g2 2623 and %g3, 0x1f8, %g3 2624 2625 srlx %o5, 12, %o2 2626 ldx [%l1 + %g3], %g3 2627 and %g4, 0x1f8, %g4 2628 2629 srlx %o5, 35, %o3 2630 ldx [%l3 + %g4], %g4 2631 and %o2, 0x1f8, %o2 2632 2633 srlx %o5, 6, %o4 2634 ldx [%l5 + %o2], %o2 2635 and %o3, 0x1f8, %o3 2636 2637 or %g1, %g2, %g2 2638 ldx [%l2 + %o3], %o3 2639 and %o4, 0x1f8, %o4 2640 2641 srl %o5, 23, %o5 2642 ldx [%l6 + %o4], %o4 2643 or %g3, %g4, %g4 2644 2645 or %g2, %g4, %g4 2646 ldx [%l4 + %o5], %o5 2647 or %o2, %o3, %o3 2648 2649 or %g4, %o3, %o3 2650 ldx [%i0 + 8], %g2 2651 add %i0, 16, %i0 2652 2653 xor %o1, %o3, %o1 2654 or %o4, %o5, %o5 2655 2656 xor %o1, %g2, %g1 2657 xor %o1, %o5, %o1 2658 2659 srl %g1, 23, %g1 2660 xor %o1, %g2, %o5 2661 2662 srlx %o5, 41, %g3 2663 ldx [%l4 + %g1], %g1 2664 and %o5, 0x1f8, %g2 2665 2666 srlx %o5, 29, %g4 2667 ldx [%l7 + %g2], %g2 2668 and %g3, 0x1f8, %g3 2669 2670 srlx %o5, 12, %o2 2671 ldx [%l1 + %g3], %g3 2672 and %g4, 0x1f8, %g4 2673 2674 srlx %o5, 6, %o3 2675 ldx [%l3 + %g4], %g4 2676 and %o2, 0x1f8, %o2 2677 2678 srlx %o5, 35, %o4 2679 ldx [%l5 + %o2], %o2 2680 and %o3, 0x1f8, %o3 2681 2682 or %g1, %g2, %g2 2683 ldx [%l6 + %o3], %o3 2684 and %o4, 0x1f8, %o4 2685 2686 srlx %o5, 55, %o5 2687 ldx [%l2 + %o4], %o4 2688 or %g3, %g4, %g4 2689 2690 or %g2, %g4, %g4 2691 ldx [%l0 + %o5], %o5 2692 or %o2, %o3, %o3 2693 2694 or %g4, %o3, %o3 2695 ldx [%i0], %g2 2696 subcc %i4,1,%i4 2697 2698 xor %o0, %o3, %o0 2699 or %o4, %o5, %o5 2700 2701 xor %o0, %g2, %g1 2702! bnz %icc, .L2 2703 xor %o0, %o5, %o0 2704 2705 srlx %g1, 55, %g1 2706 xor %o0, %g2, %o5 2707 2708 srlx %o5, 41, %g3 2709 ldx [%l0 + %g1], %g1 2710 and %o5, 0x1f8, %g2 2711 2712 srlx %o5, 29, %g4 2713 ldx [%l7 + %g2], %g2 2714 and %g3, 0x1f8, %g3 2715 2716 srlx %o5, 12, %o2 2717 ldx [%l1 + %g3], %g3 2718 and %g4, 0x1f8, %g4 2719 2720 srlx %o5, 35, %o3 2721 ldx [%l3 + %g4], %g4 2722 and %o2, 0x1f8, %o2 2723 2724 srlx %o5, 6, %o4 2725 ldx [%l5 + %o2], %o2 2726 and %o3, 0x1f8, %o3 2727 2728 or %g1, %g2, %g2 2729 ldx [%l2 + %o3], %o3 2730 and %o4, 0x1f8, %o4 2731 2732 srl %o5, 23, %o5 2733 ldx [%l6 + %o4], %o4 2734 or %g3, %g4, %g4 2735 2736 or %g2, %g4, %g4 2737 ldx [%l4 + %o5], %o5 2738 or %o2, %o3, %o3 2739 2740 or %g4, %o3, %o3 2741 ldx [%i0 + 8], %g2 2742 add %i0, 16, %i0 2743 2744 xor %o1, %o3, %o1 2745 or %o4, %o5, %o5 2746 2747 xor %o1, %g2, %g1 2748 xor %o1, %o5, %o1 2749 2750 srl %g1, 23, %g1 2751 xor %o1, %g2, %o5 2752 2753 srlx %o5, 41, %g3 2754 ldx [%l4 + %g1], %g1 2755 and %o5, 0x1f8, %g2 2756 2757 srlx %o5, 29, %g4 2758 ldx [%l7 + %g2], %g2 2759 and %g3, 0x1f8, %g3 2760 2761 srlx %o5, 12, %o2 2762 ldx [%l1 + %g3], %g3 2763 and %g4, 0x1f8, %g4 2764 2765 srlx %o5, 6, %o3 2766 ldx [%l3 + %g4], %g4 2767 and %o2, 0x1f8, %o2 2768 2769 srlx %o5, 35, %o4 2770 ldx [%l5 + %o2], %o2 2771 and %o3, 0x1f8, %o3 2772 2773 or %g1, %g2, %g2 2774 ldx [%l6 + %o3], %o3 2775 and %o4, 0x1f8, %o4 2776 2777 srlx %o5, 55, %o5 2778 ldx [%l2 + %o4], %o4 2779 or %g3, %g4, %g4 2780 2781 or %g2, %g4, %g4 2782 ldx [%l0 + %o5], %o5 2783 or %o2, %o3, %o3 2784 2785 or %g4, %o3, %o3 2786 ldx [%i0], %g2 2787 subcc %i4,1,%i4 2788 2789 xor %o0, %o3, %o0 2790 or %o4, %o5, %o5 2791 2792 xor %o0, %g2, %g1 2793! bnz %icc, .L2 2794 xor %o0, %o5, %o0 2795 2796 srlx %g1, 55, %g1 2797 xor %o0, %g2, %o5 2798 2799 srlx %o5, 41, %g3 2800 ldx [%l0 + %g1], %g1 2801 and %o5, 0x1f8, %g2 2802 2803 srlx %o5, 29, %g4 2804 ldx [%l7 + %g2], %g2 2805 and %g3, 0x1f8, %g3 2806 2807 srlx %o5, 12, %o2 2808 ldx [%l1 + %g3], %g3 2809 and %g4, 0x1f8, %g4 2810 2811 srlx %o5, 35, %o3 2812 ldx [%l3 + %g4], %g4 2813 and %o2, 0x1f8, %o2 2814 2815 srlx %o5, 6, %o4 2816 ldx [%l5 + %o2], %o2 2817 and %o3, 0x1f8, %o3 2818 2819 or %g1, %g2, %g2 2820 ldx [%l2 + %o3], %o3 2821 and %o4, 0x1f8, %o4 2822 2823 srl %o5, 23, %o5 2824 ldx [%l6 + %o4], %o4 2825 or %g3, %g4, %g4 2826 2827 or %g2, %g4, %g4 2828 ldx [%l4 + %o5], %o5 2829 or %o2, %o3, %o3 2830 2831 or %g4, %o3, %o3 2832 ldx [%i0 + 8], %g2 2833 add %i0, 16, %i0 2834 2835 xor %o1, %o3, %o1 2836 or %o4, %o5, %o5 2837 2838 xor %o1, %g2, %g1 2839 xor %o1, %o5, %o1 2840 2841 srl %g1, 23, %g1 2842 xor %o1, %g2, %o5 2843 2844 srlx %o5, 41, %g3 2845 ldx [%l4 + %g1], %g1 2846 and %o5, 0x1f8, %g2 2847 2848 srlx %o5, 29, %g4 2849 ldx [%l7 + %g2], %g2 2850 and %g3, 0x1f8, %g3 2851 2852 srlx %o5, 12, %o2 2853 ldx [%l1 + %g3], %g3 2854 and %g4, 0x1f8, %g4 2855 2856 srlx %o5, 6, %o3 2857 ldx [%l3 + %g4], %g4 2858 and %o2, 0x1f8, %o2 2859 2860 srlx %o5, 35, %o4 2861 ldx [%l5 + %o2], %o2 2862 and %o3, 0x1f8, %o3 2863 2864 or %g1, %g2, %g2 2865 ldx [%l6 + %o3], %o3 2866 and %o4, 0x1f8, %o4 2867 2868 srlx %o5, 55, %o5 2869 ldx [%l2 + %o4], %o4 2870 or %g3, %g4, %g4 2871 2872 or %g2, %g4, %g4 2873 ldx [%l0 + %o5], %o5 2874 or %o2, %o3, %o3 2875 2876 or %g4, %o3, %o3 2877 ldx [%i0], %g2 2878 subcc %i4,1,%i4 2879 2880 xor %o0, %o3, %o0 2881 or %o4, %o5, %o5 2882 2883 xor %o0, %g2, %g1 2884! bnz %icc, .L2 2885 xor %o0, %o5, %o0 2886 2887 srlx %g1, 55, %g1 2888 xor %o0, %g2, %o5 2889 2890 srlx %o5, 41, %g3 2891 ldx [%l0 + %g1], %g1 2892 and %o5, 0x1f8, %g2 2893 2894 srlx %o5, 29, %g4 2895 ldx [%l7 + %g2], %g2 2896 and %g3, 0x1f8, %g3 2897 2898 srlx %o5, 12, %o2 2899 ldx [%l1 + %g3], %g3 2900 and %g4, 0x1f8, %g4 2901 2902 srlx %o5, 35, %o3 2903 ldx [%l3 + %g4], %g4 2904 and %o2, 0x1f8, %o2 2905 2906 srlx %o5, 6, %o4 2907 ldx [%l5 + %o2], %o2 2908 and %o3, 0x1f8, %o3 2909 2910 or %g1, %g2, %g2 2911 ldx [%l2 + %o3], %o3 2912 and %o4, 0x1f8, %o4 2913 2914 srl %o5, 23, %o5 2915 ldx [%l6 + %o4], %o4 2916 or %g3, %g4, %g4 2917 2918 or %g2, %g4, %g4 2919 ldx [%l4 + %o5], %o5 2920 or %o2, %o3, %o3 2921 2922 or %g4, %o3, %o3 2923 ldx [%i0 + 8], %g2 2924 add %i0, 16, %i0 2925 2926 xor %o1, %o3, %o1 2927 or %o4, %o5, %o5 2928 2929 xor %o1, %g2, %g1 2930 xor %o1, %o5, %o1 2931 2932 srl %g1, 23, %g1 2933 xor %o1, %g2, %o5 2934 2935 srlx %o5, 41, %g3 2936 ldx [%l4 + %g1], %g1 2937 and %o5, 0x1f8, %g2 2938 2939 srlx %o5, 29, %g4 2940 ldx [%l7 + %g2], %g2 2941 and %g3, 0x1f8, %g3 2942 2943 srlx %o5, 12, %o2 2944 ldx [%l1 + %g3], %g3 2945 and %g4, 0x1f8, %g4 2946 2947 srlx %o5, 6, %o3 2948 ldx [%l3 + %g4], %g4 2949 and %o2, 0x1f8, %o2 2950 2951 srlx %o5, 35, %o4 2952 ldx [%l5 + %o2], %o2 2953 and %o3, 0x1f8, %o3 2954 2955 or %g1, %g2, %g2 2956 ldx [%l6 + %o3], %o3 2957 and %o4, 0x1f8, %o4 2958 2959 srlx %o5, 55, %o5 2960 ldx [%l2 + %o4], %o4 2961 or %g3, %g4, %g4 2962 2963 or %g2, %g4, %g4 2964 ldx [%l0 + %o5], %o5 2965 or %o2, %o3, %o3 2966 2967 or %g4, %o3, %o3 2968 ldx [%i0], %g2 2969 subcc %i4,1,%i4 2970 2971 xor %o0, %o3, %o0 2972 or %o4, %o5, %o5 2973 2974 xor %o0, %g2, %g1 2975! bnz %icc, .L2 2976 xor %o0, %o5, %o0 2977 2978 srlx %g1, 55, %g1 2979 xor %o0, %g2, %o5 2980 2981 srlx %o5, 41, %g3 2982 ldx [%l0 + %g1], %g1 2983 and %o5, 0x1f8, %g2 2984 2985 srlx %o5, 29, %g4 2986 ldx [%l7 + %g2], %g2 2987 and %g3, 0x1f8, %g3 2988 2989 srlx %o5, 12, %o2 2990 ldx [%l1 + %g3], %g3 2991 and %g4, 0x1f8, %g4 2992 2993 srlx %o5, 35, %o3 2994 ldx [%l3 + %g4], %g4 2995 and %o2, 0x1f8, %o2 2996 2997 srlx %o5, 6, %o4 2998 ldx [%l5 + %o2], %o2 2999 and %o3, 0x1f8, %o3 3000 3001 or %g1, %g2, %g2 3002 ldx [%l2 + %o3], %o3 3003 and %o4, 0x1f8, %o4 3004 3005 srl %o5, 23, %o5 3006 ldx [%l6 + %o4], %o4 3007 or %g3, %g4, %g4 3008 3009 or %g2, %g4, %g4 3010 ldx [%l4 + %o5], %o5 3011 or %o2, %o3, %o3 3012 3013 or %g4, %o3, %o3 3014 ldx [%i0 + 8], %g2 3015 add %i0, 16, %i0 3016 3017 xor %o1, %o3, %o1 3018 or %o4, %o5, %o5 3019 3020 xor %o1, %g2, %g1 3021 xor %o1, %o5, %o1 3022 3023 srl %g1, 23, %g1 3024 xor %o1, %g2, %o5 3025 3026 srlx %o5, 41, %g3 3027 ldx [%l4 + %g1], %g1 3028 and %o5, 0x1f8, %g2 3029 3030 srlx %o5, 29, %g4 3031 ldx [%l7 + %g2], %g2 3032 and %g3, 0x1f8, %g3 3033 3034 srlx %o5, 12, %o2 3035 ldx [%l1 + %g3], %g3 3036 and %g4, 0x1f8, %g4 3037 3038 srlx %o5, 6, %o3 3039 ldx [%l3 + %g4], %g4 3040 and %o2, 0x1f8, %o2 3041 3042 srlx %o5, 35, %o4 3043 ldx [%l5 + %o2], %o2 3044 and %o3, 0x1f8, %o3 3045 3046 or %g1, %g2, %g2 3047 ldx [%l6 + %o3], %o3 3048 and %o4, 0x1f8, %o4 3049 3050 srlx %o5, 55, %o5 3051 ldx [%l2 + %o4], %o4 3052 or %g3, %g4, %g4 3053 3054 or %g2, %g4, %g4 3055 ldx [%l0 + %o5], %o5 3056 or %o2, %o3, %o3 3057 3058 or %g4, %o3, %o3 3059 ldx [%i0], %g2 3060 subcc %i4,1,%i4 3061 3062 xor %o0, %o3, %o0 3063 or %o4, %o5, %o5 3064 3065 xor %o0, %g2, %g1 3066! bnz %icc, .L2 3067 xor %o0, %o5, %o0 3068 3069 srlx %g1, 55, %g1 3070 xor %o0, %g2, %o5 3071 3072 srlx %o5, 41, %g3 3073 ldx [%l0 + %g1], %g1 3074 and %o5, 0x1f8, %g2 3075 3076 srlx %o5, 29, %g4 3077 ldx [%l7 + %g2], %g2 3078 and %g3, 0x1f8, %g3 3079 3080 srlx %o5, 12, %o2 3081 ldx [%l1 + %g3], %g3 3082 and %g4, 0x1f8, %g4 3083 3084 srlx %o5, 35, %o3 3085 ldx [%l3 + %g4], %g4 3086 and %o2, 0x1f8, %o2 3087 3088 srlx %o5, 6, %o4 3089 ldx [%l5 + %o2], %o2 3090 and %o3, 0x1f8, %o3 3091 3092 or %g1, %g2, %g2 3093 ldx [%l2 + %o3], %o3 3094 and %o4, 0x1f8, %o4 3095 3096 srl %o5, 23, %o5 3097 ldx [%l6 + %o4], %o4 3098 or %g3, %g4, %g4 3099 3100 or %g2, %g4, %g4 3101 ldx [%l4 + %o5], %o5 3102 or %o2, %o3, %o3 3103 3104 or %g4, %o3, %o3 3105 ldx [%i0 + 8], %g2 3106 add %i0, 16, %i0 3107 3108 xor %o1, %o3, %o1 3109 or %o4, %o5, %o5 3110 3111 xor %o1, %g2, %g1 3112 xor %o1, %o5, %o1 3113 3114 srl %g1, 23, %g1 3115 xor %o1, %g2, %o5 3116 3117 srlx %o5, 41, %g3 3118 ldx [%l4 + %g1], %g1 3119 and %o5, 0x1f8, %g2 3120 3121 srlx %o5, 29, %g4 3122 ldx [%l7 + %g2], %g2 3123 and %g3, 0x1f8, %g3 3124 3125 srlx %o5, 12, %o2 3126 ldx [%l1 + %g3], %g3 3127 and %g4, 0x1f8, %g4 3128 3129 srlx %o5, 6, %o3 3130 ldx [%l3 + %g4], %g4 3131 and %o2, 0x1f8, %o2 3132 3133 srlx %o5, 35, %o4 3134 ldx [%l5 + %o2], %o2 3135 and %o3, 0x1f8, %o3 3136 3137 or %g1, %g2, %g2 3138 ldx [%l6 + %o3], %o3 3139 and %o4, 0x1f8, %o4 3140 3141 srlx %o5, 55, %o5 3142 ldx [%l2 + %o4], %o4 3143 or %g3, %g4, %g4 3144 3145 or %g2, %g4, %g4 3146 ldx [%l0 + %o5], %o5 3147 or %o2, %o3, %o3 3148 3149 or %g4, %o3, %o3 3150 ldx [%i0], %g2 3151 subcc %i4,1,%i4 3152 3153 xor %o0, %o3, %o0 3154 or %o4, %o5, %o5 3155 3156 xor %o0, %g2, %g1 3157! bnz %icc, .L2 3158 xor %o0, %o5, %o0 3159 3160 srlx %g1, 55, %g1 3161 xor %o0, %g2, %o5 3162 3163 srlx %o5, 41, %g3 3164 ldx [%l0 + %g1], %g1 3165 and %o5, 0x1f8, %g2 3166 3167 srlx %o5, 29, %g4 3168 ldx [%l7 + %g2], %g2 3169 and %g3, 0x1f8, %g3 3170 3171 srlx %o5, 12, %o2 3172 ldx [%l1 + %g3], %g3 3173 and %g4, 0x1f8, %g4 3174 3175 srlx %o5, 35, %o3 3176 ldx [%l3 + %g4], %g4 3177 and %o2, 0x1f8, %o2 3178 3179 srlx %o5, 6, %o4 3180 ldx [%l5 + %o2], %o2 3181 and %o3, 0x1f8, %o3 3182 3183 or %g1, %g2, %g2 3184 ldx [%l2 + %o3], %o3 3185 and %o4, 0x1f8, %o4 3186 3187 srl %o5, 23, %o5 3188 ldx [%l6 + %o4], %o4 3189 or %g3, %g4, %g4 3190 3191 or %g2, %g4, %g4 3192 ldx [%l4 + %o5], %o5 3193 or %o2, %o3, %o3 3194 3195 or %g4, %o3, %o3 3196 ldx [%i0 + 8], %g2 3197#ifdef __sparcv9 3198 subcc %i2, 1, %i2 ! one_or_three for v9 3199#else 3200 subcc %i3, 1, %i3 ! one_or_three for v8 3201#endif 3202 3203 xor %o1, %o3, %o1 3204 or %o4, %o5, %o5 3205 3206 xor %o1, %g2, %g1 3207 xor %o1, %o5, %g5 3208 3209 srl %g1, 23, %g1 3210 xor %g5, %g2, %o5 3211 3212 srlx %o5, 41, %g3 3213 ldx [%l4 + %g1], %g1 3214 and %o5, 0x1f8, %g2 3215 3216 srlx %o5, 29, %g4 3217 ldx [%l7 + %g2], %g2 3218 and %g3, 0x1f8, %g3 3219 3220 srlx %o5, 12, %o2 3221 ldx [%l1 + %g3], %g3 3222 and %g4, 0x1f8, %g4 3223 3224 srlx %o5, 6, %o3 3225 ldx [%l3 + %g4], %g4 3226 and %o2, 0x1f8, %o2 3227 3228 srlx %o5, 35, %o4 3229 ldx [%l5 + %o2], %o2 3230 and %o3, 0x1f8, %o3 3231 3232 or %g1, %g2, %g2 3233 ldx [%l6 + %o3], %o3 3234 and %o4, 0x1f8, %o4 3235 3236 srlx %o5, 55, %o5 3237 ldx [%l2 + %o4], %o4 3238 or %g3, %g4, %g4 3239 3240 or %g2, %g4, %g4 3241 ldx [%l0 + %o5], %o5 3242 bz,pn %icc, .L4 ! if finished (one or three iterations 3243 or %o2, %o3, %o3 ! of the 16 rounds), go to final perm. 3244 3245 or %g4, %o3, %o3 3246 ldx [%i0 + 16], %g2 3247 add %i0, 16, %i0 3248 3249 xor %o0, %o3, %o0 3250 or %o4, %o5, %o4 3251 3252 xor %g5, %g2, %o5 3253 xor %o0, %o4, %o1 3254 3255 srlx %o5, 55, %g1 3256 ba .L3 3257 or %g5, %g0, %o0 3258 3259 3260.L4: 3261 or %g4, %o3, %o3 3262#ifdef __sparcv9 3263 ldx [%i5 + 16], %i5 ! &(dec_fp_table[0]) 3264#else 3265 ld [%i5 + 8], %i5 ! &(dec_fp_table[0]) 3266#endif 3267 or %g0, 0xf, %g4 3268 3269 xor %o0, %o3, %o0 3270 or %o4, %o5, %o5 3271 3272 sllx %g4, 59, %g4 ! mask for bits 1-4 3273 xor %o0, %o5, %o0 3274 3275! fp starts here 3276 3277 srlx %o0, 33, %g1 3278 and %o0, %g4, %g2 3279 3280 srlx %g5, 37, %l0 3281 and %g5, %g4, %g3 3282 3283 srlx %g2, 53, %g2 3284 and %g1, 0x3c0, %g1 3285 3286 srlx %g3, 57, %l1 3287 and %l0, 0x3c, %l0 3288 3289 srlx %o0, 21, %g3 3290 or %g1, %l0, %l0 3291 3292 srlx %g5, 25, %l2 3293 ld [%i5 + %l0], %l0 3294 or %l1, %g2, %l1 3295 3296 srlx %o0, 4, %g4 3297 ld [%i5 + %l1], %l1 3298 and %g3, 0x3c0, %g3 3299 3300 srlx %g5, 8, %l3 3301 and %l2, 0x3c, %l2 3302 3303 srlx %o0, 27, %g1 3304 or %l2, %g3, %l2 3305 3306 srlx %g5, 31, %l4 3307 ld [%i5 + %l2], %l2 3308 and %g4, 0x3c0, %g4 3309 3310 and %l3, 0x3c, %l3 3311 and %g1, 0x3c0, %g1 3312 3313 srlx %o0, 10, %g2 3314 or %l3, %g4, %l3 3315 3316 srlx %g5, 14, %l5 3317 ld [%i5 + %l3], %l3 3318 and %l4, 0x3c, %l4 3319 3320 sllx %o0, 2, %g3 3321 or %l4, %g1, %l4 3322 3323 srlx %g5, 2, %l6 3324 ld [%i5 + %l4], %l4 3325 and %g2, 0x3c0, %g2 3326 3327 srlx %o0, 39, %g4 3328 and %l5, 0x3c, %l5 3329 3330 and %g3, 0x3c0, %g3 3331 or %l5, %g2, %l5 3332 3333 srlx %g5, 43, %l7 3334 ld [%i5 + %l5], %l5 3335 and %l6, 0x3c, %l6 3336 3337 and %g4, 0x3c0, %g4 3338 or %l6, %g3, %l6 3339 3340 srl %l0, 2, %l0 3341 ld [%i5 + %l6], %l6 3342 and %l7, 0x3c, %l7 3343 3344 srl %l2, 4, %l2 3345 or %l7, %g4, %l7 3346 3347 srl %l4, 2, %l4 3348 ld [%i5 + %l7], %l7 3349 or %l0, %l1, %l1 3350 3351 srl %l5, 4, %l5 3352 or %l1, %l2, %l2 3353 3354 srl %l6, 6, %l6 3355 or %l4, %l5, %l5 3356 3357 srl %l3, 6, %l3 3358 or %l6, %l7, %l7 3359 3360 or %l2, %l3, %i1 3361 or %l5, %l7, %i0 3362 3363! 3364! result at this point is in i0-i1, just as it should for v8 3365! 3366#ifdef __sparcv9 3367 srl %i1, 0, %i1 3368 3369 sllx %i0, 32, %i0 3370 3371 or %i0, %i1, %i0 3372#endif 3373 3374 3375 ret 3376 restore %g0,%g0,%g0 3377 .type des_crypt_impl,2 3378 .size des_crypt_impl,(.-des_crypt_impl) 3379 3380 .align 32 3381! 3382! CONSTANT POOL 3383! 3384des_fp_table: 3385 .word 0 3386 .word -2147483648 3387 .word 8388608 3388 .word -2139095040 3389 .word 32768 3390 .word -2147450880 3391 .word 8421376 3392 .word -2139062272 3393 .word 128 3394 .word -2147483520 3395 .word 8388736 3396 .word -2139094912 3397 .word 32896 3398 .word -2147450752 3399 .word 8421504 3400 .word -2139062144 3401 .word 1073741824 3402 .word -1073741824 3403 .word 1082130432 3404 .word -1065353216 3405 .word 1073774592 3406 .word -1073709056 3407 .word 1082163200 3408 .word -1065320448 3409 .word 1073741952 3410 .word -1073741696 3411 .word 1082130560 3412 .word -1065353088 3413 .word 1073774720 3414 .word -1073708928 3415 .word 1082163328 3416 .word -1065320320 3417 .word 4194304 3418 .word -2143289344 3419 .word 12582912 3420 .word -2134900736 3421 .word 4227072 3422 .word -2143256576 3423 .word 12615680 3424 .word -2134867968 3425 .word 4194432 3426 .word -2143289216 3427 .word 12583040 3428 .word -2134900608 3429 .word 4227200 3430 .word -2143256448 3431 .word 12615808 3432 .word -2134867840 3433 .word 1077936128 3434 .word -1069547520 3435 .word 1086324736 3436 .word -1061158912 3437 .word 1077968896 3438 .word -1069514752 3439 .word 1086357504 3440 .word -1061126144 3441 .word 1077936256 3442 .word -1069547392 3443 .word 1086324864 3444 .word -1061158784 3445 .word 1077969024 3446 .word -1069514624 3447 .word 1086357632 3448 .word -1061126016 3449 .word 16384 3450 .word -2147467264 3451 .word 8404992 3452 .word -2139078656 3453 .word 49152 3454 .word -2147434496 3455 .word 8437760 3456 .word -2139045888 3457 .word 16512 3458 .word -2147467136 3459 .word 8405120 3460 .word -2139078528 3461 .word 49280 3462 .word -2147434368 3463 .word 8437888 3464 .word -2139045760 3465 .word 1073758208 3466 .word -1073725440 3467 .word 1082146816 3468 .word -1065336832 3469 .word 1073790976 3470 .word -1073692672 3471 .word 1082179584 3472 .word -1065304064 3473 .word 1073758336 3474 .word -1073725312 3475 .word 1082146944 3476 .word -1065336704 3477 .word 1073791104 3478 .word -1073692544 3479 .word 1082179712 3480 .word -1065303936 3481 .word 4210688 3482 .word -2143272960 3483 .word 12599296 3484 .word -2134884352 3485 .word 4243456 3486 .word -2143240192 3487 .word 12632064 3488 .word -2134851584 3489 .word 4210816 3490 .word -2143272832 3491 .word 12599424 3492 .word -2134884224 3493 .word 4243584 3494 .word -2143240064 3495 .word 12632192 3496 .word -2134851456 3497 .word 1077952512 3498 .word -1069531136 3499 .word 1086341120 3500 .word -1061142528 3501 .word 1077985280 3502 .word -1069498368 3503 .word 1086373888 3504 .word -1061109760 3505 .word 1077952640 3506 .word -1069531008 3507 .word 1086341248 3508 .word -1061142400 3509 .word 1077985408 3510 .word -1069498240 3511 .word 1086374016 3512 .word -1061109632 3513 .word 64 3514 .word -2147483584 3515 .word 8388672 3516 .word -2139094976 3517 .word 32832 3518 .word -2147450816 3519 .word 8421440 3520 .word -2139062208 3521 .word 192 3522 .word -2147483456 3523 .word 8388800 3524 .word -2139094848 3525 .word 32960 3526 .word -2147450688 3527 .word 8421568 3528 .word -2139062080 3529 .word 1073741888 3530 .word -1073741760 3531 .word 1082130496 3532 .word -1065353152 3533 .word 1073774656 3534 .word -1073708992 3535 .word 1082163264 3536 .word -1065320384 3537 .word 1073742016 3538 .word -1073741632 3539 .word 1082130624 3540 .word -1065353024 3541 .word 1073774784 3542 .word -1073708864 3543 .word 1082163392 3544 .word -1065320256 3545 .word 4194368 3546 .word -2143289280 3547 .word 12582976 3548 .word -2134900672 3549 .word 4227136 3550 .word -2143256512 3551 .word 12615744 3552 .word -2134867904 3553 .word 4194496 3554 .word -2143289152 3555 .word 12583104 3556 .word -2134900544 3557 .word 4227264 3558 .word -2143256384 3559 .word 12615872 3560 .word -2134867776 3561 .word 1077936192 3562 .word -1069547456 3563 .word 1086324800 3564 .word -1061158848 3565 .word 1077968960 3566 .word -1069514688 3567 .word 1086357568 3568 .word -1061126080 3569 .word 1077936320 3570 .word -1069547328 3571 .word 1086324928 3572 .word -1061158720 3573 .word 1077969088 3574 .word -1069514560 3575 .word 1086357696 3576 .word -1061125952 3577 .word 16448 3578 .word -2147467200 3579 .word 8405056 3580 .word -2139078592 3581 .word 49216 3582 .word -2147434432 3583 .word 8437824 3584 .word -2139045824 3585 .word 16576 3586 .word -2147467072 3587 .word 8405184 3588 .word -2139078464 3589 .word 49344 3590 .word -2147434304 3591 .word 8437952 3592 .word -2139045696 3593 .word 1073758272 3594 .word -1073725376 3595 .word 1082146880 3596 .word -1065336768 3597 .word 1073791040 3598 .word -1073692608 3599 .word 1082179648 3600 .word -1065304000 3601 .word 1073758400 3602 .word -1073725248 3603 .word 1082147008 3604 .word -1065336640 3605 .word 1073791168 3606 .word -1073692480 3607 .word 1082179776 3608 .word -1065303872 3609 .word 4210752 3610 .word -2143272896 3611 .word 12599360 3612 .word -2134884288 3613 .word 4243520 3614 .word -2143240128 3615 .word 12632128 3616 .word -2134851520 3617 .word 4210880 3618 .word -2143272768 3619 .word 12599488 3620 .word -2134884160 3621 .word 4243648 3622 .word -2143240000 3623 .word 12632256 3624 .word -2134851392 3625 .word 1077952576 3626 .word -1069531072 3627 .word 1086341184 3628 .word -1061142464 3629 .word 1077985344 3630 .word -1069498304 3631 .word 1086373952 3632 .word -1061109696 3633 .word 1077952704 3634 .word -1069530944 3635 .word 1086341312 3636 .word -1061142336 3637 .word 1077985472 3638 .word -1069498176 3639 .word 1086374080 3640 .word -1061109568 3641 .type des_fp_table,#object 3642 .size des_fp_table,1024 3643 3644#endif /* lint || __lint */ 3645