1 dnl AES_LOAD(a, b, c, d, src, key)
2 dnl Loads the next block of data from src, and add the subkey pointed
4 dnl Note that x86 allows unaligned accesses.
5 dnl Would it be preferable to interleave the loads and stores?
17 dnl AES_STORE(a, b, c, d, key, dst)
18 dnl Adds the subkey to a, b, c, d,
19 dnl and stores the result in the area pointed to by dst.
20 dnl Note that x86 allows unaligned accesses.
21 dnl Would it be preferable to interleave the loads and stores?
33 dnl AES_ROUND(table,a,b,c,d,out,ptr)
34 dnl Computes one word of the AES round. Leaves result in $6.
37 movl AES_TABLE0 ($1, $7, 4),$6
39 xorl AES_TABLE1 ($1, $7, 4),$6
43 xorl AES_TABLE2 ($1, $7, 4),$6
46 xorl AES_TABLE3 ($1, $7, 4),$6>)dnl
48 dnl AES_FINAL_ROUND(a, b, c, d, table, out, tmp)
49 dnl Computes one word of the final round.
50 dnl Note that we have to quote $ in constants.
51 define(<AES_FINAL_ROUND>, <
65 dnl AES_SUBST_BYTE(A, B, C, D, table, ptr)
66 dnl Substitutes the least significant byte of
67 dnl each of eax, ebx, ecx and edx, and also rotates
68 dnl the words one byte to the left.
69 dnl Uses that AES_SBOX == 0
70 define(<AES_SUBST_BYTE>, <
72 movb ($5, $6),LREG($1)
76 movb ($5, $6),LREG($2)
80 movb ($5, $6),LREG($3)
84 movb ($5, $6),LREG($4)