2 * Copyright 2004-2022 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * https://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * Portions Copyright (c) 2022 Tino Reichardt <milky-zfs@mcmilk.de>
19 * - modified assembly to fit into OpenZFS
22 #if (defined(__PPC64__) && defined(__BIG_ENDIAN__))
24 #if (!defined(_CALL_ELF) || _CALL_ELF == 1)
27 .globl zfs_sha512_power8
28 .globl .zfs_sha512_power8
29 .type zfs_sha512_power8,@function
33 .quad .zfs_sha512_power8,.TOC.@tocbase,0
41 .globl zfs_sha512_power8
42 .type zfs_sha512_power8,@function
45 .localentry zfs_sha512_power8,0
692 .byte 0,12,4,1,0x80,6,3,0
694 #if (!defined(_CALL_ELF) || _CALL_ELF == 1)
695 .size .zfs_sha512_power8,.-.zfs_sha512_power8
696 .size zfs_sha512_power8,.-.zfs_sha512_power8
698 .size zfs_sha512_power8,.-zfs_sha512_power8
709 .byte 0,12,0x14,0,0,0,0,0
711 .long 0x428a2f98,0xd728ae22
712 .long 0x428a2f98,0xd728ae22
713 .long 0x71374491,0x23ef65cd
714 .long 0x71374491,0x23ef65cd
715 .long 0xb5c0fbcf,0xec4d3b2f
716 .long 0xb5c0fbcf,0xec4d3b2f
717 .long 0xe9b5dba5,0x8189dbbc
718 .long 0xe9b5dba5,0x8189dbbc
719 .long 0x3956c25b,0xf348b538
720 .long 0x3956c25b,0xf348b538
721 .long 0x59f111f1,0xb605d019
722 .long 0x59f111f1,0xb605d019
723 .long 0x923f82a4,0xaf194f9b
724 .long 0x923f82a4,0xaf194f9b
725 .long 0xab1c5ed5,0xda6d8118
726 .long 0xab1c5ed5,0xda6d8118
727 .long 0xd807aa98,0xa3030242
728 .long 0xd807aa98,0xa3030242
729 .long 0x12835b01,0x45706fbe
730 .long 0x12835b01,0x45706fbe
731 .long 0x243185be,0x4ee4b28c
732 .long 0x243185be,0x4ee4b28c
733 .long 0x550c7dc3,0xd5ffb4e2
734 .long 0x550c7dc3,0xd5ffb4e2
735 .long 0x72be5d74,0xf27b896f
736 .long 0x72be5d74,0xf27b896f
737 .long 0x80deb1fe,0x3b1696b1
738 .long 0x80deb1fe,0x3b1696b1
739 .long 0x9bdc06a7,0x25c71235
740 .long 0x9bdc06a7,0x25c71235
741 .long 0xc19bf174,0xcf692694
742 .long 0xc19bf174,0xcf692694
743 .long 0xe49b69c1,0x9ef14ad2
744 .long 0xe49b69c1,0x9ef14ad2
745 .long 0xefbe4786,0x384f25e3
746 .long 0xefbe4786,0x384f25e3
747 .long 0x0fc19dc6,0x8b8cd5b5
748 .long 0x0fc19dc6,0x8b8cd5b5
749 .long 0x240ca1cc,0x77ac9c65
750 .long 0x240ca1cc,0x77ac9c65
751 .long 0x2de92c6f,0x592b0275
752 .long 0x2de92c6f,0x592b0275
753 .long 0x4a7484aa,0x6ea6e483
754 .long 0x4a7484aa,0x6ea6e483
755 .long 0x5cb0a9dc,0xbd41fbd4
756 .long 0x5cb0a9dc,0xbd41fbd4
757 .long 0x76f988da,0x831153b5
758 .long 0x76f988da,0x831153b5
759 .long 0x983e5152,0xee66dfab
760 .long 0x983e5152,0xee66dfab
761 .long 0xa831c66d,0x2db43210
762 .long 0xa831c66d,0x2db43210
763 .long 0xb00327c8,0x98fb213f
764 .long 0xb00327c8,0x98fb213f
765 .long 0xbf597fc7,0xbeef0ee4
766 .long 0xbf597fc7,0xbeef0ee4
767 .long 0xc6e00bf3,0x3da88fc2
768 .long 0xc6e00bf3,0x3da88fc2
769 .long 0xd5a79147,0x930aa725
770 .long 0xd5a79147,0x930aa725
771 .long 0x06ca6351,0xe003826f
772 .long 0x06ca6351,0xe003826f
773 .long 0x14292967,0x0a0e6e70
774 .long 0x14292967,0x0a0e6e70
775 .long 0x27b70a85,0x46d22ffc
776 .long 0x27b70a85,0x46d22ffc
777 .long 0x2e1b2138,0x5c26c926
778 .long 0x2e1b2138,0x5c26c926
779 .long 0x4d2c6dfc,0x5ac42aed
780 .long 0x4d2c6dfc,0x5ac42aed
781 .long 0x53380d13,0x9d95b3df
782 .long 0x53380d13,0x9d95b3df
783 .long 0x650a7354,0x8baf63de
784 .long 0x650a7354,0x8baf63de
785 .long 0x766a0abb,0x3c77b2a8
786 .long 0x766a0abb,0x3c77b2a8
787 .long 0x81c2c92e,0x47edaee6
788 .long 0x81c2c92e,0x47edaee6
789 .long 0x92722c85,0x1482353b
790 .long 0x92722c85,0x1482353b
791 .long 0xa2bfe8a1,0x4cf10364
792 .long 0xa2bfe8a1,0x4cf10364
793 .long 0xa81a664b,0xbc423001
794 .long 0xa81a664b,0xbc423001
795 .long 0xc24b8b70,0xd0f89791
796 .long 0xc24b8b70,0xd0f89791
797 .long 0xc76c51a3,0x0654be30
798 .long 0xc76c51a3,0x0654be30
799 .long 0xd192e819,0xd6ef5218
800 .long 0xd192e819,0xd6ef5218
801 .long 0xd6990624,0x5565a910
802 .long 0xd6990624,0x5565a910
803 .long 0xf40e3585,0x5771202a
804 .long 0xf40e3585,0x5771202a
805 .long 0x106aa070,0x32bbd1b8
806 .long 0x106aa070,0x32bbd1b8
807 .long 0x19a4c116,0xb8d2d0c8
808 .long 0x19a4c116,0xb8d2d0c8
809 .long 0x1e376c08,0x5141ab53
810 .long 0x1e376c08,0x5141ab53
811 .long 0x2748774c,0xdf8eeb99
812 .long 0x2748774c,0xdf8eeb99
813 .long 0x34b0bcb5,0xe19b48a8
814 .long 0x34b0bcb5,0xe19b48a8
815 .long 0x391c0cb3,0xc5c95a63
816 .long 0x391c0cb3,0xc5c95a63
817 .long 0x4ed8aa4a,0xe3418acb
818 .long 0x4ed8aa4a,0xe3418acb
819 .long 0x5b9cca4f,0x7763e373
820 .long 0x5b9cca4f,0x7763e373
821 .long 0x682e6ff3,0xd6b2b8a3
822 .long 0x682e6ff3,0xd6b2b8a3
823 .long 0x748f82ee,0x5defb2fc
824 .long 0x748f82ee,0x5defb2fc
825 .long 0x78a5636f,0x43172f60
826 .long 0x78a5636f,0x43172f60
827 .long 0x84c87814,0xa1f0ab72
828 .long 0x84c87814,0xa1f0ab72
829 .long 0x8cc70208,0x1a6439ec
830 .long 0x8cc70208,0x1a6439ec
831 .long 0x90befffa,0x23631e28
832 .long 0x90befffa,0x23631e28
833 .long 0xa4506ceb,0xde82bde9
834 .long 0xa4506ceb,0xde82bde9
835 .long 0xbef9a3f7,0xb2c67915
836 .long 0xbef9a3f7,0xb2c67915
837 .long 0xc67178f2,0xe372532b
838 .long 0xc67178f2,0xe372532b
839 .long 0xca273ece,0xea26619c
840 .long 0xca273ece,0xea26619c
841 .long 0xd186b8c7,0x21c0c207
842 .long 0xd186b8c7,0x21c0c207
843 .long 0xeada7dd6,0xcde0eb1e
844 .long 0xeada7dd6,0xcde0eb1e
845 .long 0xf57d4f7f,0xee6ed178
846 .long 0xf57d4f7f,0xee6ed178
847 .long 0x06f067aa,0x72176fba
848 .long 0x06f067aa,0x72176fba
849 .long 0x0a637dc5,0xa2c898a6
850 .long 0x0a637dc5,0xa2c898a6
851 .long 0x113f9804,0xbef90dae
852 .long 0x113f9804,0xbef90dae
853 .long 0x1b710b35,0x131c471b
854 .long 0x1b710b35,0x131c471b
855 .long 0x28db77f5,0x23047d84
856 .long 0x28db77f5,0x23047d84
857 .long 0x32caab7b,0x40c72493
858 .long 0x32caab7b,0x40c72493
859 .long 0x3c9ebe0a,0x15c9bebc
860 .long 0x3c9ebe0a,0x15c9bebc
861 .long 0x431d67c4,0x9c100d4c
862 .long 0x431d67c4,0x9c100d4c
863 .long 0x4cc5d4be,0xcb3e42b6
864 .long 0x4cc5d4be,0xcb3e42b6
865 .long 0x597f299c,0xfc657e2a
866 .long 0x597f299c,0xfc657e2a
867 .long 0x5fcb6fab,0x3ad6faec
868 .long 0x5fcb6fab,0x3ad6faec
869 .long 0x6c44198c,0x4a475817
870 .long 0x6c44198c,0x4a475817
873 .long 0x00010203,0x04050607
874 .long 0x10111213,0x14151617
876 #elif (defined(__PPC64__) && defined(__LITTLE_ENDIAN__))
881 .globl zfs_sha512_power8
882 .type zfs_sha512_power8,@function
885 .localentry zfs_sha512_power8,0
1543 .byte 0,12,4,1,0x80,6,3,0
1545 .size zfs_sha512_power8,.-zfs_sha512_power8
1555 .byte 0,12,0x14,0,0,0,0,0
1557 .long 0xd728ae22,0x428a2f98
1558 .long 0xd728ae22,0x428a2f98
1559 .long 0x23ef65cd,0x71374491
1560 .long 0x23ef65cd,0x71374491
1561 .long 0xec4d3b2f,0xb5c0fbcf
1562 .long 0xec4d3b2f,0xb5c0fbcf
1563 .long 0x8189dbbc,0xe9b5dba5
1564 .long 0x8189dbbc,0xe9b5dba5
1565 .long 0xf348b538,0x3956c25b
1566 .long 0xf348b538,0x3956c25b
1567 .long 0xb605d019,0x59f111f1
1568 .long 0xb605d019,0x59f111f1
1569 .long 0xaf194f9b,0x923f82a4
1570 .long 0xaf194f9b,0x923f82a4
1571 .long 0xda6d8118,0xab1c5ed5
1572 .long 0xda6d8118,0xab1c5ed5
1573 .long 0xa3030242,0xd807aa98
1574 .long 0xa3030242,0xd807aa98
1575 .long 0x45706fbe,0x12835b01
1576 .long 0x45706fbe,0x12835b01
1577 .long 0x4ee4b28c,0x243185be
1578 .long 0x4ee4b28c,0x243185be
1579 .long 0xd5ffb4e2,0x550c7dc3
1580 .long 0xd5ffb4e2,0x550c7dc3
1581 .long 0xf27b896f,0x72be5d74
1582 .long 0xf27b896f,0x72be5d74
1583 .long 0x3b1696b1,0x80deb1fe
1584 .long 0x3b1696b1,0x80deb1fe
1585 .long 0x25c71235,0x9bdc06a7
1586 .long 0x25c71235,0x9bdc06a7
1587 .long 0xcf692694,0xc19bf174
1588 .long 0xcf692694,0xc19bf174
1589 .long 0x9ef14ad2,0xe49b69c1
1590 .long 0x9ef14ad2,0xe49b69c1
1591 .long 0x384f25e3,0xefbe4786
1592 .long 0x384f25e3,0xefbe4786
1593 .long 0x8b8cd5b5,0x0fc19dc6
1594 .long 0x8b8cd5b5,0x0fc19dc6
1595 .long 0x77ac9c65,0x240ca1cc
1596 .long 0x77ac9c65,0x240ca1cc
1597 .long 0x592b0275,0x2de92c6f
1598 .long 0x592b0275,0x2de92c6f
1599 .long 0x6ea6e483,0x4a7484aa
1600 .long 0x6ea6e483,0x4a7484aa
1601 .long 0xbd41fbd4,0x5cb0a9dc
1602 .long 0xbd41fbd4,0x5cb0a9dc
1603 .long 0x831153b5,0x76f988da
1604 .long 0x831153b5,0x76f988da
1605 .long 0xee66dfab,0x983e5152
1606 .long 0xee66dfab,0x983e5152
1607 .long 0x2db43210,0xa831c66d
1608 .long 0x2db43210,0xa831c66d
1609 .long 0x98fb213f,0xb00327c8
1610 .long 0x98fb213f,0xb00327c8
1611 .long 0xbeef0ee4,0xbf597fc7
1612 .long 0xbeef0ee4,0xbf597fc7
1613 .long 0x3da88fc2,0xc6e00bf3
1614 .long 0x3da88fc2,0xc6e00bf3
1615 .long 0x930aa725,0xd5a79147
1616 .long 0x930aa725,0xd5a79147
1617 .long 0xe003826f,0x06ca6351
1618 .long 0xe003826f,0x06ca6351
1619 .long 0x0a0e6e70,0x14292967
1620 .long 0x0a0e6e70,0x14292967
1621 .long 0x46d22ffc,0x27b70a85
1622 .long 0x46d22ffc,0x27b70a85
1623 .long 0x5c26c926,0x2e1b2138
1624 .long 0x5c26c926,0x2e1b2138
1625 .long 0x5ac42aed,0x4d2c6dfc
1626 .long 0x5ac42aed,0x4d2c6dfc
1627 .long 0x9d95b3df,0x53380d13
1628 .long 0x9d95b3df,0x53380d13
1629 .long 0x8baf63de,0x650a7354
1630 .long 0x8baf63de,0x650a7354
1631 .long 0x3c77b2a8,0x766a0abb
1632 .long 0x3c77b2a8,0x766a0abb
1633 .long 0x47edaee6,0x81c2c92e
1634 .long 0x47edaee6,0x81c2c92e
1635 .long 0x1482353b,0x92722c85
1636 .long 0x1482353b,0x92722c85
1637 .long 0x4cf10364,0xa2bfe8a1
1638 .long 0x4cf10364,0xa2bfe8a1
1639 .long 0xbc423001,0xa81a664b
1640 .long 0xbc423001,0xa81a664b
1641 .long 0xd0f89791,0xc24b8b70
1642 .long 0xd0f89791,0xc24b8b70
1643 .long 0x0654be30,0xc76c51a3
1644 .long 0x0654be30,0xc76c51a3
1645 .long 0xd6ef5218,0xd192e819
1646 .long 0xd6ef5218,0xd192e819
1647 .long 0x5565a910,0xd6990624
1648 .long 0x5565a910,0xd6990624
1649 .long 0x5771202a,0xf40e3585
1650 .long 0x5771202a,0xf40e3585
1651 .long 0x32bbd1b8,0x106aa070
1652 .long 0x32bbd1b8,0x106aa070
1653 .long 0xb8d2d0c8,0x19a4c116
1654 .long 0xb8d2d0c8,0x19a4c116
1655 .long 0x5141ab53,0x1e376c08
1656 .long 0x5141ab53,0x1e376c08
1657 .long 0xdf8eeb99,0x2748774c
1658 .long 0xdf8eeb99,0x2748774c
1659 .long 0xe19b48a8,0x34b0bcb5
1660 .long 0xe19b48a8,0x34b0bcb5
1661 .long 0xc5c95a63,0x391c0cb3
1662 .long 0xc5c95a63,0x391c0cb3
1663 .long 0xe3418acb,0x4ed8aa4a
1664 .long 0xe3418acb,0x4ed8aa4a
1665 .long 0x7763e373,0x5b9cca4f
1666 .long 0x7763e373,0x5b9cca4f
1667 .long 0xd6b2b8a3,0x682e6ff3
1668 .long 0xd6b2b8a3,0x682e6ff3
1669 .long 0x5defb2fc,0x748f82ee
1670 .long 0x5defb2fc,0x748f82ee
1671 .long 0x43172f60,0x78a5636f
1672 .long 0x43172f60,0x78a5636f
1673 .long 0xa1f0ab72,0x84c87814
1674 .long 0xa1f0ab72,0x84c87814
1675 .long 0x1a6439ec,0x8cc70208
1676 .long 0x1a6439ec,0x8cc70208
1677 .long 0x23631e28,0x90befffa
1678 .long 0x23631e28,0x90befffa
1679 .long 0xde82bde9,0xa4506ceb
1680 .long 0xde82bde9,0xa4506ceb
1681 .long 0xb2c67915,0xbef9a3f7
1682 .long 0xb2c67915,0xbef9a3f7
1683 .long 0xe372532b,0xc67178f2
1684 .long 0xe372532b,0xc67178f2
1685 .long 0xea26619c,0xca273ece
1686 .long 0xea26619c,0xca273ece
1687 .long 0x21c0c207,0xd186b8c7
1688 .long 0x21c0c207,0xd186b8c7
1689 .long 0xcde0eb1e,0xeada7dd6
1690 .long 0xcde0eb1e,0xeada7dd6
1691 .long 0xee6ed178,0xf57d4f7f
1692 .long 0xee6ed178,0xf57d4f7f
1693 .long 0x72176fba,0x06f067aa
1694 .long 0x72176fba,0x06f067aa
1695 .long 0xa2c898a6,0x0a637dc5
1696 .long 0xa2c898a6,0x0a637dc5
1697 .long 0xbef90dae,0x113f9804
1698 .long 0xbef90dae,0x113f9804
1699 .long 0x131c471b,0x1b710b35
1700 .long 0x131c471b,0x1b710b35
1701 .long 0x23047d84,0x28db77f5
1702 .long 0x23047d84,0x28db77f5
1703 .long 0x40c72493,0x32caab7b
1704 .long 0x40c72493,0x32caab7b
1705 .long 0x15c9bebc,0x3c9ebe0a
1706 .long 0x15c9bebc,0x3c9ebe0a
1707 .long 0x9c100d4c,0x431d67c4
1708 .long 0x9c100d4c,0x431d67c4
1709 .long 0xcb3e42b6,0x4cc5d4be
1710 .long 0xcb3e42b6,0x4cc5d4be
1711 .long 0xfc657e2a,0x597f299c
1712 .long 0xfc657e2a,0x597f299c
1713 .long 0x3ad6faec,0x5fcb6fab
1714 .long 0x3ad6faec,0x5fcb6fab
1715 .long 0x4a475817,0x6c44198c
1716 .long 0x4a475817,0x6c44198c
1719 .long 0x14151617,0x10111213
1720 .long 0x04050607,0x00010203