1 C Loads one word, and adds it to the subkey. Uses T0
2 C AES_LOAD(SRC, KEY, REG)
14 C Stores one word. Destroys input.
27 C It's tempting to use eor with rotation, but that's slower.
28 C AES_ENCRYPT_ROUND(x0,x1,x2,x3,w0,w1,w2,w3,key)
29 define(<AES_ENCRYPT_ROUND>, <
31 ldr $5, [TABLE, T0, lsl #2]
33 ldr $6, [TABLE, T0, lsl #2]
35 ldr $7, [TABLE, T0, lsl #2]
37 ldr $8, [TABLE, T0, lsl #2]
40 add TABLE, TABLE, #1024
41 ldr T0, [TABLE, T0, lsl #2]
44 ldr T0, [TABLE, T0, lsl #2]
47 ldr T0, [TABLE, T0, lsl #2]
50 ldr T0, [TABLE, T0, lsl #2]
54 add TABLE, TABLE, #1024
55 ldr T0, [TABLE, T0, lsl #2]
58 ldr T0, [TABLE, T0, lsl #2]
61 ldr T0, [TABLE, T0, lsl #2]
64 ldr T0, [TABLE, T0, lsl #2]
68 add TABLE, TABLE, #1024
69 ldr T0, [TABLE, T0, lsl #2]
72 ldr T0, [TABLE, T0, lsl #2]
75 ldr T0, [TABLE, T0, lsl #2]
78 ldr T0, [TABLE, T0, lsl #2]
80 ldm $9!, {$1,$2,$3,$4}
82 sub TABLE, TABLE, #3072
89 define(<AES_DECRYPT_ROUND>, <
91 ldr $5, [TABLE, T0, lsl #2]
93 ldr $6, [TABLE, T0, lsl #2]
95 ldr $7, [TABLE, T0, lsl #2]
97 ldr $8, [TABLE, T0, lsl #2]
100 add TABLE, TABLE, #1024
101 ldr T0, [TABLE, T0, lsl #2]
104 ldr T0, [TABLE, T0, lsl #2]
107 ldr T0, [TABLE, T0, lsl #2]
110 ldr T0, [TABLE, T0, lsl #2]
114 add TABLE, TABLE, #1024
115 ldr T0, [TABLE, T0, lsl #2]
118 ldr T0, [TABLE, T0, lsl #2]
121 ldr T0, [TABLE, T0, lsl #2]
124 ldr T0, [TABLE, T0, lsl #2]
128 add TABLE, TABLE, #1024
129 ldr T0, [TABLE, T0, lsl #2]
132 ldr T0, [TABLE, T0, lsl #2]
135 ldr T0, [TABLE, T0, lsl #2]
138 ldr T0, [TABLE, T0, lsl #2]
140 ldm $9!, {$1,$2,$3,$4}
142 sub TABLE, TABLE, #3072
149 C AES_FINAL_ROUND(a,b,c,d,key,res)
150 define(<AES_FINAL_ROUND>, <
155 eor $6, $6, T0, lsl #8
158 eor $6, $6, T0, lsl #16
161 eor $6, $6, T0, lsl #24