Lines Matching refs:state

1505 aes_round(v128_t *state, const v128_t *round_key) {  in aes_round()  argument
1511 column0 = T0[state->v8[0]] ^ T1[state->v8[5]] in aes_round()
1512 ^ T2[state->v8[10]] ^ T3[state->v8[15]]; in aes_round()
1514 column1 = T0[state->v8[4]] ^ T1[state->v8[9]] in aes_round()
1515 ^ T2[state->v8[14]] ^ T3[state->v8[3]]; in aes_round()
1517 column2 = T0[state->v8[8]] ^ T1[state->v8[13]] in aes_round()
1518 ^ T2[state->v8[2]] ^ T3[state->v8[7]]; in aes_round()
1520 column3 = T0[state->v8[12]] ^ T1[state->v8[1]] in aes_round()
1521 ^ T2[state->v8[6]] ^ T3[state->v8[11]]; in aes_round()
1523 state->v32[0] = column0 ^ round_key->v32[0]; in aes_round()
1524 state->v32[1] = column1 ^ round_key->v32[1]; in aes_round()
1525 state->v32[2] = column2 ^ round_key->v32[2]; in aes_round()
1526 state->v32[3] = column3 ^ round_key->v32[3]; in aes_round()
1532 aes_inv_round(v128_t *state, const v128_t *round_key) { in aes_inv_round() argument
1538 column0 = U0[state->v8[0]] ^ U1[state->v8[13]] in aes_inv_round()
1539 ^ U2[state->v8[10]] ^ U3[state->v8[7]]; in aes_inv_round()
1541 column1 = U0[state->v8[4]] ^ U1[state->v8[1]] in aes_inv_round()
1542 ^ U2[state->v8[14]] ^ U3[state->v8[11]]; in aes_inv_round()
1544 column2 = U0[state->v8[8]] ^ U1[state->v8[5]] in aes_inv_round()
1545 ^ U2[state->v8[2]] ^ U3[state->v8[15]]; in aes_inv_round()
1547 column3 = U0[state->v8[12]] ^ U1[state->v8[9]] in aes_inv_round()
1548 ^ U2[state->v8[6]] ^ U3[state->v8[3]]; in aes_inv_round()
1550 state->v32[0] = column0 ^ round_key->v32[0]; in aes_inv_round()
1551 state->v32[1] = column1 ^ round_key->v32[1]; in aes_inv_round()
1552 state->v32[2] = column2 ^ round_key->v32[2]; in aes_inv_round()
1553 state->v32[3] = column3 ^ round_key->v32[3]; in aes_inv_round()
1558 aes_final_round(v128_t *state, const v128_t *round_key) { in aes_final_round() argument
1563 state->v8[0] = aes_sbox[state->v8[0]]; in aes_final_round()
1564 state->v8[4] = aes_sbox[state->v8[4]]; in aes_final_round()
1565 state->v8[8] = aes_sbox[state->v8[8]]; in aes_final_round()
1566 state->v8[12] = aes_sbox[state->v8[12]]; in aes_final_round()
1569 tmp = aes_sbox[state->v8[1]]; in aes_final_round()
1570 state->v8[1] = aes_sbox[state->v8[5]]; in aes_final_round()
1571 state->v8[5] = aes_sbox[state->v8[9]]; in aes_final_round()
1572 state->v8[9] = aes_sbox[state->v8[13]]; in aes_final_round()
1573 state->v8[13] = tmp; in aes_final_round()
1576 tmp = aes_sbox[state->v8[10]]; in aes_final_round()
1577 state->v8[10] = aes_sbox[state->v8[2]]; in aes_final_round()
1578 state->v8[2] = tmp; in aes_final_round()
1579 tmp = aes_sbox[state->v8[14]]; in aes_final_round()
1580 state->v8[14] = aes_sbox[state->v8[6]]; in aes_final_round()
1581 state->v8[6] = tmp; in aes_final_round()
1584 tmp = aes_sbox[state->v8[15]]; in aes_final_round()
1585 state->v8[15] = aes_sbox[state->v8[11]]; in aes_final_round()
1586 state->v8[11] = aes_sbox[state->v8[7]]; in aes_final_round()
1587 state->v8[7] = aes_sbox[state->v8[3]]; in aes_final_round()
1588 state->v8[3] = tmp; in aes_final_round()
1590 v128_xor_eq(state, round_key); in aes_final_round()
1594 aes_inv_final_round(v128_t *state, const v128_t *round_key) { in aes_inv_final_round() argument
1599 state->v8[0] = aes_inv_sbox[state->v8[0]]; in aes_inv_final_round()
1600 state->v8[4] = aes_inv_sbox[state->v8[4]]; in aes_inv_final_round()
1601 state->v8[8] = aes_inv_sbox[state->v8[8]]; in aes_inv_final_round()
1602 state->v8[12] = aes_inv_sbox[state->v8[12]]; in aes_inv_final_round()
1605 tmp = aes_inv_sbox[state->v8[13]]; in aes_inv_final_round()
1606 state->v8[13] = aes_inv_sbox[state->v8[9]]; in aes_inv_final_round()
1607 state->v8[9] = aes_inv_sbox[state->v8[5]]; in aes_inv_final_round()
1608 state->v8[5] = aes_inv_sbox[state->v8[1]]; in aes_inv_final_round()
1609 state->v8[1] = tmp; in aes_inv_final_round()
1612 tmp = aes_inv_sbox[state->v8[2]]; in aes_inv_final_round()
1613 state->v8[2] = aes_inv_sbox[state->v8[10]]; in aes_inv_final_round()
1614 state->v8[10] = tmp; in aes_inv_final_round()
1615 tmp = aes_inv_sbox[state->v8[6]]; in aes_inv_final_round()
1616 state->v8[6] = aes_inv_sbox[state->v8[14]]; in aes_inv_final_round()
1617 state->v8[14] = tmp; in aes_inv_final_round()
1620 tmp = aes_inv_sbox[state->v8[3]]; in aes_inv_final_round()
1621 state->v8[3] = aes_inv_sbox[state->v8[7]]; in aes_inv_final_round()
1622 state->v8[7] = aes_inv_sbox[state->v8[11]]; in aes_inv_final_round()
1623 state->v8[11] = aes_inv_sbox[state->v8[15]]; in aes_inv_final_round()
1624 state->v8[15] = tmp; in aes_inv_final_round()
1626 v128_xor_eq(state, round_key); in aes_inv_final_round()
1633 aes_round(v128_t *state, const v128_t *round_key) { in aes_round() argument
1639 column0 = T0[state->v32[0] >> 24] ^ T1[(state->v32[1] >> 16) & 0xff] in aes_round()
1640 ^ T2[(state->v32[2] >> 8) & 0xff] ^ T3[state->v32[3] & 0xff]; in aes_round()
1642 column1 = T0[state->v32[1] >> 24] ^ T1[(state->v32[2] >> 16) & 0xff] in aes_round()
1643 ^ T2[(state->v32[3] >> 8) & 0xff] ^ T3[state->v32[0] & 0xff]; in aes_round()
1645 column2 = T0[state->v32[2] >> 24] ^ T1[(state->v32[3] >> 16) & 0xff] in aes_round()
1646 ^ T2[(state->v32[0] >> 8) & 0xff] ^ T3[state->v32[1] & 0xff]; in aes_round()
1648 column3 = T0[state->v32[3] >> 24] ^ T1[(state->v32[0] >> 16) & 0xff] in aes_round()
1649 ^ T2[(state->v32[1] >> 8) & 0xff] ^ T3[state->v32[2] & 0xff]; in aes_round()
1651 column0 = T0[state->v32[0] & 0xff] ^ T1[(state->v32[1] >> 8) & 0xff] in aes_round()
1652 ^ T2[(state->v32[2] >> 16) & 0xff] ^ T3[state->v32[3] >> 24]; in aes_round()
1654 column1 = T0[state->v32[1] & 0xff] ^ T1[(state->v32[2] >> 8) & 0xff] in aes_round()
1655 ^ T2[(state->v32[3] >> 16) & 0xff] ^ T3[state->v32[0] >> 24]; in aes_round()
1657 column2 = T0[state->v32[2] & 0xff] ^ T1[(state->v32[3] >> 8) & 0xff] in aes_round()
1658 ^ T2[(state->v32[0] >> 16) & 0xff] ^ T3[state->v32[1] >> 24]; in aes_round()
1660 column3 = T0[state->v32[3] & 0xff] ^ T1[(state->v32[0] >> 8) & 0xff] in aes_round()
1661 ^ T2[(state->v32[1] >> 16) & 0xff] ^ T3[state->v32[2] >> 24]; in aes_round()
1664 state->v32[0] = column0 ^ round_key->v32[0]; in aes_round()
1665 state->v32[1] = column1 ^ round_key->v32[1]; in aes_round()
1666 state->v32[2] = column2 ^ round_key->v32[2]; in aes_round()
1667 state->v32[3] = column3 ^ round_key->v32[3]; in aes_round()
1672 aes_inv_round(v128_t *state, const v128_t *round_key) { in aes_inv_round() argument
1680 column0 = U0[state->v32[0] >> 24] ^ U1[(state->v32[3] >> 16) & 0xff] in aes_inv_round()
1681 ^ U2[(state->v32[2] >> 8) & 0xff] ^ U3[state->v32[1] & 0xff]; in aes_inv_round()
1683 column1 = U0[state->v32[1] >> 24] ^ U1[(state->v32[0] >> 16) & 0xff] in aes_inv_round()
1684 ^ U2[(state->v32[3] >> 8) & 0xff] ^ U3[state->v32[2] & 0xff]; in aes_inv_round()
1686 column2 = U0[state->v32[2] >> 24] ^ U1[(state->v32[1] >> 16) & 0xff] in aes_inv_round()
1687 ^ U2[(state->v32[0] >> 8) & 0xff] ^ U3[state->v32[3] & 0xff]; in aes_inv_round()
1689 column3 = U0[state->v32[3] >> 24] ^ U1[(state->v32[2] >> 16) & 0xff] in aes_inv_round()
1690 ^ U2[(state->v32[1] >> 8) & 0xff] ^ U3[state->v32[0] & 0xff]; in aes_inv_round()
1692 column0 = U0[state->v32[0] & 0xff] ^ U1[(state->v32[1] >> 8) & 0xff] in aes_inv_round()
1693 ^ U2[(state->v32[2] >> 16) & 0xff] ^ U3[state->v32[3] >> 24]; in aes_inv_round()
1695 column1 = U0[state->v32[1] & 0xff] ^ U1[(state->v32[2] >> 8) & 0xff] in aes_inv_round()
1696 ^ U2[(state->v32[3] >> 16) & 0xff] ^ U3[state->v32[0] >> 24]; in aes_inv_round()
1698 column2 = U0[state->v32[2] & 0xff] ^ U1[(state->v32[3] >> 8) & 0xff] in aes_inv_round()
1699 ^ U2[(state->v32[0] >> 16) & 0xff] ^ U3[state->v32[1] >> 24]; in aes_inv_round()
1701 column3 = U0[state->v32[3] & 0xff] ^ U1[(state->v32[0] >> 8) & 0xff] in aes_inv_round()
1702 ^ U2[(state->v32[1] >> 16) & 0xff] ^ U3[state->v32[2] >> 24]; in aes_inv_round()
1705 state->v32[0] = column0 ^ round_key->v32[0]; in aes_inv_round()
1706 state->v32[1] = column1 ^ round_key->v32[1]; in aes_inv_round()
1707 state->v32[2] = column2 ^ round_key->v32[2]; in aes_inv_round()
1708 state->v32[3] = column3 ^ round_key->v32[3]; in aes_inv_round()
1713 aes_final_round(v128_t *state, const v128_t *round_key) { in aes_final_round() argument
1716 tmp0 = (T4[(state->v32[0] >> 24)] & 0xff000000) in aes_final_round()
1717 ^ (T4[(state->v32[1] >> 16) & 0xff] & 0x00ff0000) in aes_final_round()
1718 ^ (T4[(state->v32[2] >> 8) & 0xff] & 0x0000ff00) in aes_final_round()
1719 ^ (T4[(state->v32[3] ) & 0xff] & 0x000000ff) in aes_final_round()
1722 tmp1 = (T4[(state->v32[1] >> 24)] & 0xff000000) in aes_final_round()
1723 ^ (T4[(state->v32[2] >> 16) & 0xff] & 0x00ff0000) in aes_final_round()
1724 ^ (T4[(state->v32[3] >> 8) & 0xff] & 0x0000ff00) in aes_final_round()
1725 ^ (T4[(state->v32[0] ) & 0xff] & 0x000000ff) in aes_final_round()
1728 tmp2 = (T4[(state->v32[2] >> 24)] & 0xff000000) in aes_final_round()
1729 ^ (T4[(state->v32[3] >> 16) & 0xff] & 0x00ff0000) in aes_final_round()
1730 ^ (T4[(state->v32[0] >> 8) & 0xff] & 0x0000ff00) in aes_final_round()
1731 ^ (T4[(state->v32[1] ) & 0xff] & 0x000000ff) in aes_final_round()
1734 tmp3 = (T4[(state->v32[3] >> 24)] & 0xff000000) in aes_final_round()
1735 ^ (T4[(state->v32[0] >> 16) & 0xff] & 0x00ff0000) in aes_final_round()
1736 ^ (T4[(state->v32[1] >> 8) & 0xff] & 0x0000ff00) in aes_final_round()
1737 ^ (T4[(state->v32[2] ) & 0xff] & 0x000000ff) in aes_final_round()
1740 state->v32[0] = tmp0; in aes_final_round()
1741 state->v32[1] = tmp1; in aes_final_round()
1742 state->v32[2] = tmp2; in aes_final_round()
1743 state->v32[3] = tmp3; in aes_final_round()
1748 aes_inv_final_round(v128_t *state, const v128_t *round_key) { in aes_inv_final_round() argument
1751 tmp0 = (U4[(state->v32[0] >> 24)] & 0xff000000) in aes_inv_final_round()
1752 ^ (U4[(state->v32[3] >> 16) & 0xff] & 0x00ff0000) in aes_inv_final_round()
1753 ^ (U4[(state->v32[2] >> 8) & 0xff] & 0x0000ff00) in aes_inv_final_round()
1754 ^ (U4[(state->v32[1] ) & 0xff] & 0x000000ff) in aes_inv_final_round()
1757 tmp1 = (U4[(state->v32[1] >> 24)] & 0xff000000) in aes_inv_final_round()
1758 ^ (U4[(state->v32[0] >> 16) & 0xff] & 0x00ff0000) in aes_inv_final_round()
1759 ^ (U4[(state->v32[3] >> 8) & 0xff] & 0x0000ff00) in aes_inv_final_round()
1760 ^ (U4[(state->v32[2] ) & 0xff] & 0x000000ff) in aes_inv_final_round()
1763 tmp2 = (U4[(state->v32[2] >> 24)] & 0xff000000) in aes_inv_final_round()
1764 ^ (U4[(state->v32[1] >> 16) & 0xff] & 0x00ff0000) in aes_inv_final_round()
1765 ^ (U4[(state->v32[0] >> 8) & 0xff] & 0x0000ff00) in aes_inv_final_round()
1766 ^ (U4[(state->v32[3] ) & 0xff] & 0x000000ff) in aes_inv_final_round()
1769 tmp3 = (U4[(state->v32[3] >> 24)] & 0xff000000) in aes_inv_final_round()
1770 ^ (U4[(state->v32[2] >> 16) & 0xff] & 0x00ff0000) in aes_inv_final_round()
1771 ^ (U4[(state->v32[1] >> 8) & 0xff] & 0x0000ff00) in aes_inv_final_round()
1772 ^ (U4[(state->v32[0] ) & 0xff] & 0x000000ff) in aes_inv_final_round()
1775 state->v32[0] = tmp0; in aes_inv_final_round()
1776 state->v32[1] = tmp1; in aes_inv_final_round()
1777 state->v32[2] = tmp2; in aes_inv_final_round()
1778 state->v32[3] = tmp3; in aes_inv_final_round()
1785 aes_round(v128_t *state, const v128_t *round_key) { in aes_round() argument
1791 column0 = T0[state->v8[0]] ^ T1[state->v8[5]] in aes_round()
1792 ^ T2[state->v8[10]] ^ T3[state->v8[15]]; in aes_round()
1794 column1 = T0[state->v8[4]] ^ T1[state->v8[9]] in aes_round()
1795 ^ T2[state->v8[14]] ^ T3[state->v8[3]]; in aes_round()
1797 column2 = T0[state->v8[8]] ^ T1[state->v8[13]] in aes_round()
1798 ^ T2[state->v8[2]] ^ T3[state->v8[7]]; in aes_round()
1800 column3 = T0[state->v8[12]] ^ T1[state->v8[1]] in aes_round()
1801 ^ T2[state->v8[6]] ^ T3[state->v8[11]]; in aes_round()
1803 state->v32[0] = column0 ^ round_key->v32[0]; in aes_round()
1804 state->v32[1] = column1 ^ round_key->v32[1]; in aes_round()
1805 state->v32[2] = column2 ^ round_key->v32[2]; in aes_round()
1806 state->v32[3] = column3 ^ round_key->v32[3]; in aes_round()
1812 aes_inv_round(v128_t *state, const v128_t *round_key) { in aes_inv_round() argument
1818 column0 = U0[state->v8[0]] ^ U1[state->v8[5]] in aes_inv_round()
1819 ^ U2[state->v8[10]] ^ U3[state->v8[15]]; in aes_inv_round()
1821 column1 = U0[state->v8[4]] ^ U1[state->v8[9]] in aes_inv_round()
1822 ^ U2[state->v8[14]] ^ U3[state->v8[3]]; in aes_inv_round()
1824 column2 = U0[state->v8[8]] ^ U1[state->v8[13]] in aes_inv_round()
1825 ^ U2[state->v8[2]] ^ U3[state->v8[7]]; in aes_inv_round()
1827 column3 = U0[state->v8[12]] ^ U1[state->v8[1]] in aes_inv_round()
1828 ^ U2[state->v8[6]] ^ U3[state->v8[11]]; in aes_inv_round()
1830 state->v32[0] = column0 ^ round_key->v32[0]; in aes_inv_round()
1831 state->v32[1] = column1 ^ round_key->v32[1]; in aes_inv_round()
1832 state->v32[2] = column2 ^ round_key->v32[2]; in aes_inv_round()
1833 state->v32[3] = column3 ^ round_key->v32[3]; in aes_inv_round()
1838 aes_final_round(v128_t *state, const v128_t *round_key) { in aes_final_round() argument
1843 state->v8[0] = aes_sbox[state->v8[0]]; in aes_final_round()
1844 state->v8[4] = aes_sbox[state->v8[4]]; in aes_final_round()
1845 state->v8[8] = aes_sbox[state->v8[8]]; in aes_final_round()
1846 state->v8[12] = aes_sbox[state->v8[12]]; in aes_final_round()
1849 tmp = aes_sbox[state->v8[1]]; in aes_final_round()
1850 state->v8[1] = aes_sbox[state->v8[5]]; in aes_final_round()
1851 state->v8[5] = aes_sbox[state->v8[9]]; in aes_final_round()
1852 state->v8[9] = aes_sbox[state->v8[13]]; in aes_final_round()
1853 state->v8[13] = tmp; in aes_final_round()
1856 tmp = aes_sbox[state->v8[10]]; in aes_final_round()
1857 state->v8[10] = aes_sbox[state->v8[2]]; in aes_final_round()
1858 state->v8[2] = tmp; in aes_final_round()
1859 tmp = aes_sbox[state->v8[14]]; in aes_final_round()
1860 state->v8[14] = aes_sbox[state->v8[6]]; in aes_final_round()
1861 state->v8[6] = tmp; in aes_final_round()
1864 tmp = aes_sbox[state->v8[15]]; in aes_final_round()
1865 state->v8[15] = aes_sbox[state->v8[11]]; in aes_final_round()
1866 state->v8[11] = aes_sbox[state->v8[7]]; in aes_final_round()
1867 state->v8[7] = aes_sbox[state->v8[3]]; in aes_final_round()
1868 state->v8[3] = tmp; in aes_final_round()
1870 v128_xor_eq(state, round_key); in aes_final_round()
1874 aes_inv_final_round(v128_t *state, const v128_t *round_key) { in aes_inv_final_round() argument
1879 state->v8[0] = aes_inv_sbox[state->v8[0]]; in aes_inv_final_round()
1880 state->v8[4] = aes_inv_sbox[state->v8[4]]; in aes_inv_final_round()
1881 state->v8[8] = aes_inv_sbox[state->v8[8]]; in aes_inv_final_round()
1882 state->v8[12] = aes_inv_sbox[state->v8[12]]; in aes_inv_final_round()
1885 tmp = aes_inv_sbox[state->v8[1]]; in aes_inv_final_round()
1886 state->v8[1] = aes_inv_sbox[state->v8[5]]; in aes_inv_final_round()
1887 state->v8[5] = aes_inv_sbox[state->v8[9]]; in aes_inv_final_round()
1888 state->v8[9] = aes_inv_sbox[state->v8[13]]; in aes_inv_final_round()
1889 state->v8[13] = tmp; in aes_inv_final_round()
1892 tmp = aes_inv_sbox[state->v8[10]]; in aes_inv_final_round()
1893 state->v8[10] = aes_inv_sbox[state->v8[2]]; in aes_inv_final_round()
1894 state->v8[2] = tmp; in aes_inv_final_round()
1895 tmp = aes_inv_sbox[state->v8[14]]; in aes_inv_final_round()
1896 state->v8[14] = aes_inv_sbox[state->v8[6]]; in aes_inv_final_round()
1897 state->v8[6] = tmp; in aes_inv_final_round()
1900 tmp = aes_inv_sbox[state->v8[15]]; in aes_inv_final_round()
1901 state->v8[15] = aes_inv_sbox[state->v8[11]]; in aes_inv_final_round()
1902 state->v8[11] = aes_inv_sbox[state->v8[7]]; in aes_inv_final_round()
1903 state->v8[7] = aes_inv_sbox[state->v8[3]]; in aes_inv_final_round()
1904 state->v8[3] = tmp; in aes_inv_final_round()
1906 v128_xor_eq(state, round_key); in aes_inv_final_round()