xref: /netbsd-src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes-mips.S (revision c38e7cc395b1472a774ff828e46123de44c628e9)
1.text
2#ifdef OPENSSL_FIPSCANISTER
3# include <openssl/fipssyms.h>
4#endif
5
6#if defined(__mips_smartmips) && !defined(_MIPS_ARCH_MIPS32R2)
7#define _MIPS_ARCH_MIPS32R2
8#endif
9
10#if !defined(__mips_eabi) && (!defined(__vxworks) || defined(__pic__))
11.option	pic2
12#endif
13.set	noat
14.align	5
15.ent	_mips_AES_encrypt
16_mips_AES_encrypt:
17	.frame	$29,0,$31
18	.set	reorder
19	lw	$12,0($6)
20	lw	$13,4($6)
21	lw	$14,8($6)
22	lw	$15,12($6)
23	lw	$30,240($6)
24	add $3,$6,16
25
26	xor	$8,$12
27	xor	$9,$13
28	xor	$10,$14
29	xor	$11,$15
30
31	sub	$30,1
32#if defined(__mips_smartmips)
33	ext	$1,$9,8,8
34.Loop_enc:
35	ext	$2,$10,8,8
36	ext	$24,$11,8,8
37	ext	$25,$8,8,8
38	lwxs	$12,$1($7)		# Te1[s1>>16]
39	ext	$1,$10,16,8
40	lwxs	$13,$2($7)		# Te1[s2>>16]
41	ext	$2,$11,16,8
42	lwxs	$14,$24($7)		# Te1[s3>>16]
43	ext	$24,$8,16,8
44	lwxs	$15,$25($7)		# Te1[s0>>16]
45	ext	$25,$9,16,8
46
47	lwxs	$16,$1($7)		# Te2[s2>>8]
48	ext	$1,$11,24,8
49	lwxs	$17,$2($7)		# Te2[s3>>8]
50	ext	$2,$8,24,8
51	lwxs	$18,$24($7)		# Te2[s0>>8]
52	ext	$24,$9,24,8
53	lwxs	$19,$25($7)		# Te2[s1>>8]
54	ext	$25,$10,24,8
55
56	lwxs	$20,$1($7)		# Te3[s3]
57	ext	$1,$8,0,8
58	lwxs	$21,$2($7)		# Te3[s0]
59	ext	$2,$9,0,8
60	lwxs	$22,$24($7)		# Te3[s1]
61	ext	$24,$10,0,8
62	lwxs	$23,$25($7)		# Te3[s2]
63	ext	$25,$11,0,8
64
65	rotr	$12,$12,24
66	rotr	$13,$13,24
67	rotr	$14,$14,24
68	rotr	$15,$15,24
69
70	rotr	$16,$16,16
71	rotr	$17,$17,16
72	rotr	$18,$18,16
73	rotr	$19,$19,16
74
75	xor	$12,$16
76	lwxs	$16,$1($7)		# Te0[s0>>24]
77	xor	$13,$17
78	lwxs	$17,$2($7)		# Te0[s1>>24]
79	xor	$14,$18
80	lwxs	$18,$24($7)		# Te0[s2>>24]
81	xor	$15,$19
82	lwxs	$19,$25($7)		# Te0[s3>>24]
83
84	rotr	$20,$20,8
85	lw	$8,0($3)
86	rotr	$21,$21,8
87	lw	$9,4($3)
88	rotr	$22,$22,8
89	lw	$10,8($3)
90	rotr	$23,$23,8
91	lw	$11,12($3)
92
93	xor	$12,$20
94	xor	$13,$21
95	xor	$14,$22
96	xor	$15,$23
97
98	xor	$12,$16
99	xor	$13,$17
100	xor	$14,$18
101	xor	$15,$19
102
103	sub	$30,1
104	add $3,16
105	xor	$8,$12
106	xor	$9,$13
107	xor	$10,$14
108	xor	$11,$15
109	.set	noreorder
110	bnez	$30,.Loop_enc
111	ext	$1,$9,8,8
112
113	srl	$1,$9,6
114#else
115	srl	$1,$9,6
116.Loop_enc:
117	srl	$2,$10,6
118	srl	$24,$11,6
119	srl	$25,$8,6
120	and	$1,0x3fc
121	and	$2,0x3fc
122	and	$24,0x3fc
123	and	$25,0x3fc
124	add $1,$7
125	add $2,$7
126	add $24,$7
127	add $25,$7
128#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)
129	lw	$12,0($1)		# Te1[s1>>16]
130	srl	$1,$10,14
131	lw	$13,0($2)		# Te1[s2>>16]
132	srl	$2,$11,14
133	lw	$14,0($24)		# Te1[s3>>16]
134	srl	$24,$8,14
135	lw	$15,0($25)		# Te1[s0>>16]
136	srl	$25,$9,14
137#else
138	lwl	$12,2($1)		# Te1[s1>>16]
139	lwl	$13,2($2)		# Te1[s2>>16]
140	lwl	$14,2($24)		# Te1[s3>>16]
141	lwl	$15,2($25)		# Te1[s0>>16]
142	lwr	$12,3($1)		# Te1[s1>>16]
143	srl	$1,$10,14
144	lwr	$13,3($2)		# Te1[s2>>16]
145	srl	$2,$11,14
146	lwr	$14,3($24)		# Te1[s3>>16]
147	srl	$24,$8,14
148	lwr	$15,3($25)		# Te1[s0>>16]
149	srl	$25,$9,14
150#endif
151	and	$1,0x3fc
152	and	$2,0x3fc
153	and	$24,0x3fc
154	and	$25,0x3fc
155	add $1,$7
156	add $2,$7
157	add $24,$7
158	add $25,$7
159#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)
160	rotr	$12,$12,24
161	rotr	$13,$13,24
162	rotr	$14,$14,24
163	rotr	$15,$15,24
164# if defined(_MIPSEL)
165	lw	$16,0($1)		# Te2[s2>>8]
166	srl	$1,$11,22
167	lw	$17,0($2)		# Te2[s3>>8]
168	srl	$2,$8,22
169	lw	$18,0($24)		# Te2[s0>>8]
170	srl	$24,$9,22
171	lw	$19,0($25)		# Te2[s1>>8]
172	srl	$25,$10,22
173
174	and	$1,0x3fc
175	and	$2,0x3fc
176	and	$24,0x3fc
177	and	$25,0x3fc
178	add $1,$7
179	add $2,$7
180	add $24,$7
181	add $25,$7
182	lw	$20,0($1)		# Te3[s3]
183	ins $1,$8,2,8
184	lw	$21,0($2)		# Te3[s0]
185	ins $2,$9,2,8
186	lw	$22,0($24)		# Te3[s1]
187	ins $24,$10,2,8
188	lw	$23,0($25)		# Te3[s2]
189	ins $25,$11,2,8
190# else
191	lw	$16,0($1)		# Te2[s2>>8]
192	ins $1,$11,2,8
193	lw	$17,0($2)		# Te2[s3>>8]
194	ins $2,$8,2,8
195	lw	$18,0($24)		# Te2[s0>>8]
196	ins $24,$9,2,8
197	lw	$19,0($25)		# Te2[s1>>8]
198	ins $25,$10,2,8
199
200	lw	$20,0($1)		# Te3[s3]
201	sll	$1,$8,2
202	lw	$21,0($2)		# Te3[s0]
203	sll	$2,$9,2
204	lw	$22,0($24)		# Te3[s1]
205	sll	$24,$10,2
206	lw	$23,0($25)		# Te3[s2]
207	sll	$25,$11,2
208
209	and	$1,0x3fc
210	and	$2,0x3fc
211	and	$24,0x3fc
212	and	$25,0x3fc
213	add $1,$7
214	add $2,$7
215	add $24,$7
216	add $25,$7
217# endif
218	rotr	$16,$16,16
219	rotr	$17,$17,16
220	rotr	$18,$18,16
221	rotr	$19,$19,16
222
223	rotr	$20,$20,8
224	rotr	$21,$21,8
225	rotr	$22,$22,8
226	rotr	$23,$23,8
227#else
228	lwl	$16,1($1)		# Te2[s2>>8]
229	lwl	$17,1($2)		# Te2[s3>>8]
230	lwl	$18,1($24)		# Te2[s0>>8]
231	lwl	$19,1($25)		# Te2[s1>>8]
232	lwr	$16,2($1)		# Te2[s2>>8]
233	srl	$1,$11,22
234	lwr	$17,2($2)		# Te2[s3>>8]
235	srl	$2,$8,22
236	lwr	$18,2($24)		# Te2[s0>>8]
237	srl	$24,$9,22
238	lwr	$19,2($25)		# Te2[s1>>8]
239	srl	$25,$10,22
240
241	and	$1,0x3fc
242	and	$2,0x3fc
243	and	$24,0x3fc
244	and	$25,0x3fc
245	add $1,$7
246	add $2,$7
247	add $24,$7
248	add $25,$7
249	lwl	$20,0($1)		# Te3[s3]
250	lwl	$21,0($2)		# Te3[s0]
251	lwl	$22,0($24)		# Te3[s1]
252	lwl	$23,0($25)		# Te3[s2]
253	lwr	$20,1($1)		# Te3[s3]
254	sll	$1,$8,2
255	lwr	$21,1($2)		# Te3[s0]
256	sll	$2,$9,2
257	lwr	$22,1($24)		# Te3[s1]
258	sll	$24,$10,2
259	lwr	$23,1($25)		# Te3[s2]
260	sll	$25,$11,2
261
262	and	$1,0x3fc
263	and	$2,0x3fc
264	and	$24,0x3fc
265	and	$25,0x3fc
266	add $1,$7
267	add $2,$7
268	add $24,$7
269	add $25,$7
270#endif
271	xor	$12,$16
272	lw	$16,0($1)		# Te0[s0>>24]
273	xor	$13,$17
274	lw	$17,0($2)		# Te0[s1>>24]
275	xor	$14,$18
276	lw	$18,0($24)		# Te0[s2>>24]
277	xor	$15,$19
278	lw	$19,0($25)		# Te0[s3>>24]
279
280	xor	$12,$20
281	lw	$8,0($3)
282	xor	$13,$21
283	lw	$9,4($3)
284	xor	$14,$22
285	lw	$10,8($3)
286	xor	$15,$23
287	lw	$11,12($3)
288
289	xor	$12,$16
290	xor	$13,$17
291	xor	$14,$18
292	xor	$15,$19
293
294	sub	$30,1
295	add $3,16
296	xor	$8,$12
297	xor	$9,$13
298	xor	$10,$14
299	xor	$11,$15
300	.set	noreorder
301	bnez	$30,.Loop_enc
302	srl	$1,$9,6
303#endif
304
305	.set	reorder
306	srl	$2,$10,6
307	srl	$24,$11,6
308	srl	$25,$8,6
309	and	$1,0x3fc
310	and	$2,0x3fc
311	and	$24,0x3fc
312	and	$25,0x3fc
313	add $1,$7
314	add $2,$7
315	add $24,$7
316	add $25,$7
317	lbu	$12,2($1)		# Te4[s1>>16]
318	srl	$1,$10,14
319	lbu	$13,2($2)		# Te4[s2>>16]
320	srl	$2,$11,14
321	lbu	$14,2($24)		# Te4[s3>>16]
322	srl	$24,$8,14
323	lbu	$15,2($25)		# Te4[s0>>16]
324	srl	$25,$9,14
325
326	and	$1,0x3fc
327	and	$2,0x3fc
328	and	$24,0x3fc
329	and	$25,0x3fc
330	add $1,$7
331	add $2,$7
332	add $24,$7
333	add $25,$7
334#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)
335# if defined(_MIPSEL)
336	lbu	$16,2($1)		# Te4[s2>>8]
337	ins $1,$8,2,8
338	lbu	$17,2($2)		# Te4[s3>>8]
339	ins $2,$9,2,8
340	lbu	$18,2($24)		# Te4[s0>>8]
341	ins $24,$10,2,8
342	lbu	$19,2($25)		# Te4[s1>>8]
343	ins $25,$11,2,8
344
345	lbu	$20,2($1)		# Te4[s0>>24]
346	srl	$1,$11,22
347	lbu	$21,2($2)		# Te4[s1>>24]
348	srl	$2,$8,22
349	lbu	$22,2($24)		# Te4[s2>>24]
350	srl	$24,$9,22
351	lbu	$23,2($25)		# Te4[s3>>24]
352	srl	$25,$10,22
353
354	and	$1,0x3fc
355	and	$2,0x3fc
356	and	$24,0x3fc
357	and	$25,0x3fc
358	add $1,$7
359	add $2,$7
360	add $24,$7
361	add $25,$7
362# else
363	lbu	$16,2($1)		# Te4[s2>>8]
364	sll	$1,$8,2
365	lbu	$17,2($2)		# Te4[s3>>8]
366	sll	$2,$9,2
367	lbu	$18,2($24)		# Te4[s0>>8]
368	sll	$24,$10,2
369	lbu	$19,2($25)		# Te4[s1>>8]
370	sll	$25,$11,2
371
372	and	$1,0x3fc
373	and	$2,0x3fc
374	and	$24,0x3fc
375	and	$25,0x3fc
376	add $1,$7
377	add $2,$7
378	add $24,$7
379	add $25,$7
380	lbu	$20,2($1)		# Te4[s0>>24]
381	ins $1,$11,2,8
382	lbu	$21,2($2)		# Te4[s1>>24]
383	ins $2,$8,2,8
384	lbu	$22,2($24)		# Te4[s2>>24]
385	ins $24,$9,2,8
386	lbu	$23,2($25)		# Te4[s3>>24]
387	ins $25,$10,2,8
388# endif
389	sll	$12,$12,8
390	sll	$13,$13,8
391	sll	$14,$14,8
392	sll	$15,$15,8
393
394	ins	$12,$16,16,8
395	lbu	$16,2($1)		# Te4[s3]
396	ins	$13,$17,16,8
397	lbu	$17,2($2)		# Te4[s0]
398	ins	$14,$18,16,8
399	lbu	$18,2($24)		# Te4[s1]
400	ins	$15,$19,16,8
401	lbu	$19,2($25)		# Te4[s2]
402
403	ins	$12,$20,0,8
404	lw	$8,0($3)
405	ins	$13,$21,0,8
406	lw	$9,4($3)
407	ins	$14,$22,0,8
408	lw	$10,8($3)
409	ins	$15,$23,0,8
410	lw	$11,12($3)
411
412	ins	$12,$16,24,8
413	ins	$13,$17,24,8
414	ins	$14,$18,24,8
415	ins	$15,$19,24,8
416#else
417	lbu	$16,2($1)		# Te4[s2>>8]
418	sll	$1,$8,2
419	lbu	$17,2($2)		# Te4[s3>>8]
420	sll	$2,$9,2
421	lbu	$18,2($24)		# Te4[s0>>8]
422	sll	$24,$10,2
423	lbu	$19,2($25)		# Te4[s1>>8]
424	sll	$25,$11,2
425
426	and	$1,0x3fc
427	and	$2,0x3fc
428	and	$24,0x3fc
429	and	$25,0x3fc
430	add $1,$7
431	add $2,$7
432	add $24,$7
433	add $25,$7
434	lbu	$20,2($1)		# Te4[s0>>24]
435	srl	$1,$11,22
436	lbu	$21,2($2)		# Te4[s1>>24]
437	srl	$2,$8,22
438	lbu	$22,2($24)		# Te4[s2>>24]
439	srl	$24,$9,22
440	lbu	$23,2($25)		# Te4[s3>>24]
441	srl	$25,$10,22
442
443	and	$1,0x3fc
444	and	$2,0x3fc
445	and	$24,0x3fc
446	and	$25,0x3fc
447	add $1,$7
448	add $2,$7
449	add $24,$7
450	add $25,$7
451
452	sll	$12,$12,8
453	sll	$13,$13,8
454	sll	$14,$14,8
455	sll	$15,$15,8
456
457	sll	$16,$16,16
458	sll	$17,$17,16
459	sll	$18,$18,16
460	sll	$19,$19,16
461
462	xor	$12,$16
463	lbu	$16,2($1)		# Te4[s3]
464	xor	$13,$17
465	lbu	$17,2($2)		# Te4[s0]
466	xor	$14,$18
467	lbu	$18,2($24)		# Te4[s1]
468	xor	$15,$19
469	lbu	$19,2($25)		# Te4[s2]
470
471	#sll	$20,$20,0
472	lw	$8,0($3)
473	#sll	$21,$21,0
474	lw	$9,4($3)
475	#sll	$22,$22,0
476	lw	$10,8($3)
477	#sll	$23,$23,0
478	lw	$11,12($3)
479
480	xor	$12,$20
481	xor	$13,$21
482	xor	$14,$22
483	xor	$15,$23
484
485	sll	$16,$16,24
486	sll	$17,$17,24
487	sll	$18,$18,24
488	sll	$19,$19,24
489
490	xor	$12,$16
491	xor	$13,$17
492	xor	$14,$18
493	xor	$15,$19
494#endif
495	xor	$8,$12
496	xor	$9,$13
497	xor	$10,$14
498	xor	$11,$15
499
500	jr	$31
501.end	_mips_AES_encrypt
502
503.align	5
504.globl	AES_encrypt
505.ent	AES_encrypt
506AES_encrypt:
507	.frame	$29,64,$31
508	.mask	0xc0ff0000,-4
509	.set	noreorder
510	.cpload	$25
511	sub $29,64
512	sw	$31,64-1*4($29)
513	sw	$30,64-2*4($29)
514	sw	$23,64-3*4($29)
515	sw	$22,64-4*4($29)
516	sw	$21,64-5*4($29)
517	sw	$20,64-6*4($29)
518	sw	$19,64-7*4($29)
519	sw	$18,64-8*4($29)
520	sw	$17,64-9*4($29)
521	sw	$16,64-10*4($29)
522	.set	reorder
523	la	$7,AES_Te		# PIC-ified 'load address'
524
525	lwl	$8,0+3($4)
526	lwl	$9,4+3($4)
527	lwl	$10,8+3($4)
528	lwl	$11,12+3($4)
529	lwr	$8,0+0($4)
530	lwr	$9,4+0($4)
531	lwr	$10,8+0($4)
532	lwr	$11,12+0($4)
533
534	bal	_mips_AES_encrypt
535
536	swr	$8,0+0($5)
537	swr	$9,4+0($5)
538	swr	$10,8+0($5)
539	swr	$11,12+0($5)
540	swl	$8,0+3($5)
541	swl	$9,4+3($5)
542	swl	$10,8+3($5)
543	swl	$11,12+3($5)
544
545	.set	noreorder
546	lw	$31,64-1*4($29)
547	lw	$30,64-2*4($29)
548	lw	$23,64-3*4($29)
549	lw	$22,64-4*4($29)
550	lw	$21,64-5*4($29)
551	lw	$20,64-6*4($29)
552	lw	$19,64-7*4($29)
553	lw	$18,64-8*4($29)
554	lw	$17,64-9*4($29)
555	lw	$16,64-10*4($29)
556	jr	$31
557	add $29,64
558.end	AES_encrypt
559.align	5
560.ent	_mips_AES_decrypt
561_mips_AES_decrypt:
562	.frame	$29,0,$31
563	.set	reorder
564	lw	$12,0($6)
565	lw	$13,4($6)
566	lw	$14,8($6)
567	lw	$15,12($6)
568	lw	$30,240($6)
569	add $3,$6,16
570
571	xor	$8,$12
572	xor	$9,$13
573	xor	$10,$14
574	xor	$11,$15
575
576	sub	$30,1
577#if defined(__mips_smartmips)
578	ext	$1,$11,8,8
579.Loop_dec:
580	ext	$2,$8,8,8
581	ext	$24,$9,8,8
582	ext	$25,$10,8,8
583	lwxs	$12,$1($7)		# Td1[s3>>16]
584	ext	$1,$10,16,8
585	lwxs	$13,$2($7)		# Td1[s0>>16]
586	ext	$2,$11,16,8
587	lwxs	$14,$24($7)		# Td1[s1>>16]
588	ext	$24,$8,16,8
589	lwxs	$15,$25($7)		# Td1[s2>>16]
590	ext	$25,$9,16,8
591
592	lwxs	$16,$1($7)		# Td2[s2>>8]
593	ext	$1,$9,24,8
594	lwxs	$17,$2($7)		# Td2[s3>>8]
595	ext	$2,$10,24,8
596	lwxs	$18,$24($7)		# Td2[s0>>8]
597	ext	$24,$11,24,8
598	lwxs	$19,$25($7)		# Td2[s1>>8]
599	ext	$25,$8,24,8
600
601	lwxs	$20,$1($7)		# Td3[s1]
602	ext	$1,$8,0,8
603	lwxs	$21,$2($7)		# Td3[s2]
604	ext	$2,$9,0,8
605	lwxs	$22,$24($7)		# Td3[s3]
606	ext	$24,$10,0,8
607	lwxs	$23,$25($7)		# Td3[s0]
608	ext	$25,$11,0,8
609
610	rotr	$12,$12,24
611	rotr	$13,$13,24
612	rotr	$14,$14,24
613	rotr	$15,$15,24
614
615	rotr	$16,$16,16
616	rotr	$17,$17,16
617	rotr	$18,$18,16
618	rotr	$19,$19,16
619
620	xor	$12,$16
621	lwxs	$16,$1($7)		# Td0[s0>>24]
622	xor	$13,$17
623	lwxs	$17,$2($7)		# Td0[s1>>24]
624	xor	$14,$18
625	lwxs	$18,$24($7)		# Td0[s2>>24]
626	xor	$15,$19
627	lwxs	$19,$25($7)		# Td0[s3>>24]
628
629	rotr	$20,$20,8
630	lw	$8,0($3)
631	rotr	$21,$21,8
632	lw	$9,4($3)
633	rotr	$22,$22,8
634	lw	$10,8($3)
635	rotr	$23,$23,8
636	lw	$11,12($3)
637
638	xor	$12,$20
639	xor	$13,$21
640	xor	$14,$22
641	xor	$15,$23
642
643	xor	$12,$16
644	xor	$13,$17
645	xor	$14,$18
646	xor	$15,$19
647
648	sub	$30,1
649	add $3,16
650	xor	$8,$12
651	xor	$9,$13
652	xor	$10,$14
653	xor	$11,$15
654	.set	noreorder
655	bnez	$30,.Loop_dec
656	ext	$1,$11,8,8
657
658	srl	$1,$11,6
659#else
660	srl	$1,$11,6
661.Loop_dec:
662	srl	$2,$8,6
663	srl	$24,$9,6
664	srl	$25,$10,6
665	and	$1,0x3fc
666	and	$2,0x3fc
667	and	$24,0x3fc
668	and	$25,0x3fc
669	add $1,$7
670	add $2,$7
671	add $24,$7
672	add $25,$7
673#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)
674	lw	$12,0($1)		# Td1[s3>>16]
675	srl	$1,$10,14
676	lw	$13,0($2)		# Td1[s0>>16]
677	srl	$2,$11,14
678	lw	$14,0($24)		# Td1[s1>>16]
679	srl	$24,$8,14
680	lw	$15,0($25)		# Td1[s2>>16]
681	srl	$25,$9,14
682#else
683	lwl	$12,2($1)		# Td1[s3>>16]
684	lwl	$13,2($2)		# Td1[s0>>16]
685	lwl	$14,2($24)		# Td1[s1>>16]
686	lwl	$15,2($25)		# Td1[s2>>16]
687	lwr	$12,3($1)		# Td1[s3>>16]
688	srl	$1,$10,14
689	lwr	$13,3($2)		# Td1[s0>>16]
690	srl	$2,$11,14
691	lwr	$14,3($24)		# Td1[s1>>16]
692	srl	$24,$8,14
693	lwr	$15,3($25)		# Td1[s2>>16]
694	srl	$25,$9,14
695#endif
696
697	and	$1,0x3fc
698	and	$2,0x3fc
699	and	$24,0x3fc
700	and	$25,0x3fc
701	add $1,$7
702	add $2,$7
703	add $24,$7
704	add $25,$7
705#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)
706	rotr	$12,$12,24
707	rotr	$13,$13,24
708	rotr	$14,$14,24
709	rotr	$15,$15,24
710# if defined(_MIPSEL)
711	lw	$16,0($1)		# Td2[s2>>8]
712	srl	$1,$9,22
713	lw	$17,0($2)		# Td2[s3>>8]
714	srl	$2,$10,22
715	lw	$18,0($24)		# Td2[s0>>8]
716	srl	$24,$11,22
717	lw	$19,0($25)		# Td2[s1>>8]
718	srl	$25,$8,22
719
720	and	$1,0x3fc
721	and	$2,0x3fc
722	and	$24,0x3fc
723	and	$25,0x3fc
724	add $1,$7
725	add $2,$7
726	add $24,$7
727	add $25,$7
728	lw	$20,0($1)		# Td3[s1]
729	ins $1,$8,2,8
730	lw	$21,0($2)		# Td3[s2]
731	ins $2,$9,2,8
732	lw	$22,0($24)		# Td3[s3]
733	ins $24,$10,2,8
734	lw	$23,0($25)		# Td3[s0]
735	ins $25,$11,2,8
736#else
737	lw	$16,0($1)		# Td2[s2>>8]
738	ins $1,$9,2,8
739	lw	$17,0($2)		# Td2[s3>>8]
740	ins $2,$10,2,8
741	lw	$18,0($24)		# Td2[s0>>8]
742	ins $24,$11,2,8
743	lw	$19,0($25)		# Td2[s1>>8]
744	ins $25,$8,2,8
745
746	lw	$20,0($1)		# Td3[s1]
747	sll	$1,$8,2
748	lw	$21,0($2)		# Td3[s2]
749	sll	$2,$9,2
750	lw	$22,0($24)		# Td3[s3]
751	sll	$24,$10,2
752	lw	$23,0($25)		# Td3[s0]
753	sll	$25,$11,2
754
755	and	$1,0x3fc
756	and	$2,0x3fc
757	and	$24,0x3fc
758	and	$25,0x3fc
759	add $1,$7
760	add $2,$7
761	add $24,$7
762	add $25,$7
763#endif
764	rotr	$16,$16,16
765	rotr	$17,$17,16
766	rotr	$18,$18,16
767	rotr	$19,$19,16
768
769	rotr	$20,$20,8
770	rotr	$21,$21,8
771	rotr	$22,$22,8
772	rotr	$23,$23,8
773#else
774	lwl	$16,1($1)		# Td2[s2>>8]
775	lwl	$17,1($2)		# Td2[s3>>8]
776	lwl	$18,1($24)		# Td2[s0>>8]
777	lwl	$19,1($25)		# Td2[s1>>8]
778	lwr	$16,2($1)		# Td2[s2>>8]
779	srl	$1,$9,22
780	lwr	$17,2($2)		# Td2[s3>>8]
781	srl	$2,$10,22
782	lwr	$18,2($24)		# Td2[s0>>8]
783	srl	$24,$11,22
784	lwr	$19,2($25)		# Td2[s1>>8]
785	srl	$25,$8,22
786
787	and	$1,0x3fc
788	and	$2,0x3fc
789	and	$24,0x3fc
790	and	$25,0x3fc
791	add $1,$7
792	add $2,$7
793	add $24,$7
794	add $25,$7
795	lwl	$20,0($1)		# Td3[s1]
796	lwl	$21,0($2)		# Td3[s2]
797	lwl	$22,0($24)		# Td3[s3]
798	lwl	$23,0($25)		# Td3[s0]
799	lwr	$20,1($1)		# Td3[s1]
800	sll	$1,$8,2
801	lwr	$21,1($2)		# Td3[s2]
802	sll	$2,$9,2
803	lwr	$22,1($24)		# Td3[s3]
804	sll	$24,$10,2
805	lwr	$23,1($25)		# Td3[s0]
806	sll	$25,$11,2
807
808	and	$1,0x3fc
809	and	$2,0x3fc
810	and	$24,0x3fc
811	and	$25,0x3fc
812	add $1,$7
813	add $2,$7
814	add $24,$7
815	add $25,$7
816#endif
817
818	xor	$12,$16
819	lw	$16,0($1)		# Td0[s0>>24]
820	xor	$13,$17
821	lw	$17,0($2)		# Td0[s1>>24]
822	xor	$14,$18
823	lw	$18,0($24)		# Td0[s2>>24]
824	xor	$15,$19
825	lw	$19,0($25)		# Td0[s3>>24]
826
827	xor	$12,$20
828	lw	$8,0($3)
829	xor	$13,$21
830	lw	$9,4($3)
831	xor	$14,$22
832	lw	$10,8($3)
833	xor	$15,$23
834	lw	$11,12($3)
835
836	xor	$12,$16
837	xor	$13,$17
838	xor	$14,$18
839	xor	$15,$19
840
841	sub	$30,1
842	add $3,16
843	xor	$8,$12
844	xor	$9,$13
845	xor	$10,$14
846	xor	$11,$15
847	.set	noreorder
848	bnez	$30,.Loop_dec
849	srl	$1,$11,6
850#endif
851
852	.set	reorder
853	lw	$16,1024($7)		# prefetch Td4
854	srl	$1,$11,8
855	lw	$17,1024+32($7)
856	srl	$2,$8,8
857	lw	$18,1024+64($7)
858	srl	$24,$9,8
859	lw	$19,1024+96($7)
860	srl	$25,$10,8
861	lw	$20,1024+128($7)
862	and	$1,0xff
863	lw	$21,1024+160($7)
864	and	$2,0xff
865	lw	$22,1024+192($7)
866	and	$24,0xff
867	lw	$23,1024+224($7)
868	and	$25,0xff
869
870	add $1,$7
871	add $2,$7
872	add $24,$7
873	add $25,$7
874	lbu	$12,1024($1)		# Td4[s3>>16]
875	srl	$1,$10,16
876	lbu	$13,1024($2)		# Td4[s0>>16]
877	srl	$2,$11,16
878	lbu	$14,1024($24)		# Td4[s1>>16]
879	srl	$24,$8,16
880	lbu	$15,1024($25)		# Td4[s2>>16]
881	srl	$25,$9,16
882
883	and	$1,0xff
884	and	$2,0xff
885	and	$24,0xff
886	and	$25,0xff
887	add $1,$7
888	add $2,$7
889	add $24,$7
890	add $25,$7
891#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)
892# if defined(_MIPSEL)
893	lbu	$16,1024($1)		# Td4[s2>>8]
894	ins $1,$8,0,8
895	lbu	$17,1024($2)		# Td4[s3>>8]
896	ins $2,$9,0,8
897	lbu	$18,1024($24)		# Td4[s0>>8]
898	ins $24,$10,0,8
899	lbu	$19,1024($25)		# Td4[s1>>8]
900	ins $25,$11,0,8
901
902	lbu	$20,1024($1)		# Td4[s0>>24]
903	srl	$1,$9,24
904	lbu	$21,1024($2)		# Td4[s1>>24]
905	srl	$2,$10,24
906	lbu	$22,1024($24)		# Td4[s2>>24]
907	srl	$24,$11,24
908	lbu	$23,1024($25)		# Td4[s3>>24]
909	srl	$25,$8,24
910
911	add $1,$7
912	add $2,$7
913	add $24,$7
914	add $25,$7
915# else
916	lbu	$16,1024($1)		# Td4[s2>>8]
917	and	$1,$8,0xff
918	lbu	$17,1024($2)		# Td4[s3>>8]
919	and	$2,$9,0xff
920	lbu	$18,1024($24)		# Td4[s0>>8]
921	and	$24,$10,0xff
922	lbu	$19,1024($25)		# Td4[s1>>8]
923	and	$25,$11,0xff
924
925	add $1,$7
926	add $2,$7
927	add $24,$7
928	add $25,$7
929	lbu	$20,1024($1)		# Td4[s0>>24]
930	ins $1,$9,0,8
931	lbu	$21,1024($2)		# Td4[s1>>24]
932	ins $2,$10,0,8
933	lbu	$22,1024($24)		# Td4[s2>>24]
934	ins $24,$11,0,8
935	lbu	$23,1024($25)		# Td4[s3>>24]
936	ins $25,$8,0,8
937# endif
938	sll	$12,$12,8
939	sll	$13,$13,8
940	sll	$14,$14,8
941	sll	$15,$15,8
942
943	ins	$12,$16,16,8
944	lbu	$16,1024($1)		# Td4[s1]
945	ins	$13,$17,16,8
946	lbu	$17,1024($2)		# Td4[s2]
947	ins	$14,$18,16,8
948	lbu	$18,1024($24)		# Td4[s3]
949	ins	$15,$19,16,8
950	lbu	$19,1024($25)		# Td4[s0]
951
952	ins	$12,$20,0,8
953	lw	$8,0($3)
954	ins	$13,$21,0,8
955	lw	$9,4($3)
956	ins	$14,$22,0,8
957	lw	$10,8($3)
958	ins	$15,$23,0,8
959	lw	$11,12($3)
960
961	ins	$12,$16,24,8
962	ins	$13,$17,24,8
963	ins	$14,$18,24,8
964	ins	$15,$19,24,8
965#else
966	lbu	$16,1024($1)		# Td4[s2>>8]
967	and	$1,$8,0xff
968	lbu	$17,1024($2)		# Td4[s3>>8]
969	and	$2,$9,0xff
970	lbu	$18,1024($24)		# Td4[s0>>8]
971	and	$24,$10,0xff
972	lbu	$19,1024($25)		# Td4[s1>>8]
973	and	$25,$11,0xff
974
975	add $1,$7
976	add $2,$7
977	add $24,$7
978	add $25,$7
979	lbu	$20,1024($1)		# Td4[s0>>24]
980	srl	$1,$9,24
981	lbu	$21,1024($2)		# Td4[s1>>24]
982	srl	$2,$10,24
983	lbu	$22,1024($24)		# Td4[s2>>24]
984	srl	$24,$11,24
985	lbu	$23,1024($25)		# Td4[s3>>24]
986	srl	$25,$8,24
987
988	add $1,$7
989	add $2,$7
990	add $24,$7
991	add $25,$7
992
993	sll	$12,$12,8
994	sll	$13,$13,8
995	sll	$14,$14,8
996	sll	$15,$15,8
997
998	sll	$16,$16,16
999	sll	$17,$17,16
1000	sll	$18,$18,16
1001	sll	$19,$19,16
1002
1003	xor	$12,$16
1004	lbu	$16,1024($1)		# Td4[s1]
1005	xor	$13,$17
1006	lbu	$17,1024($2)		# Td4[s2]
1007	xor	$14,$18
1008	lbu	$18,1024($24)		# Td4[s3]
1009	xor	$15,$19
1010	lbu	$19,1024($25)		# Td4[s0]
1011
1012	#sll	$20,$20,0
1013	lw	$8,0($3)
1014	#sll	$21,$21,0
1015	lw	$9,4($3)
1016	#sll	$22,$22,0
1017	lw	$10,8($3)
1018	#sll	$23,$23,0
1019	lw	$11,12($3)
1020
1021	xor	$12,$20
1022	xor	$13,$21
1023	xor	$14,$22
1024	xor	$15,$23
1025
1026	sll	$16,$16,24
1027	sll	$17,$17,24
1028	sll	$18,$18,24
1029	sll	$19,$19,24
1030
1031	xor	$12,$16
1032	xor	$13,$17
1033	xor	$14,$18
1034	xor	$15,$19
1035#endif
1036
1037	xor	$8,$12
1038	xor	$9,$13
1039	xor	$10,$14
1040	xor	$11,$15
1041
1042	jr	$31
1043.end	_mips_AES_decrypt
1044
1045.align	5
1046.globl	AES_decrypt
1047.ent	AES_decrypt
1048AES_decrypt:
1049	.frame	$29,64,$31
1050	.mask	0xc0ff0000,-4
1051	.set	noreorder
1052	.cpload	$25
1053	sub $29,64
1054	sw	$31,64-1*4($29)
1055	sw	$30,64-2*4($29)
1056	sw	$23,64-3*4($29)
1057	sw	$22,64-4*4($29)
1058	sw	$21,64-5*4($29)
1059	sw	$20,64-6*4($29)
1060	sw	$19,64-7*4($29)
1061	sw	$18,64-8*4($29)
1062	sw	$17,64-9*4($29)
1063	sw	$16,64-10*4($29)
1064	.set	reorder
1065	la	$7,AES_Td		# PIC-ified 'load address'
1066
1067	lwl	$8,0+3($4)
1068	lwl	$9,4+3($4)
1069	lwl	$10,8+3($4)
1070	lwl	$11,12+3($4)
1071	lwr	$8,0+0($4)
1072	lwr	$9,4+0($4)
1073	lwr	$10,8+0($4)
1074	lwr	$11,12+0($4)
1075
1076	bal	_mips_AES_decrypt
1077
1078	swr	$8,0+0($5)
1079	swr	$9,4+0($5)
1080	swr	$10,8+0($5)
1081	swr	$11,12+0($5)
1082	swl	$8,0+3($5)
1083	swl	$9,4+3($5)
1084	swl	$10,8+3($5)
1085	swl	$11,12+3($5)
1086
1087	.set	noreorder
1088	lw	$31,64-1*4($29)
1089	lw	$30,64-2*4($29)
1090	lw	$23,64-3*4($29)
1091	lw	$22,64-4*4($29)
1092	lw	$21,64-5*4($29)
1093	lw	$20,64-6*4($29)
1094	lw	$19,64-7*4($29)
1095	lw	$18,64-8*4($29)
1096	lw	$17,64-9*4($29)
1097	lw	$16,64-10*4($29)
1098	jr	$31
1099	add $29,64
1100.end	AES_decrypt
1101.align	5
1102.ent	_mips_AES_set_encrypt_key
1103_mips_AES_set_encrypt_key:
1104	.frame	$29,0,$31
1105	.set	noreorder
1106	beqz	$4,.Lekey_done
1107	li	$2,-1
1108	beqz	$6,.Lekey_done
1109	add $3,$7,256
1110
1111	.set	reorder
1112	lwl	$8,0+3($4)	# load 128 bits
1113	lwl	$9,4+3($4)
1114	lwl	$10,8+3($4)
1115	lwl	$11,12+3($4)
1116	li	$1,128
1117	lwr	$8,0+0($4)
1118	lwr	$9,4+0($4)
1119	lwr	$10,8+0($4)
1120	lwr	$11,12+0($4)
1121	.set	noreorder
1122	beq	$5,$1,.L128bits
1123	li	$30,10
1124
1125	.set	reorder
1126	lwl	$12,16+3($4)	# load 192 bits
1127	lwl	$13,20+3($4)
1128	li	$1,192
1129	lwr	$12,16+0($4)
1130	lwr	$13,20+0($4)
1131	.set	noreorder
1132	beq	$5,$1,.L192bits
1133	li	$30,8
1134
1135	.set	reorder
1136	lwl	$14,24+3($4)	# load 256 bits
1137	lwl	$15,28+3($4)
1138	li	$1,256
1139	lwr	$14,24+0($4)
1140	lwr	$15,28+0($4)
1141	.set	noreorder
1142	beq	$5,$1,.L256bits
1143	li	$30,7
1144
1145	b	.Lekey_done
1146	li	$2,-2
1147
1148.align	4
1149.L128bits:
1150	.set	reorder
1151	srl	$1,$11,16
1152	srl	$2,$11,8
1153	and	$1,0xff
1154	and	$2,0xff
1155	and	$24,$11,0xff
1156	srl	$25,$11,24
1157	add $1,$7
1158	add $2,$7
1159	add $24,$7
1160	add $25,$7
1161	lbu	$1,0($1)
1162	lbu	$2,0($2)
1163	lbu	$24,0($24)
1164	lbu	$25,0($25)
1165
1166	sw	$8,0($6)
1167	sw	$9,4($6)
1168	sw	$10,8($6)
1169	sw	$11,12($6)
1170	sub	$30,1
1171	add $6,16
1172
1173	sll	$1,$1,8
1174	#sll	$2,$2,0
1175	sll	$24,$24,24
1176	sll	$25,$25,16
1177
1178	xor	$8,$1
1179	lw	$1,0($3)
1180	xor	$8,$2
1181	xor	$8,$24
1182	xor	$8,$25
1183	xor	$8,$1
1184
1185	xor	$9,$8
1186	xor	$10,$9
1187	xor	$11,$10
1188
1189	.set	noreorder
1190	bnez	$30,.L128bits
1191	add $3,4
1192
1193	sw	$8,0($6)
1194	sw	$9,4($6)
1195	sw	$10,8($6)
1196	li	$30,10
1197	sw	$11,12($6)
1198	li	$2,0
1199	sw	$30,80($6)
1200	b	.Lekey_done
1201	sub $6,10*16
1202
1203.align	4
1204.L192bits:
1205	.set	reorder
1206	srl	$1,$13,16
1207	srl	$2,$13,8
1208	and	$1,0xff
1209	and	$2,0xff
1210	and	$24,$13,0xff
1211	srl	$25,$13,24
1212	add $1,$7
1213	add $2,$7
1214	add $24,$7
1215	add $25,$7
1216	lbu	$1,0($1)
1217	lbu	$2,0($2)
1218	lbu	$24,0($24)
1219	lbu	$25,0($25)
1220
1221	sw	$8,0($6)
1222	sw	$9,4($6)
1223	sw	$10,8($6)
1224	sw	$11,12($6)
1225	sw	$12,16($6)
1226	sw	$13,20($6)
1227	sub	$30,1
1228	add $6,24
1229
1230	sll	$1,$1,8
1231	#sll	$2,$2,0
1232	sll	$24,$24,24
1233	sll	$25,$25,16
1234
1235	xor	$8,$1
1236	lw	$1,0($3)
1237	xor	$8,$2
1238	xor	$8,$24
1239	xor	$8,$25
1240	xor	$8,$1
1241
1242	xor	$9,$8
1243	xor	$10,$9
1244	xor	$11,$10
1245	xor	$12,$11
1246	xor	$13,$12
1247
1248	.set	noreorder
1249	bnez	$30,.L192bits
1250	add $3,4
1251
1252	sw	$8,0($6)
1253	sw	$9,4($6)
1254	sw	$10,8($6)
1255	li	$30,12
1256	sw	$11,12($6)
1257	li	$2,0
1258	sw	$30,48($6)
1259	b	.Lekey_done
1260	sub $6,12*16
1261
1262.align	4
1263.L256bits:
1264	.set	reorder
1265	srl	$1,$15,16
1266	srl	$2,$15,8
1267	and	$1,0xff
1268	and	$2,0xff
1269	and	$24,$15,0xff
1270	srl	$25,$15,24
1271	add $1,$7
1272	add $2,$7
1273	add $24,$7
1274	add $25,$7
1275	lbu	$1,0($1)
1276	lbu	$2,0($2)
1277	lbu	$24,0($24)
1278	lbu	$25,0($25)
1279
1280	sw	$8,0($6)
1281	sw	$9,4($6)
1282	sw	$10,8($6)
1283	sw	$11,12($6)
1284	sw	$12,16($6)
1285	sw	$13,20($6)
1286	sw	$14,24($6)
1287	sw	$15,28($6)
1288	sub	$30,1
1289
1290	sll	$1,$1,8
1291	#sll	$2,$2,0
1292	sll	$24,$24,24
1293	sll	$25,$25,16
1294
1295	xor	$8,$1
1296	lw	$1,0($3)
1297	xor	$8,$2
1298	xor	$8,$24
1299	xor	$8,$25
1300	xor	$8,$1
1301
1302	xor	$9,$8
1303	xor	$10,$9
1304	xor	$11,$10
1305	beqz	$30,.L256bits_done
1306
1307	srl	$1,$11,24
1308	srl	$2,$11,16
1309	srl	$24,$11,8
1310	and	$25,$11,0xff
1311	and	$2,0xff
1312	and	$24,0xff
1313	add $1,$7
1314	add $2,$7
1315	add $24,$7
1316	add $25,$7
1317	lbu	$1,0($1)
1318	lbu	$2,0($2)
1319	lbu	$24,0($24)
1320	lbu	$25,0($25)
1321	sll	$1,24
1322	sll	$2,16
1323	sll	$24,8
1324
1325	xor	$12,$1
1326	xor	$12,$2
1327	xor	$12,$24
1328	xor	$12,$25
1329
1330	xor	$13,$12
1331	xor	$14,$13
1332	xor	$15,$14
1333
1334	add $6,32
1335	.set	noreorder
1336	b	.L256bits
1337	add $3,4
1338
1339.L256bits_done:
1340	sw	$8,32($6)
1341	sw	$9,36($6)
1342	sw	$10,40($6)
1343	li	$30,14
1344	sw	$11,44($6)
1345	li	$2,0
1346	sw	$30,48($6)
1347	sub $6,12*16
1348
1349.Lekey_done:
1350	jr	$31
1351	nop
1352.end	_mips_AES_set_encrypt_key
1353
1354.globl	AES_set_encrypt_key
1355.ent	AES_set_encrypt_key
1356AES_set_encrypt_key:
1357	.frame	$29,32,$31
1358	.mask	0xc0000000,-4
1359	.set	noreorder
1360	.cpload	$25
1361	sub $29,32
1362	sw	$31,32-1*4($29)
1363	sw	$30,32-2*4($29)
1364	.set	reorder
1365	la	$7,AES_Te4		# PIC-ified 'load address'
1366
1367	bal	_mips_AES_set_encrypt_key
1368
1369	.set	noreorder
1370	move	$4,$2
1371	lw	$31,32-1*4($29)
1372	lw	$30,32-2*4($29)
1373	jr	$31
1374	add $29,32
1375.end	AES_set_encrypt_key
1376.align	5
1377.globl	AES_set_decrypt_key
1378.ent	AES_set_decrypt_key
1379AES_set_decrypt_key:
1380	.frame	$29,32,$31
1381	.mask	0xc0000000,-4
1382	.set	noreorder
1383	.cpload	$25
1384	sub $29,32
1385	sw	$31,32-1*4($29)
1386	sw	$30,32-2*4($29)
1387	.set	reorder
1388	la	$7,AES_Te4		# PIC-ified 'load address'
1389
1390	bal	_mips_AES_set_encrypt_key
1391
1392	bltz	$2,.Ldkey_done
1393
1394	sll	$1,$30,4
1395	add $4,$6,0
1396	add $5,$6,$1
1397.align	4
1398.Lswap:
1399	lw	$8,0($4)
1400	lw	$9,4($4)
1401	lw	$10,8($4)
1402	lw	$11,12($4)
1403	lw	$12,0($5)
1404	lw	$13,4($5)
1405	lw	$14,8($5)
1406	lw	$15,12($5)
1407	sw	$8,0($5)
1408	sw	$9,4($5)
1409	sw	$10,8($5)
1410	sw	$11,12($5)
1411	add $4,16
1412	sub $5,16
1413	sw	$12,-16($4)
1414	sw	$13,-12($4)
1415	sw	$14,-8($4)
1416	sw	$15,-4($4)
1417	bne	$4,$5,.Lswap
1418
1419	lw	$8,16($6)		# modulo-scheduled
1420	lui	$2,0x8080
1421	sub	$30,1
1422	or	$2,0x8080
1423	sll	$30,2
1424	add $6,16
1425	lui	$25,0x1b1b
1426	nor	$24,$0,$2
1427	or	$25,0x1b1b
1428.align	4
1429.Lmix:
1430	and	$1,$8,$2
1431	and	$9,$8,$24
1432	srl	$10,$1,7
1433	addu	$9,$9		# tp2<<1
1434	subu	$1,$10
1435	and	$1,$25
1436	xor	$9,$1
1437
1438	and	$1,$9,$2
1439	and	$10,$9,$24
1440	srl	$11,$1,7
1441	addu	$10,$10		# tp4<<1
1442	subu	$1,$11
1443	and	$1,$25
1444	xor	$10,$1
1445
1446	and	$1,$10,$2
1447	and	$11,$10,$24
1448	srl	$12,$1,7
1449	addu	$11,$11		# tp8<<1
1450	subu	$1,$12
1451	and	$1,$25
1452	xor	$11,$1
1453
1454	xor	$12,$11,$8
1455	xor	$15,$11,$10
1456	xor	$13,$12,$9
1457	xor	$14,$12,$10
1458
1459#if defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)
1460	rotr	$8,$14,16
1461	 xor	$15,$9
1462	rotr	$9,$12,24
1463	xor	$15,$8
1464	rotr	$10,$13,8
1465	xor	$15,$9
1466	lw	$8,4($6)		# modulo-scheduled
1467	xor	$15,$10
1468#else
1469	sll	$8,$14,16
1470	 xor	$15,$9
1471	srl	$9,$14,16
1472	xor	$15,$8
1473	sll	$8,$12,8
1474	xor	$15,$9
1475	srl	$9,$12,24
1476	xor	$15,$8
1477	sll	$8,$13,24
1478	xor	$15,$9
1479	srl	$9,$13,8
1480	xor	$15,$8
1481	lw	$8,4($6)		# modulo-scheduled
1482	xor	$15,$9
1483#endif
1484	sub	$30,1
1485	sw	$15,0($6)
1486	add $6,4
1487	bnez	$30,.Lmix
1488
1489	li	$2,0
1490.Ldkey_done:
1491	.set	noreorder
1492	move	$4,$2
1493	lw	$31,32-1*4($29)
1494	lw	$30,32-2*4($29)
1495	jr	$31
1496	add $29,32
1497.end	AES_set_decrypt_key
1498.rdata
1499.align	10
1500AES_Te:
1501.byte	0xc6,0x63,0x63,0xa5,	0xf8,0x7c,0x7c,0x84	# Te0
1502.byte	0xee,0x77,0x77,0x99,	0xf6,0x7b,0x7b,0x8d
1503.byte	0xff,0xf2,0xf2,0x0d,	0xd6,0x6b,0x6b,0xbd
1504.byte	0xde,0x6f,0x6f,0xb1,	0x91,0xc5,0xc5,0x54
1505.byte	0x60,0x30,0x30,0x50,	0x02,0x01,0x01,0x03
1506.byte	0xce,0x67,0x67,0xa9,	0x56,0x2b,0x2b,0x7d
1507.byte	0xe7,0xfe,0xfe,0x19,	0xb5,0xd7,0xd7,0x62
1508.byte	0x4d,0xab,0xab,0xe6,	0xec,0x76,0x76,0x9a
1509.byte	0x8f,0xca,0xca,0x45,	0x1f,0x82,0x82,0x9d
1510.byte	0x89,0xc9,0xc9,0x40,	0xfa,0x7d,0x7d,0x87
1511.byte	0xef,0xfa,0xfa,0x15,	0xb2,0x59,0x59,0xeb
1512.byte	0x8e,0x47,0x47,0xc9,	0xfb,0xf0,0xf0,0x0b
1513.byte	0x41,0xad,0xad,0xec,	0xb3,0xd4,0xd4,0x67
1514.byte	0x5f,0xa2,0xa2,0xfd,	0x45,0xaf,0xaf,0xea
1515.byte	0x23,0x9c,0x9c,0xbf,	0x53,0xa4,0xa4,0xf7
1516.byte	0xe4,0x72,0x72,0x96,	0x9b,0xc0,0xc0,0x5b
1517.byte	0x75,0xb7,0xb7,0xc2,	0xe1,0xfd,0xfd,0x1c
1518.byte	0x3d,0x93,0x93,0xae,	0x4c,0x26,0x26,0x6a
1519.byte	0x6c,0x36,0x36,0x5a,	0x7e,0x3f,0x3f,0x41
1520.byte	0xf5,0xf7,0xf7,0x02,	0x83,0xcc,0xcc,0x4f
1521.byte	0x68,0x34,0x34,0x5c,	0x51,0xa5,0xa5,0xf4
1522.byte	0xd1,0xe5,0xe5,0x34,	0xf9,0xf1,0xf1,0x08
1523.byte	0xe2,0x71,0x71,0x93,	0xab,0xd8,0xd8,0x73
1524.byte	0x62,0x31,0x31,0x53,	0x2a,0x15,0x15,0x3f
1525.byte	0x08,0x04,0x04,0x0c,	0x95,0xc7,0xc7,0x52
1526.byte	0x46,0x23,0x23,0x65,	0x9d,0xc3,0xc3,0x5e
1527.byte	0x30,0x18,0x18,0x28,	0x37,0x96,0x96,0xa1
1528.byte	0x0a,0x05,0x05,0x0f,	0x2f,0x9a,0x9a,0xb5
1529.byte	0x0e,0x07,0x07,0x09,	0x24,0x12,0x12,0x36
1530.byte	0x1b,0x80,0x80,0x9b,	0xdf,0xe2,0xe2,0x3d
1531.byte	0xcd,0xeb,0xeb,0x26,	0x4e,0x27,0x27,0x69
1532.byte	0x7f,0xb2,0xb2,0xcd,	0xea,0x75,0x75,0x9f
1533.byte	0x12,0x09,0x09,0x1b,	0x1d,0x83,0x83,0x9e
1534.byte	0x58,0x2c,0x2c,0x74,	0x34,0x1a,0x1a,0x2e
1535.byte	0x36,0x1b,0x1b,0x2d,	0xdc,0x6e,0x6e,0xb2
1536.byte	0xb4,0x5a,0x5a,0xee,	0x5b,0xa0,0xa0,0xfb
1537.byte	0xa4,0x52,0x52,0xf6,	0x76,0x3b,0x3b,0x4d
1538.byte	0xb7,0xd6,0xd6,0x61,	0x7d,0xb3,0xb3,0xce
1539.byte	0x52,0x29,0x29,0x7b,	0xdd,0xe3,0xe3,0x3e
1540.byte	0x5e,0x2f,0x2f,0x71,	0x13,0x84,0x84,0x97
1541.byte	0xa6,0x53,0x53,0xf5,	0xb9,0xd1,0xd1,0x68
1542.byte	0x00,0x00,0x00,0x00,	0xc1,0xed,0xed,0x2c
1543.byte	0x40,0x20,0x20,0x60,	0xe3,0xfc,0xfc,0x1f
1544.byte	0x79,0xb1,0xb1,0xc8,	0xb6,0x5b,0x5b,0xed
1545.byte	0xd4,0x6a,0x6a,0xbe,	0x8d,0xcb,0xcb,0x46
1546.byte	0x67,0xbe,0xbe,0xd9,	0x72,0x39,0x39,0x4b
1547.byte	0x94,0x4a,0x4a,0xde,	0x98,0x4c,0x4c,0xd4
1548.byte	0xb0,0x58,0x58,0xe8,	0x85,0xcf,0xcf,0x4a
1549.byte	0xbb,0xd0,0xd0,0x6b,	0xc5,0xef,0xef,0x2a
1550.byte	0x4f,0xaa,0xaa,0xe5,	0xed,0xfb,0xfb,0x16
1551.byte	0x86,0x43,0x43,0xc5,	0x9a,0x4d,0x4d,0xd7
1552.byte	0x66,0x33,0x33,0x55,	0x11,0x85,0x85,0x94
1553.byte	0x8a,0x45,0x45,0xcf,	0xe9,0xf9,0xf9,0x10
1554.byte	0x04,0x02,0x02,0x06,	0xfe,0x7f,0x7f,0x81
1555.byte	0xa0,0x50,0x50,0xf0,	0x78,0x3c,0x3c,0x44
1556.byte	0x25,0x9f,0x9f,0xba,	0x4b,0xa8,0xa8,0xe3
1557.byte	0xa2,0x51,0x51,0xf3,	0x5d,0xa3,0xa3,0xfe
1558.byte	0x80,0x40,0x40,0xc0,	0x05,0x8f,0x8f,0x8a
1559.byte	0x3f,0x92,0x92,0xad,	0x21,0x9d,0x9d,0xbc
1560.byte	0x70,0x38,0x38,0x48,	0xf1,0xf5,0xf5,0x04
1561.byte	0x63,0xbc,0xbc,0xdf,	0x77,0xb6,0xb6,0xc1
1562.byte	0xaf,0xda,0xda,0x75,	0x42,0x21,0x21,0x63
1563.byte	0x20,0x10,0x10,0x30,	0xe5,0xff,0xff,0x1a
1564.byte	0xfd,0xf3,0xf3,0x0e,	0xbf,0xd2,0xd2,0x6d
1565.byte	0x81,0xcd,0xcd,0x4c,	0x18,0x0c,0x0c,0x14
1566.byte	0x26,0x13,0x13,0x35,	0xc3,0xec,0xec,0x2f
1567.byte	0xbe,0x5f,0x5f,0xe1,	0x35,0x97,0x97,0xa2
1568.byte	0x88,0x44,0x44,0xcc,	0x2e,0x17,0x17,0x39
1569.byte	0x93,0xc4,0xc4,0x57,	0x55,0xa7,0xa7,0xf2
1570.byte	0xfc,0x7e,0x7e,0x82,	0x7a,0x3d,0x3d,0x47
1571.byte	0xc8,0x64,0x64,0xac,	0xba,0x5d,0x5d,0xe7
1572.byte	0x32,0x19,0x19,0x2b,	0xe6,0x73,0x73,0x95
1573.byte	0xc0,0x60,0x60,0xa0,	0x19,0x81,0x81,0x98
1574.byte	0x9e,0x4f,0x4f,0xd1,	0xa3,0xdc,0xdc,0x7f
1575.byte	0x44,0x22,0x22,0x66,	0x54,0x2a,0x2a,0x7e
1576.byte	0x3b,0x90,0x90,0xab,	0x0b,0x88,0x88,0x83
1577.byte	0x8c,0x46,0x46,0xca,	0xc7,0xee,0xee,0x29
1578.byte	0x6b,0xb8,0xb8,0xd3,	0x28,0x14,0x14,0x3c
1579.byte	0xa7,0xde,0xde,0x79,	0xbc,0x5e,0x5e,0xe2
1580.byte	0x16,0x0b,0x0b,0x1d,	0xad,0xdb,0xdb,0x76
1581.byte	0xdb,0xe0,0xe0,0x3b,	0x64,0x32,0x32,0x56
1582.byte	0x74,0x3a,0x3a,0x4e,	0x14,0x0a,0x0a,0x1e
1583.byte	0x92,0x49,0x49,0xdb,	0x0c,0x06,0x06,0x0a
1584.byte	0x48,0x24,0x24,0x6c,	0xb8,0x5c,0x5c,0xe4
1585.byte	0x9f,0xc2,0xc2,0x5d,	0xbd,0xd3,0xd3,0x6e
1586.byte	0x43,0xac,0xac,0xef,	0xc4,0x62,0x62,0xa6
1587.byte	0x39,0x91,0x91,0xa8,	0x31,0x95,0x95,0xa4
1588.byte	0xd3,0xe4,0xe4,0x37,	0xf2,0x79,0x79,0x8b
1589.byte	0xd5,0xe7,0xe7,0x32,	0x8b,0xc8,0xc8,0x43
1590.byte	0x6e,0x37,0x37,0x59,	0xda,0x6d,0x6d,0xb7
1591.byte	0x01,0x8d,0x8d,0x8c,	0xb1,0xd5,0xd5,0x64
1592.byte	0x9c,0x4e,0x4e,0xd2,	0x49,0xa9,0xa9,0xe0
1593.byte	0xd8,0x6c,0x6c,0xb4,	0xac,0x56,0x56,0xfa
1594.byte	0xf3,0xf4,0xf4,0x07,	0xcf,0xea,0xea,0x25
1595.byte	0xca,0x65,0x65,0xaf,	0xf4,0x7a,0x7a,0x8e
1596.byte	0x47,0xae,0xae,0xe9,	0x10,0x08,0x08,0x18
1597.byte	0x6f,0xba,0xba,0xd5,	0xf0,0x78,0x78,0x88
1598.byte	0x4a,0x25,0x25,0x6f,	0x5c,0x2e,0x2e,0x72
1599.byte	0x38,0x1c,0x1c,0x24,	0x57,0xa6,0xa6,0xf1
1600.byte	0x73,0xb4,0xb4,0xc7,	0x97,0xc6,0xc6,0x51
1601.byte	0xcb,0xe8,0xe8,0x23,	0xa1,0xdd,0xdd,0x7c
1602.byte	0xe8,0x74,0x74,0x9c,	0x3e,0x1f,0x1f,0x21
1603.byte	0x96,0x4b,0x4b,0xdd,	0x61,0xbd,0xbd,0xdc
1604.byte	0x0d,0x8b,0x8b,0x86,	0x0f,0x8a,0x8a,0x85
1605.byte	0xe0,0x70,0x70,0x90,	0x7c,0x3e,0x3e,0x42
1606.byte	0x71,0xb5,0xb5,0xc4,	0xcc,0x66,0x66,0xaa
1607.byte	0x90,0x48,0x48,0xd8,	0x06,0x03,0x03,0x05
1608.byte	0xf7,0xf6,0xf6,0x01,	0x1c,0x0e,0x0e,0x12
1609.byte	0xc2,0x61,0x61,0xa3,	0x6a,0x35,0x35,0x5f
1610.byte	0xae,0x57,0x57,0xf9,	0x69,0xb9,0xb9,0xd0
1611.byte	0x17,0x86,0x86,0x91,	0x99,0xc1,0xc1,0x58
1612.byte	0x3a,0x1d,0x1d,0x27,	0x27,0x9e,0x9e,0xb9
1613.byte	0xd9,0xe1,0xe1,0x38,	0xeb,0xf8,0xf8,0x13
1614.byte	0x2b,0x98,0x98,0xb3,	0x22,0x11,0x11,0x33
1615.byte	0xd2,0x69,0x69,0xbb,	0xa9,0xd9,0xd9,0x70
1616.byte	0x07,0x8e,0x8e,0x89,	0x33,0x94,0x94,0xa7
1617.byte	0x2d,0x9b,0x9b,0xb6,	0x3c,0x1e,0x1e,0x22
1618.byte	0x15,0x87,0x87,0x92,	0xc9,0xe9,0xe9,0x20
1619.byte	0x87,0xce,0xce,0x49,	0xaa,0x55,0x55,0xff
1620.byte	0x50,0x28,0x28,0x78,	0xa5,0xdf,0xdf,0x7a
1621.byte	0x03,0x8c,0x8c,0x8f,	0x59,0xa1,0xa1,0xf8
1622.byte	0x09,0x89,0x89,0x80,	0x1a,0x0d,0x0d,0x17
1623.byte	0x65,0xbf,0xbf,0xda,	0xd7,0xe6,0xe6,0x31
1624.byte	0x84,0x42,0x42,0xc6,	0xd0,0x68,0x68,0xb8
1625.byte	0x82,0x41,0x41,0xc3,	0x29,0x99,0x99,0xb0
1626.byte	0x5a,0x2d,0x2d,0x77,	0x1e,0x0f,0x0f,0x11
1627.byte	0x7b,0xb0,0xb0,0xcb,	0xa8,0x54,0x54,0xfc
1628.byte	0x6d,0xbb,0xbb,0xd6,	0x2c,0x16,0x16,0x3a
1629
1630AES_Td:
1631.byte	0x51,0xf4,0xa7,0x50,	0x7e,0x41,0x65,0x53	# Td0
1632.byte	0x1a,0x17,0xa4,0xc3,	0x3a,0x27,0x5e,0x96
1633.byte	0x3b,0xab,0x6b,0xcb,	0x1f,0x9d,0x45,0xf1
1634.byte	0xac,0xfa,0x58,0xab,	0x4b,0xe3,0x03,0x93
1635.byte	0x20,0x30,0xfa,0x55,	0xad,0x76,0x6d,0xf6
1636.byte	0x88,0xcc,0x76,0x91,	0xf5,0x02,0x4c,0x25
1637.byte	0x4f,0xe5,0xd7,0xfc,	0xc5,0x2a,0xcb,0xd7
1638.byte	0x26,0x35,0x44,0x80,	0xb5,0x62,0xa3,0x8f
1639.byte	0xde,0xb1,0x5a,0x49,	0x25,0xba,0x1b,0x67
1640.byte	0x45,0xea,0x0e,0x98,	0x5d,0xfe,0xc0,0xe1
1641.byte	0xc3,0x2f,0x75,0x02,	0x81,0x4c,0xf0,0x12
1642.byte	0x8d,0x46,0x97,0xa3,	0x6b,0xd3,0xf9,0xc6
1643.byte	0x03,0x8f,0x5f,0xe7,	0x15,0x92,0x9c,0x95
1644.byte	0xbf,0x6d,0x7a,0xeb,	0x95,0x52,0x59,0xda
1645.byte	0xd4,0xbe,0x83,0x2d,	0x58,0x74,0x21,0xd3
1646.byte	0x49,0xe0,0x69,0x29,	0x8e,0xc9,0xc8,0x44
1647.byte	0x75,0xc2,0x89,0x6a,	0xf4,0x8e,0x79,0x78
1648.byte	0x99,0x58,0x3e,0x6b,	0x27,0xb9,0x71,0xdd
1649.byte	0xbe,0xe1,0x4f,0xb6,	0xf0,0x88,0xad,0x17
1650.byte	0xc9,0x20,0xac,0x66,	0x7d,0xce,0x3a,0xb4
1651.byte	0x63,0xdf,0x4a,0x18,	0xe5,0x1a,0x31,0x82
1652.byte	0x97,0x51,0x33,0x60,	0x62,0x53,0x7f,0x45
1653.byte	0xb1,0x64,0x77,0xe0,	0xbb,0x6b,0xae,0x84
1654.byte	0xfe,0x81,0xa0,0x1c,	0xf9,0x08,0x2b,0x94
1655.byte	0x70,0x48,0x68,0x58,	0x8f,0x45,0xfd,0x19
1656.byte	0x94,0xde,0x6c,0x87,	0x52,0x7b,0xf8,0xb7
1657.byte	0xab,0x73,0xd3,0x23,	0x72,0x4b,0x02,0xe2
1658.byte	0xe3,0x1f,0x8f,0x57,	0x66,0x55,0xab,0x2a
1659.byte	0xb2,0xeb,0x28,0x07,	0x2f,0xb5,0xc2,0x03
1660.byte	0x86,0xc5,0x7b,0x9a,	0xd3,0x37,0x08,0xa5
1661.byte	0x30,0x28,0x87,0xf2,	0x23,0xbf,0xa5,0xb2
1662.byte	0x02,0x03,0x6a,0xba,	0xed,0x16,0x82,0x5c
1663.byte	0x8a,0xcf,0x1c,0x2b,	0xa7,0x79,0xb4,0x92
1664.byte	0xf3,0x07,0xf2,0xf0,	0x4e,0x69,0xe2,0xa1
1665.byte	0x65,0xda,0xf4,0xcd,	0x06,0x05,0xbe,0xd5
1666.byte	0xd1,0x34,0x62,0x1f,	0xc4,0xa6,0xfe,0x8a
1667.byte	0x34,0x2e,0x53,0x9d,	0xa2,0xf3,0x55,0xa0
1668.byte	0x05,0x8a,0xe1,0x32,	0xa4,0xf6,0xeb,0x75
1669.byte	0x0b,0x83,0xec,0x39,	0x40,0x60,0xef,0xaa
1670.byte	0x5e,0x71,0x9f,0x06,	0xbd,0x6e,0x10,0x51
1671.byte	0x3e,0x21,0x8a,0xf9,	0x96,0xdd,0x06,0x3d
1672.byte	0xdd,0x3e,0x05,0xae,	0x4d,0xe6,0xbd,0x46
1673.byte	0x91,0x54,0x8d,0xb5,	0x71,0xc4,0x5d,0x05
1674.byte	0x04,0x06,0xd4,0x6f,	0x60,0x50,0x15,0xff
1675.byte	0x19,0x98,0xfb,0x24,	0xd6,0xbd,0xe9,0x97
1676.byte	0x89,0x40,0x43,0xcc,	0x67,0xd9,0x9e,0x77
1677.byte	0xb0,0xe8,0x42,0xbd,	0x07,0x89,0x8b,0x88
1678.byte	0xe7,0x19,0x5b,0x38,	0x79,0xc8,0xee,0xdb
1679.byte	0xa1,0x7c,0x0a,0x47,	0x7c,0x42,0x0f,0xe9
1680.byte	0xf8,0x84,0x1e,0xc9,	0x00,0x00,0x00,0x00
1681.byte	0x09,0x80,0x86,0x83,	0x32,0x2b,0xed,0x48
1682.byte	0x1e,0x11,0x70,0xac,	0x6c,0x5a,0x72,0x4e
1683.byte	0xfd,0x0e,0xff,0xfb,	0x0f,0x85,0x38,0x56
1684.byte	0x3d,0xae,0xd5,0x1e,	0x36,0x2d,0x39,0x27
1685.byte	0x0a,0x0f,0xd9,0x64,	0x68,0x5c,0xa6,0x21
1686.byte	0x9b,0x5b,0x54,0xd1,	0x24,0x36,0x2e,0x3a
1687.byte	0x0c,0x0a,0x67,0xb1,	0x93,0x57,0xe7,0x0f
1688.byte	0xb4,0xee,0x96,0xd2,	0x1b,0x9b,0x91,0x9e
1689.byte	0x80,0xc0,0xc5,0x4f,	0x61,0xdc,0x20,0xa2
1690.byte	0x5a,0x77,0x4b,0x69,	0x1c,0x12,0x1a,0x16
1691.byte	0xe2,0x93,0xba,0x0a,	0xc0,0xa0,0x2a,0xe5
1692.byte	0x3c,0x22,0xe0,0x43,	0x12,0x1b,0x17,0x1d
1693.byte	0x0e,0x09,0x0d,0x0b,	0xf2,0x8b,0xc7,0xad
1694.byte	0x2d,0xb6,0xa8,0xb9,	0x14,0x1e,0xa9,0xc8
1695.byte	0x57,0xf1,0x19,0x85,	0xaf,0x75,0x07,0x4c
1696.byte	0xee,0x99,0xdd,0xbb,	0xa3,0x7f,0x60,0xfd
1697.byte	0xf7,0x01,0x26,0x9f,	0x5c,0x72,0xf5,0xbc
1698.byte	0x44,0x66,0x3b,0xc5,	0x5b,0xfb,0x7e,0x34
1699.byte	0x8b,0x43,0x29,0x76,	0xcb,0x23,0xc6,0xdc
1700.byte	0xb6,0xed,0xfc,0x68,	0xb8,0xe4,0xf1,0x63
1701.byte	0xd7,0x31,0xdc,0xca,	0x42,0x63,0x85,0x10
1702.byte	0x13,0x97,0x22,0x40,	0x84,0xc6,0x11,0x20
1703.byte	0x85,0x4a,0x24,0x7d,	0xd2,0xbb,0x3d,0xf8
1704.byte	0xae,0xf9,0x32,0x11,	0xc7,0x29,0xa1,0x6d
1705.byte	0x1d,0x9e,0x2f,0x4b,	0xdc,0xb2,0x30,0xf3
1706.byte	0x0d,0x86,0x52,0xec,	0x77,0xc1,0xe3,0xd0
1707.byte	0x2b,0xb3,0x16,0x6c,	0xa9,0x70,0xb9,0x99
1708.byte	0x11,0x94,0x48,0xfa,	0x47,0xe9,0x64,0x22
1709.byte	0xa8,0xfc,0x8c,0xc4,	0xa0,0xf0,0x3f,0x1a
1710.byte	0x56,0x7d,0x2c,0xd8,	0x22,0x33,0x90,0xef
1711.byte	0x87,0x49,0x4e,0xc7,	0xd9,0x38,0xd1,0xc1
1712.byte	0x8c,0xca,0xa2,0xfe,	0x98,0xd4,0x0b,0x36
1713.byte	0xa6,0xf5,0x81,0xcf,	0xa5,0x7a,0xde,0x28
1714.byte	0xda,0xb7,0x8e,0x26,	0x3f,0xad,0xbf,0xa4
1715.byte	0x2c,0x3a,0x9d,0xe4,	0x50,0x78,0x92,0x0d
1716.byte	0x6a,0x5f,0xcc,0x9b,	0x54,0x7e,0x46,0x62
1717.byte	0xf6,0x8d,0x13,0xc2,	0x90,0xd8,0xb8,0xe8
1718.byte	0x2e,0x39,0xf7,0x5e,	0x82,0xc3,0xaf,0xf5
1719.byte	0x9f,0x5d,0x80,0xbe,	0x69,0xd0,0x93,0x7c
1720.byte	0x6f,0xd5,0x2d,0xa9,	0xcf,0x25,0x12,0xb3
1721.byte	0xc8,0xac,0x99,0x3b,	0x10,0x18,0x7d,0xa7
1722.byte	0xe8,0x9c,0x63,0x6e,	0xdb,0x3b,0xbb,0x7b
1723.byte	0xcd,0x26,0x78,0x09,	0x6e,0x59,0x18,0xf4
1724.byte	0xec,0x9a,0xb7,0x01,	0x83,0x4f,0x9a,0xa8
1725.byte	0xe6,0x95,0x6e,0x65,	0xaa,0xff,0xe6,0x7e
1726.byte	0x21,0xbc,0xcf,0x08,	0xef,0x15,0xe8,0xe6
1727.byte	0xba,0xe7,0x9b,0xd9,	0x4a,0x6f,0x36,0xce
1728.byte	0xea,0x9f,0x09,0xd4,	0x29,0xb0,0x7c,0xd6
1729.byte	0x31,0xa4,0xb2,0xaf,	0x2a,0x3f,0x23,0x31
1730.byte	0xc6,0xa5,0x94,0x30,	0x35,0xa2,0x66,0xc0
1731.byte	0x74,0x4e,0xbc,0x37,	0xfc,0x82,0xca,0xa6
1732.byte	0xe0,0x90,0xd0,0xb0,	0x33,0xa7,0xd8,0x15
1733.byte	0xf1,0x04,0x98,0x4a,	0x41,0xec,0xda,0xf7
1734.byte	0x7f,0xcd,0x50,0x0e,	0x17,0x91,0xf6,0x2f
1735.byte	0x76,0x4d,0xd6,0x8d,	0x43,0xef,0xb0,0x4d
1736.byte	0xcc,0xaa,0x4d,0x54,	0xe4,0x96,0x04,0xdf
1737.byte	0x9e,0xd1,0xb5,0xe3,	0x4c,0x6a,0x88,0x1b
1738.byte	0xc1,0x2c,0x1f,0xb8,	0x46,0x65,0x51,0x7f
1739.byte	0x9d,0x5e,0xea,0x04,	0x01,0x8c,0x35,0x5d
1740.byte	0xfa,0x87,0x74,0x73,	0xfb,0x0b,0x41,0x2e
1741.byte	0xb3,0x67,0x1d,0x5a,	0x92,0xdb,0xd2,0x52
1742.byte	0xe9,0x10,0x56,0x33,	0x6d,0xd6,0x47,0x13
1743.byte	0x9a,0xd7,0x61,0x8c,	0x37,0xa1,0x0c,0x7a
1744.byte	0x59,0xf8,0x14,0x8e,	0xeb,0x13,0x3c,0x89
1745.byte	0xce,0xa9,0x27,0xee,	0xb7,0x61,0xc9,0x35
1746.byte	0xe1,0x1c,0xe5,0xed,	0x7a,0x47,0xb1,0x3c
1747.byte	0x9c,0xd2,0xdf,0x59,	0x55,0xf2,0x73,0x3f
1748.byte	0x18,0x14,0xce,0x79,	0x73,0xc7,0x37,0xbf
1749.byte	0x53,0xf7,0xcd,0xea,	0x5f,0xfd,0xaa,0x5b
1750.byte	0xdf,0x3d,0x6f,0x14,	0x78,0x44,0xdb,0x86
1751.byte	0xca,0xaf,0xf3,0x81,	0xb9,0x68,0xc4,0x3e
1752.byte	0x38,0x24,0x34,0x2c,	0xc2,0xa3,0x40,0x5f
1753.byte	0x16,0x1d,0xc3,0x72,	0xbc,0xe2,0x25,0x0c
1754.byte	0x28,0x3c,0x49,0x8b,	0xff,0x0d,0x95,0x41
1755.byte	0x39,0xa8,0x01,0x71,	0x08,0x0c,0xb3,0xde
1756.byte	0xd8,0xb4,0xe4,0x9c,	0x64,0x56,0xc1,0x90
1757.byte	0x7b,0xcb,0x84,0x61,	0xd5,0x32,0xb6,0x70
1758.byte	0x48,0x6c,0x5c,0x74,	0xd0,0xb8,0x57,0x42
1759
1760.byte	0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38	# Td4
1761.byte	0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb
1762.byte	0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87
1763.byte	0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb
1764.byte	0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d
1765.byte	0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e
1766.byte	0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2
1767.byte	0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25
1768.byte	0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16
1769.byte	0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92
1770.byte	0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda
1771.byte	0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84
1772.byte	0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a
1773.byte	0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06
1774.byte	0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02
1775.byte	0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b
1776.byte	0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea
1777.byte	0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73
1778.byte	0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85
1779.byte	0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e
1780.byte	0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89
1781.byte	0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b
1782.byte	0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20
1783.byte	0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4
1784.byte	0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31
1785.byte	0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f
1786.byte	0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d
1787.byte	0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef
1788.byte	0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0
1789.byte	0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61
1790.byte	0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26
1791.byte	0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
1792
1793AES_Te4:
1794.byte	0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5	# Te4
1795.byte	0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76
1796.byte	0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0
1797.byte	0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0
1798.byte	0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc
1799.byte	0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15
1800.byte	0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a
1801.byte	0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75
1802.byte	0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0
1803.byte	0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84
1804.byte	0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b
1805.byte	0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf
1806.byte	0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85
1807.byte	0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8
1808.byte	0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5
1809.byte	0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2
1810.byte	0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17
1811.byte	0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73
1812.byte	0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88
1813.byte	0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb
1814.byte	0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c
1815.byte	0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79
1816.byte	0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9
1817.byte	0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08
1818.byte	0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6
1819.byte	0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a
1820.byte	0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e
1821.byte	0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e
1822.byte	0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94
1823.byte	0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf
1824.byte	0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68
1825.byte	0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
1826
1827.byte	0x01,0x00,0x00,0x00,	0x02,0x00,0x00,0x00	# rcon
1828.byte	0x04,0x00,0x00,0x00,	0x08,0x00,0x00,0x00
1829.byte	0x10,0x00,0x00,0x00,	0x20,0x00,0x00,0x00
1830.byte	0x40,0x00,0x00,0x00,	0x80,0x00,0x00,0x00
1831.byte	0x1B,0x00,0x00,0x00,	0x36,0x00,0x00,0x00
1832