1# This file is generated from a similarly-named Perl script in the BoringSSL
2# source tree. Do not edit by hand.
3
4#if defined(__has_feature)
5#if __has_feature(memory_sanitizer) && !defined(OPENSSL_NO_ASM)
6#define OPENSSL_NO_ASM
7#endif
8#endif
9
10#if !defined(OPENSSL_NO_ASM) && defined(__powerpc64__)
11.machine	"any"
12
13.abiversion	2
14.text
15
16.align	7
17.Lrcon:
18.byte	0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01
19.byte	0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x1b
20.byte	0x0c,0x0f,0x0e,0x0d,0x0c,0x0f,0x0e,0x0d,0x0c,0x0f,0x0e,0x0d,0x0c,0x0f,0x0e,0x0d
21.byte	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
22.Lconsts:
23	mflr	0
24	bcl	20,31,$+4
25	mflr	6
26	addi	6,6,-0x48
27	mtlr	0
28	blr
29.long	0
30.byte	0,12,0x14,0,0,0,0,0
31.byte	65,69,83,32,102,111,114,32,80,111,119,101,114,73,83,65,32,50,46,48,55,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
32.align	2
33
34.globl	aes_hw_set_encrypt_key
35.type	aes_hw_set_encrypt_key,@function
36.align	5
37aes_hw_set_encrypt_key:
38.localentry	aes_hw_set_encrypt_key,0
39
40.Lset_encrypt_key:
41	mflr	11
42	std	11,16(1)
43
44	li	6,-1
45	cmpldi	3,0
46	beq-	.Lenc_key_abort
47	cmpldi	5,0
48	beq-	.Lenc_key_abort
49	li	6,-2
50	cmpwi	4,128
51	blt-	.Lenc_key_abort
52	cmpwi	4,256
53	bgt-	.Lenc_key_abort
54	andi.	0,4,0x3f
55	bne-	.Lenc_key_abort
56
57	lis	0,0xfff0
58	li	12,-1
59	or	0,0,0
60
61	bl	.Lconsts
62	mtlr	11
63
64	neg	9,3
65	lvx	1,0,3
66	addi	3,3,15
67	lvsr	3,0,9
68	li	8,0x20
69	cmpwi	4,192
70	lvx	2,0,3
71	vspltisb	5,0x0f
72	lvx	4,0,6
73	vxor	3,3,5
74	lvx	5,8,6
75	addi	6,6,0x10
76	vperm	1,1,2,3
77	li	7,8
78	vxor	0,0,0
79	mtctr	7
80
81	lvsl	8,0,5
82	vspltisb	9,-1
83	lvx	10,0,5
84	vperm	9,9,0,8
85
86	blt	.Loop128
87	addi	3,3,8
88	beq	.L192
89	addi	3,3,8
90	b	.L256
91
92.align	4
93.Loop128:
94	vperm	3,1,1,5
95	vsldoi	6,0,1,12
96	vperm	11,1,1,8
97	vsel	7,10,11,9
98	vor	10,11,11
99	.long	0x10632509
100	stvx	7,0,5
101	addi	5,5,16
102
103	vxor	1,1,6
104	vsldoi	6,0,6,12
105	vxor	1,1,6
106	vsldoi	6,0,6,12
107	vxor	1,1,6
108	vadduwm	4,4,4
109	vxor	1,1,3
110	bdnz	.Loop128
111
112	lvx	4,0,6
113
114	vperm	3,1,1,5
115	vsldoi	6,0,1,12
116	vperm	11,1,1,8
117	vsel	7,10,11,9
118	vor	10,11,11
119	.long	0x10632509
120	stvx	7,0,5
121	addi	5,5,16
122
123	vxor	1,1,6
124	vsldoi	6,0,6,12
125	vxor	1,1,6
126	vsldoi	6,0,6,12
127	vxor	1,1,6
128	vadduwm	4,4,4
129	vxor	1,1,3
130
131	vperm	3,1,1,5
132	vsldoi	6,0,1,12
133	vperm	11,1,1,8
134	vsel	7,10,11,9
135	vor	10,11,11
136	.long	0x10632509
137	stvx	7,0,5
138	addi	5,5,16
139
140	vxor	1,1,6
141	vsldoi	6,0,6,12
142	vxor	1,1,6
143	vsldoi	6,0,6,12
144	vxor	1,1,6
145	vxor	1,1,3
146	vperm	11,1,1,8
147	vsel	7,10,11,9
148	vor	10,11,11
149	stvx	7,0,5
150
151	addi	3,5,15
152	addi	5,5,0x50
153
154	li	8,10
155	b	.Ldone
156
157.align	4
158.L192:
159	lvx	6,0,3
160	li	7,4
161	vperm	11,1,1,8
162	vsel	7,10,11,9
163	vor	10,11,11
164	stvx	7,0,5
165	addi	5,5,16
166	vperm	2,2,6,3
167	vspltisb	3,8
168	mtctr	7
169	vsububm	5,5,3
170
171.Loop192:
172	vperm	3,2,2,5
173	vsldoi	6,0,1,12
174	.long	0x10632509
175
176	vxor	1,1,6
177	vsldoi	6,0,6,12
178	vxor	1,1,6
179	vsldoi	6,0,6,12
180	vxor	1,1,6
181
182	vsldoi	7,0,2,8
183	vspltw	6,1,3
184	vxor	6,6,2
185	vsldoi	2,0,2,12
186	vadduwm	4,4,4
187	vxor	2,2,6
188	vxor	1,1,3
189	vxor	2,2,3
190	vsldoi	7,7,1,8
191
192	vperm	3,2,2,5
193	vsldoi	6,0,1,12
194	vperm	11,7,7,8
195	vsel	7,10,11,9
196	vor	10,11,11
197	.long	0x10632509
198	stvx	7,0,5
199	addi	5,5,16
200
201	vsldoi	7,1,2,8
202	vxor	1,1,6
203	vsldoi	6,0,6,12
204	vperm	11,7,7,8
205	vsel	7,10,11,9
206	vor	10,11,11
207	vxor	1,1,6
208	vsldoi	6,0,6,12
209	vxor	1,1,6
210	stvx	7,0,5
211	addi	5,5,16
212
213	vspltw	6,1,3
214	vxor	6,6,2
215	vsldoi	2,0,2,12
216	vadduwm	4,4,4
217	vxor	2,2,6
218	vxor	1,1,3
219	vxor	2,2,3
220	vperm	11,1,1,8
221	vsel	7,10,11,9
222	vor	10,11,11
223	stvx	7,0,5
224	addi	3,5,15
225	addi	5,5,16
226	bdnz	.Loop192
227
228	li	8,12
229	addi	5,5,0x20
230	b	.Ldone
231
232.align	4
233.L256:
234	lvx	6,0,3
235	li	7,7
236	li	8,14
237	vperm	11,1,1,8
238	vsel	7,10,11,9
239	vor	10,11,11
240	stvx	7,0,5
241	addi	5,5,16
242	vperm	2,2,6,3
243	mtctr	7
244
245.Loop256:
246	vperm	3,2,2,5
247	vsldoi	6,0,1,12
248	vperm	11,2,2,8
249	vsel	7,10,11,9
250	vor	10,11,11
251	.long	0x10632509
252	stvx	7,0,5
253	addi	5,5,16
254
255	vxor	1,1,6
256	vsldoi	6,0,6,12
257	vxor	1,1,6
258	vsldoi	6,0,6,12
259	vxor	1,1,6
260	vadduwm	4,4,4
261	vxor	1,1,3
262	vperm	11,1,1,8
263	vsel	7,10,11,9
264	vor	10,11,11
265	stvx	7,0,5
266	addi	3,5,15
267	addi	5,5,16
268	bdz	.Ldone
269
270	vspltw	3,1,3
271	vsldoi	6,0,2,12
272	.long	0x106305C8
273
274	vxor	2,2,6
275	vsldoi	6,0,6,12
276	vxor	2,2,6
277	vsldoi	6,0,6,12
278	vxor	2,2,6
279
280	vxor	2,2,3
281	b	.Loop256
282
283.align	4
284.Ldone:
285	lvx	2,0,3
286	vsel	2,10,2,9
287	stvx	2,0,3
288	li	6,0
289	or	12,12,12
290	stw	8,0(5)
291
292.Lenc_key_abort:
293	mr	3,6
294	blr
295.long	0
296.byte	0,12,0x14,1,0,0,3,0
297.long	0
298.size	aes_hw_set_encrypt_key,.-aes_hw_set_encrypt_key
299
300.globl	aes_hw_set_decrypt_key
301.type	aes_hw_set_decrypt_key,@function
302.align	5
303aes_hw_set_decrypt_key:
304.localentry	aes_hw_set_decrypt_key,0
305
306	stdu	1,-64(1)
307	mflr	10
308	std	10,80(1)
309	bl	.Lset_encrypt_key
310	mtlr	10
311
312	cmpwi	3,0
313	bne-	.Ldec_key_abort
314
315	slwi	7,8,4
316	subi	3,5,240
317	srwi	8,8,1
318	add	5,3,7
319	mtctr	8
320
321.Ldeckey:
322	lwz	0, 0(3)
323	lwz	6, 4(3)
324	lwz	7, 8(3)
325	lwz	8, 12(3)
326	addi	3,3,16
327	lwz	9, 0(5)
328	lwz	10,4(5)
329	lwz	11,8(5)
330	lwz	12,12(5)
331	stw	0, 0(5)
332	stw	6, 4(5)
333	stw	7, 8(5)
334	stw	8, 12(5)
335	subi	5,5,16
336	stw	9, -16(3)
337	stw	10,-12(3)
338	stw	11,-8(3)
339	stw	12,-4(3)
340	bdnz	.Ldeckey
341
342	xor	3,3,3
343.Ldec_key_abort:
344	addi	1,1,64
345	blr
346.long	0
347.byte	0,12,4,1,0x80,0,3,0
348.long	0
349.size	aes_hw_set_decrypt_key,.-aes_hw_set_decrypt_key
350.globl	aes_hw_encrypt
351.type	aes_hw_encrypt,@function
352.align	5
353aes_hw_encrypt:
354.localentry	aes_hw_encrypt,0
355
356	lwz	6,240(5)
357	lis	0,0xfc00
358	li	12,-1
359	li	7,15
360	or	0,0,0
361
362	lvx	0,0,3
363	neg	11,4
364	lvx	1,7,3
365	lvsl	2,0,3
366	vspltisb	4,0x0f
367	lvsr	3,0,11
368	vxor	2,2,4
369	li	7,16
370	vperm	0,0,1,2
371	lvx	1,0,5
372	lvsr	5,0,5
373	srwi	6,6,1
374	lvx	2,7,5
375	addi	7,7,16
376	subi	6,6,1
377	vperm	1,2,1,5
378
379	vxor	0,0,1
380	lvx	1,7,5
381	addi	7,7,16
382	mtctr	6
383
384.Loop_enc:
385	vperm	2,1,2,5
386	.long	0x10001508
387	lvx	2,7,5
388	addi	7,7,16
389	vperm	1,2,1,5
390	.long	0x10000D08
391	lvx	1,7,5
392	addi	7,7,16
393	bdnz	.Loop_enc
394
395	vperm	2,1,2,5
396	.long	0x10001508
397	lvx	2,7,5
398	vperm	1,2,1,5
399	.long	0x10000D09
400
401	vspltisb	2,-1
402	vxor	1,1,1
403	li	7,15
404	vperm	2,2,1,3
405	vxor	3,3,4
406	lvx	1,0,4
407	vperm	0,0,0,3
408	vsel	1,1,0,2
409	lvx	4,7,4
410	stvx	1,0,4
411	vsel	0,0,4,2
412	stvx	0,7,4
413
414	or	12,12,12
415	blr
416.long	0
417.byte	0,12,0x14,0,0,0,3,0
418.long	0
419.size	aes_hw_encrypt,.-aes_hw_encrypt
420.globl	aes_hw_decrypt
421.type	aes_hw_decrypt,@function
422.align	5
423aes_hw_decrypt:
424.localentry	aes_hw_decrypt,0
425
426	lwz	6,240(5)
427	lis	0,0xfc00
428	li	12,-1
429	li	7,15
430	or	0,0,0
431
432	lvx	0,0,3
433	neg	11,4
434	lvx	1,7,3
435	lvsl	2,0,3
436	vspltisb	4,0x0f
437	lvsr	3,0,11
438	vxor	2,2,4
439	li	7,16
440	vperm	0,0,1,2
441	lvx	1,0,5
442	lvsr	5,0,5
443	srwi	6,6,1
444	lvx	2,7,5
445	addi	7,7,16
446	subi	6,6,1
447	vperm	1,2,1,5
448
449	vxor	0,0,1
450	lvx	1,7,5
451	addi	7,7,16
452	mtctr	6
453
454.Loop_dec:
455	vperm	2,1,2,5
456	.long	0x10001548
457	lvx	2,7,5
458	addi	7,7,16
459	vperm	1,2,1,5
460	.long	0x10000D48
461	lvx	1,7,5
462	addi	7,7,16
463	bdnz	.Loop_dec
464
465	vperm	2,1,2,5
466	.long	0x10001548
467	lvx	2,7,5
468	vperm	1,2,1,5
469	.long	0x10000D49
470
471	vspltisb	2,-1
472	vxor	1,1,1
473	li	7,15
474	vperm	2,2,1,3
475	vxor	3,3,4
476	lvx	1,0,4
477	vperm	0,0,0,3
478	vsel	1,1,0,2
479	lvx	4,7,4
480	stvx	1,0,4
481	vsel	0,0,4,2
482	stvx	0,7,4
483
484	or	12,12,12
485	blr
486.long	0
487.byte	0,12,0x14,0,0,0,3,0
488.long	0
489.size	aes_hw_decrypt,.-aes_hw_decrypt
490.globl	aes_hw_cbc_encrypt
491.type	aes_hw_cbc_encrypt,@function
492.align	5
493aes_hw_cbc_encrypt:
494.localentry	aes_hw_cbc_encrypt,0
495
496	cmpldi	5,16
497	.long	0x4dc00020
498
499	cmpwi	8,0
500	lis	0,0xffe0
501	li	12,-1
502	or	0,0,0
503
504	li	10,15
505	vxor	0,0,0
506	vspltisb	3,0x0f
507
508	lvx	4,0,7
509	lvsl	6,0,7
510	lvx	5,10,7
511	vxor	6,6,3
512	vperm	4,4,5,6
513
514	neg	11,3
515	lvsr	10,0,6
516	lwz	9,240(6)
517
518	lvsr	6,0,11
519	lvx	5,0,3
520	addi	3,3,15
521	vxor	6,6,3
522
523	lvsl	8,0,4
524	vspltisb	9,-1
525	lvx	7,0,4
526	vperm	9,9,0,8
527	vxor	8,8,3
528
529	srwi	9,9,1
530	li	10,16
531	subi	9,9,1
532	beq	.Lcbc_dec
533
534.Lcbc_enc:
535	vor	2,5,5
536	lvx	5,0,3
537	addi	3,3,16
538	mtctr	9
539	subi	5,5,16
540
541	lvx	0,0,6
542	vperm	2,2,5,6
543	lvx	1,10,6
544	addi	10,10,16
545	vperm	0,1,0,10
546	vxor	2,2,0
547	lvx	0,10,6
548	addi	10,10,16
549	vxor	2,2,4
550
551.Loop_cbc_enc:
552	vperm	1,0,1,10
553	.long	0x10420D08
554	lvx	1,10,6
555	addi	10,10,16
556	vperm	0,1,0,10
557	.long	0x10420508
558	lvx	0,10,6
559	addi	10,10,16
560	bdnz	.Loop_cbc_enc
561
562	vperm	1,0,1,10
563	.long	0x10420D08
564	lvx	1,10,6
565	li	10,16
566	vperm	0,1,0,10
567	.long	0x10820509
568	cmpldi	5,16
569
570	vperm	3,4,4,8
571	vsel	2,7,3,9
572	vor	7,3,3
573	stvx	2,0,4
574	addi	4,4,16
575	bge	.Lcbc_enc
576
577	b	.Lcbc_done
578
579.align	4
580.Lcbc_dec:
581	cmpldi	5,128
582	bge	_aesp8_cbc_decrypt8x
583	vor	3,5,5
584	lvx	5,0,3
585	addi	3,3,16
586	mtctr	9
587	subi	5,5,16
588
589	lvx	0,0,6
590	vperm	3,3,5,6
591	lvx	1,10,6
592	addi	10,10,16
593	vperm	0,1,0,10
594	vxor	2,3,0
595	lvx	0,10,6
596	addi	10,10,16
597
598.Loop_cbc_dec:
599	vperm	1,0,1,10
600	.long	0x10420D48
601	lvx	1,10,6
602	addi	10,10,16
603	vperm	0,1,0,10
604	.long	0x10420548
605	lvx	0,10,6
606	addi	10,10,16
607	bdnz	.Loop_cbc_dec
608
609	vperm	1,0,1,10
610	.long	0x10420D48
611	lvx	1,10,6
612	li	10,16
613	vperm	0,1,0,10
614	.long	0x10420549
615	cmpldi	5,16
616
617	vxor	2,2,4
618	vor	4,3,3
619	vperm	3,2,2,8
620	vsel	2,7,3,9
621	vor	7,3,3
622	stvx	2,0,4
623	addi	4,4,16
624	bge	.Lcbc_dec
625
626.Lcbc_done:
627	addi	4,4,-1
628	lvx	2,0,4
629	vsel	2,7,2,9
630	stvx	2,0,4
631
632	neg	8,7
633	li	10,15
634	vxor	0,0,0
635	vspltisb	9,-1
636	vspltisb	3,0x0f
637	lvsr	8,0,8
638	vperm	9,9,0,8
639	vxor	8,8,3
640	lvx	7,0,7
641	vperm	4,4,4,8
642	vsel	2,7,4,9
643	lvx	5,10,7
644	stvx	2,0,7
645	vsel	2,4,5,9
646	stvx	2,10,7
647
648	or	12,12,12
649	blr
650.long	0
651.byte	0,12,0x14,0,0,0,6,0
652.long	0
653.align	5
654_aesp8_cbc_decrypt8x:
655	stdu	1,-448(1)
656	li	10,207
657	li	11,223
658	stvx	20,10,1
659	addi	10,10,32
660	stvx	21,11,1
661	addi	11,11,32
662	stvx	22,10,1
663	addi	10,10,32
664	stvx	23,11,1
665	addi	11,11,32
666	stvx	24,10,1
667	addi	10,10,32
668	stvx	25,11,1
669	addi	11,11,32
670	stvx	26,10,1
671	addi	10,10,32
672	stvx	27,11,1
673	addi	11,11,32
674	stvx	28,10,1
675	addi	10,10,32
676	stvx	29,11,1
677	addi	11,11,32
678	stvx	30,10,1
679	stvx	31,11,1
680	li	0,-1
681	stw	12,396(1)
682	li	8,0x10
683	std	26,400(1)
684	li	26,0x20
685	std	27,408(1)
686	li	27,0x30
687	std	28,416(1)
688	li	28,0x40
689	std	29,424(1)
690	li	29,0x50
691	std	30,432(1)
692	li	30,0x60
693	std	31,440(1)
694	li	31,0x70
695	or	0,0,0
696
697	subi	9,9,3
698	subi	5,5,128
699
700	lvx	23,0,6
701	lvx	30,8,6
702	addi	6,6,0x20
703	lvx	31,0,6
704	vperm	23,30,23,10
705	addi	11,1,79
706	mtctr	9
707
708.Load_cbc_dec_key:
709	vperm	24,31,30,10
710	lvx	30,8,6
711	addi	6,6,0x20
712	stvx	24,0,11
713	vperm	25,30,31,10
714	lvx	31,0,6
715	stvx	25,8,11
716	addi	11,11,0x20
717	bdnz	.Load_cbc_dec_key
718
719	lvx	26,8,6
720	vperm	24,31,30,10
721	lvx	27,26,6
722	stvx	24,0,11
723	vperm	25,26,31,10
724	lvx	28,27,6
725	stvx	25,8,11
726	addi	11,1,79
727	vperm	26,27,26,10
728	lvx	29,28,6
729	vperm	27,28,27,10
730	lvx	30,29,6
731	vperm	28,29,28,10
732	lvx	31,30,6
733	vperm	29,30,29,10
734	lvx	14,31,6
735	vperm	30,31,30,10
736	lvx	24,0,11
737	vperm	31,14,31,10
738	lvx	25,8,11
739
740
741
742	subi	3,3,15
743
744	li	10,8
745	.long	0x7C001E99
746	lvsl	6,0,10
747	vspltisb	3,0x0f
748	.long	0x7C281E99
749	vxor	6,6,3
750	.long	0x7C5A1E99
751	vperm	0,0,0,6
752	.long	0x7C7B1E99
753	vperm	1,1,1,6
754	.long	0x7D5C1E99
755	vperm	2,2,2,6
756	vxor	14,0,23
757	.long	0x7D7D1E99
758	vperm	3,3,3,6
759	vxor	15,1,23
760	.long	0x7D9E1E99
761	vperm	10,10,10,6
762	vxor	16,2,23
763	.long	0x7DBF1E99
764	addi	3,3,0x80
765	vperm	11,11,11,6
766	vxor	17,3,23
767	vperm	12,12,12,6
768	vxor	18,10,23
769	vperm	13,13,13,6
770	vxor	19,11,23
771	vxor	20,12,23
772	vxor	21,13,23
773
774	mtctr	9
775	b	.Loop_cbc_dec8x
776.align	5
777.Loop_cbc_dec8x:
778	.long	0x11CEC548
779	.long	0x11EFC548
780	.long	0x1210C548
781	.long	0x1231C548
782	.long	0x1252C548
783	.long	0x1273C548
784	.long	0x1294C548
785	.long	0x12B5C548
786	lvx	24,26,11
787	addi	11,11,0x20
788
789	.long	0x11CECD48
790	.long	0x11EFCD48
791	.long	0x1210CD48
792	.long	0x1231CD48
793	.long	0x1252CD48
794	.long	0x1273CD48
795	.long	0x1294CD48
796	.long	0x12B5CD48
797	lvx	25,8,11
798	bdnz	.Loop_cbc_dec8x
799
800	subic	5,5,128
801	.long	0x11CEC548
802	.long	0x11EFC548
803	.long	0x1210C548
804	.long	0x1231C548
805	.long	0x1252C548
806	.long	0x1273C548
807	.long	0x1294C548
808	.long	0x12B5C548
809
810	subfe.	0,0,0
811	.long	0x11CECD48
812	.long	0x11EFCD48
813	.long	0x1210CD48
814	.long	0x1231CD48
815	.long	0x1252CD48
816	.long	0x1273CD48
817	.long	0x1294CD48
818	.long	0x12B5CD48
819
820	and	0,0,5
821	.long	0x11CED548
822	.long	0x11EFD548
823	.long	0x1210D548
824	.long	0x1231D548
825	.long	0x1252D548
826	.long	0x1273D548
827	.long	0x1294D548
828	.long	0x12B5D548
829
830	add	3,3,0
831
832
833
834	.long	0x11CEDD48
835	.long	0x11EFDD48
836	.long	0x1210DD48
837	.long	0x1231DD48
838	.long	0x1252DD48
839	.long	0x1273DD48
840	.long	0x1294DD48
841	.long	0x12B5DD48
842
843	addi	11,1,79
844	.long	0x11CEE548
845	.long	0x11EFE548
846	.long	0x1210E548
847	.long	0x1231E548
848	.long	0x1252E548
849	.long	0x1273E548
850	.long	0x1294E548
851	.long	0x12B5E548
852	lvx	24,0,11
853
854	.long	0x11CEED48
855	.long	0x11EFED48
856	.long	0x1210ED48
857	.long	0x1231ED48
858	.long	0x1252ED48
859	.long	0x1273ED48
860	.long	0x1294ED48
861	.long	0x12B5ED48
862	lvx	25,8,11
863
864	.long	0x11CEF548
865	vxor	4,4,31
866	.long	0x11EFF548
867	vxor	0,0,31
868	.long	0x1210F548
869	vxor	1,1,31
870	.long	0x1231F548
871	vxor	2,2,31
872	.long	0x1252F548
873	vxor	3,3,31
874	.long	0x1273F548
875	vxor	10,10,31
876	.long	0x1294F548
877	vxor	11,11,31
878	.long	0x12B5F548
879	vxor	12,12,31
880
881	.long	0x11CE2549
882	.long	0x11EF0549
883	.long	0x7C001E99
884	.long	0x12100D49
885	.long	0x7C281E99
886	.long	0x12311549
887	vperm	0,0,0,6
888	.long	0x7C5A1E99
889	.long	0x12521D49
890	vperm	1,1,1,6
891	.long	0x7C7B1E99
892	.long	0x12735549
893	vperm	2,2,2,6
894	.long	0x7D5C1E99
895	.long	0x12945D49
896	vperm	3,3,3,6
897	.long	0x7D7D1E99
898	.long	0x12B56549
899	vperm	10,10,10,6
900	.long	0x7D9E1E99
901	vor	4,13,13
902	vperm	11,11,11,6
903	.long	0x7DBF1E99
904	addi	3,3,0x80
905
906	vperm	14,14,14,6
907	vperm	15,15,15,6
908	.long	0x7DC02799
909	vperm	12,12,12,6
910	vxor	14,0,23
911	vperm	16,16,16,6
912	.long	0x7DE82799
913	vperm	13,13,13,6
914	vxor	15,1,23
915	vperm	17,17,17,6
916	.long	0x7E1A2799
917	vxor	16,2,23
918	vperm	18,18,18,6
919	.long	0x7E3B2799
920	vxor	17,3,23
921	vperm	19,19,19,6
922	.long	0x7E5C2799
923	vxor	18,10,23
924	vperm	20,20,20,6
925	.long	0x7E7D2799
926	vxor	19,11,23
927	vperm	21,21,21,6
928	.long	0x7E9E2799
929	vxor	20,12,23
930	.long	0x7EBF2799
931	addi	4,4,0x80
932	vxor	21,13,23
933
934	mtctr	9
935	beq	.Loop_cbc_dec8x
936
937	addic.	5,5,128
938	beq	.Lcbc_dec8x_done
939	nop
940	nop
941
942.Loop_cbc_dec8x_tail:
943	.long	0x11EFC548
944	.long	0x1210C548
945	.long	0x1231C548
946	.long	0x1252C548
947	.long	0x1273C548
948	.long	0x1294C548
949	.long	0x12B5C548
950	lvx	24,26,11
951	addi	11,11,0x20
952
953	.long	0x11EFCD48
954	.long	0x1210CD48
955	.long	0x1231CD48
956	.long	0x1252CD48
957	.long	0x1273CD48
958	.long	0x1294CD48
959	.long	0x12B5CD48
960	lvx	25,8,11
961	bdnz	.Loop_cbc_dec8x_tail
962
963	.long	0x11EFC548
964	.long	0x1210C548
965	.long	0x1231C548
966	.long	0x1252C548
967	.long	0x1273C548
968	.long	0x1294C548
969	.long	0x12B5C548
970
971	.long	0x11EFCD48
972	.long	0x1210CD48
973	.long	0x1231CD48
974	.long	0x1252CD48
975	.long	0x1273CD48
976	.long	0x1294CD48
977	.long	0x12B5CD48
978
979	.long	0x11EFD548
980	.long	0x1210D548
981	.long	0x1231D548
982	.long	0x1252D548
983	.long	0x1273D548
984	.long	0x1294D548
985	.long	0x12B5D548
986
987	.long	0x11EFDD48
988	.long	0x1210DD48
989	.long	0x1231DD48
990	.long	0x1252DD48
991	.long	0x1273DD48
992	.long	0x1294DD48
993	.long	0x12B5DD48
994
995	.long	0x11EFE548
996	.long	0x1210E548
997	.long	0x1231E548
998	.long	0x1252E548
999	.long	0x1273E548
1000	.long	0x1294E548
1001	.long	0x12B5E548
1002
1003	.long	0x11EFED48
1004	.long	0x1210ED48
1005	.long	0x1231ED48
1006	.long	0x1252ED48
1007	.long	0x1273ED48
1008	.long	0x1294ED48
1009	.long	0x12B5ED48
1010
1011	.long	0x11EFF548
1012	vxor	4,4,31
1013	.long	0x1210F548
1014	vxor	1,1,31
1015	.long	0x1231F548
1016	vxor	2,2,31
1017	.long	0x1252F548
1018	vxor	3,3,31
1019	.long	0x1273F548
1020	vxor	10,10,31
1021	.long	0x1294F548
1022	vxor	11,11,31
1023	.long	0x12B5F548
1024	vxor	12,12,31
1025
1026	cmplwi	5,32
1027	blt	.Lcbc_dec8x_one
1028	nop
1029	beq	.Lcbc_dec8x_two
1030	cmplwi	5,64
1031	blt	.Lcbc_dec8x_three
1032	nop
1033	beq	.Lcbc_dec8x_four
1034	cmplwi	5,96
1035	blt	.Lcbc_dec8x_five
1036	nop
1037	beq	.Lcbc_dec8x_six
1038
1039.Lcbc_dec8x_seven:
1040	.long	0x11EF2549
1041	.long	0x12100D49
1042	.long	0x12311549
1043	.long	0x12521D49
1044	.long	0x12735549
1045	.long	0x12945D49
1046	.long	0x12B56549
1047	vor	4,13,13
1048
1049	vperm	15,15,15,6
1050	vperm	16,16,16,6
1051	.long	0x7DE02799
1052	vperm	17,17,17,6
1053	.long	0x7E082799
1054	vperm	18,18,18,6
1055	.long	0x7E3A2799
1056	vperm	19,19,19,6
1057	.long	0x7E5B2799
1058	vperm	20,20,20,6
1059	.long	0x7E7C2799
1060	vperm	21,21,21,6
1061	.long	0x7E9D2799
1062	.long	0x7EBE2799
1063	addi	4,4,0x70
1064	b	.Lcbc_dec8x_done
1065
1066.align	5
1067.Lcbc_dec8x_six:
1068	.long	0x12102549
1069	.long	0x12311549
1070	.long	0x12521D49
1071	.long	0x12735549
1072	.long	0x12945D49
1073	.long	0x12B56549
1074	vor	4,13,13
1075
1076	vperm	16,16,16,6
1077	vperm	17,17,17,6
1078	.long	0x7E002799
1079	vperm	18,18,18,6
1080	.long	0x7E282799
1081	vperm	19,19,19,6
1082	.long	0x7E5A2799
1083	vperm	20,20,20,6
1084	.long	0x7E7B2799
1085	vperm	21,21,21,6
1086	.long	0x7E9C2799
1087	.long	0x7EBD2799
1088	addi	4,4,0x60
1089	b	.Lcbc_dec8x_done
1090
1091.align	5
1092.Lcbc_dec8x_five:
1093	.long	0x12312549
1094	.long	0x12521D49
1095	.long	0x12735549
1096	.long	0x12945D49
1097	.long	0x12B56549
1098	vor	4,13,13
1099
1100	vperm	17,17,17,6
1101	vperm	18,18,18,6
1102	.long	0x7E202799
1103	vperm	19,19,19,6
1104	.long	0x7E482799
1105	vperm	20,20,20,6
1106	.long	0x7E7A2799
1107	vperm	21,21,21,6
1108	.long	0x7E9B2799
1109	.long	0x7EBC2799
1110	addi	4,4,0x50
1111	b	.Lcbc_dec8x_done
1112
1113.align	5
1114.Lcbc_dec8x_four:
1115	.long	0x12522549
1116	.long	0x12735549
1117	.long	0x12945D49
1118	.long	0x12B56549
1119	vor	4,13,13
1120
1121	vperm	18,18,18,6
1122	vperm	19,19,19,6
1123	.long	0x7E402799
1124	vperm	20,20,20,6
1125	.long	0x7E682799
1126	vperm	21,21,21,6
1127	.long	0x7E9A2799
1128	.long	0x7EBB2799
1129	addi	4,4,0x40
1130	b	.Lcbc_dec8x_done
1131
1132.align	5
1133.Lcbc_dec8x_three:
1134	.long	0x12732549
1135	.long	0x12945D49
1136	.long	0x12B56549
1137	vor	4,13,13
1138
1139	vperm	19,19,19,6
1140	vperm	20,20,20,6
1141	.long	0x7E602799
1142	vperm	21,21,21,6
1143	.long	0x7E882799
1144	.long	0x7EBA2799
1145	addi	4,4,0x30
1146	b	.Lcbc_dec8x_done
1147
1148.align	5
1149.Lcbc_dec8x_two:
1150	.long	0x12942549
1151	.long	0x12B56549
1152	vor	4,13,13
1153
1154	vperm	20,20,20,6
1155	vperm	21,21,21,6
1156	.long	0x7E802799
1157	.long	0x7EA82799
1158	addi	4,4,0x20
1159	b	.Lcbc_dec8x_done
1160
1161.align	5
1162.Lcbc_dec8x_one:
1163	.long	0x12B52549
1164	vor	4,13,13
1165
1166	vperm	21,21,21,6
1167	.long	0x7EA02799
1168	addi	4,4,0x10
1169
1170.Lcbc_dec8x_done:
1171	vperm	4,4,4,6
1172	.long	0x7C803F99
1173
1174	li	10,79
1175	li	11,95
1176	stvx	6,10,1
1177	addi	10,10,32
1178	stvx	6,11,1
1179	addi	11,11,32
1180	stvx	6,10,1
1181	addi	10,10,32
1182	stvx	6,11,1
1183	addi	11,11,32
1184	stvx	6,10,1
1185	addi	10,10,32
1186	stvx	6,11,1
1187	addi	11,11,32
1188	stvx	6,10,1
1189	addi	10,10,32
1190	stvx	6,11,1
1191	addi	11,11,32
1192
1193	or	12,12,12
1194	lvx	20,10,1
1195	addi	10,10,32
1196	lvx	21,11,1
1197	addi	11,11,32
1198	lvx	22,10,1
1199	addi	10,10,32
1200	lvx	23,11,1
1201	addi	11,11,32
1202	lvx	24,10,1
1203	addi	10,10,32
1204	lvx	25,11,1
1205	addi	11,11,32
1206	lvx	26,10,1
1207	addi	10,10,32
1208	lvx	27,11,1
1209	addi	11,11,32
1210	lvx	28,10,1
1211	addi	10,10,32
1212	lvx	29,11,1
1213	addi	11,11,32
1214	lvx	30,10,1
1215	lvx	31,11,1
1216	ld	26,400(1)
1217	ld	27,408(1)
1218	ld	28,416(1)
1219	ld	29,424(1)
1220	ld	30,432(1)
1221	ld	31,440(1)
1222	addi	1,1,448
1223	blr
1224.long	0
1225.byte	0,12,0x04,0,0x80,6,6,0
1226.long	0
1227.size	aes_hw_cbc_encrypt,.-aes_hw_cbc_encrypt
1228.globl	aes_hw_ctr32_encrypt_blocks
1229.type	aes_hw_ctr32_encrypt_blocks,@function
1230.align	5
1231aes_hw_ctr32_encrypt_blocks:
1232.localentry	aes_hw_ctr32_encrypt_blocks,0
1233
1234	cmpldi	5,1
1235	.long	0x4dc00020
1236
1237	lis	0,0xfff0
1238	li	12,-1
1239	or	0,0,0
1240
1241	li	10,15
1242	vxor	0,0,0
1243	vspltisb	3,0x0f
1244
1245	lvx	4,0,7
1246	lvsl	6,0,7
1247	lvx	5,10,7
1248	vspltisb	11,1
1249	vxor	6,6,3
1250	vperm	4,4,5,6
1251	vsldoi	11,0,11,1
1252
1253	neg	11,3
1254	lvsr	10,0,6
1255	lwz	9,240(6)
1256
1257	lvsr	6,0,11
1258	lvx	5,0,3
1259	addi	3,3,15
1260	vxor	6,6,3
1261
1262	srwi	9,9,1
1263	li	10,16
1264	subi	9,9,1
1265
1266	cmpldi	5,8
1267	bge	_aesp8_ctr32_encrypt8x
1268
1269	lvsl	8,0,4
1270	vspltisb	9,-1
1271	lvx	7,0,4
1272	vperm	9,9,0,8
1273	vxor	8,8,3
1274
1275	lvx	0,0,6
1276	mtctr	9
1277	lvx	1,10,6
1278	addi	10,10,16
1279	vperm	0,1,0,10
1280	vxor	2,4,0
1281	lvx	0,10,6
1282	addi	10,10,16
1283	b	.Loop_ctr32_enc
1284
1285.align	5
1286.Loop_ctr32_enc:
1287	vperm	1,0,1,10
1288	.long	0x10420D08
1289	lvx	1,10,6
1290	addi	10,10,16
1291	vperm	0,1,0,10
1292	.long	0x10420508
1293	lvx	0,10,6
1294	addi	10,10,16
1295	bdnz	.Loop_ctr32_enc
1296
1297	vadduwm	4,4,11
1298	vor	3,5,5
1299	lvx	5,0,3
1300	addi	3,3,16
1301	subic.	5,5,1
1302
1303	vperm	1,0,1,10
1304	.long	0x10420D08
1305	lvx	1,10,6
1306	vperm	3,3,5,6
1307	li	10,16
1308	vperm	1,1,0,10
1309	lvx	0,0,6
1310	vxor	3,3,1
1311	.long	0x10421D09
1312
1313	lvx	1,10,6
1314	addi	10,10,16
1315	vperm	2,2,2,8
1316	vsel	3,7,2,9
1317	mtctr	9
1318	vperm	0,1,0,10
1319	vor	7,2,2
1320	vxor	2,4,0
1321	lvx	0,10,6
1322	addi	10,10,16
1323	stvx	3,0,4
1324	addi	4,4,16
1325	bne	.Loop_ctr32_enc
1326
1327	addi	4,4,-1
1328	lvx	2,0,4
1329	vsel	2,7,2,9
1330	stvx	2,0,4
1331
1332	or	12,12,12
1333	blr
1334.long	0
1335.byte	0,12,0x14,0,0,0,6,0
1336.long	0
1337.align	5
1338_aesp8_ctr32_encrypt8x:
1339	stdu	1,-448(1)
1340	li	10,207
1341	li	11,223
1342	stvx	20,10,1
1343	addi	10,10,32
1344	stvx	21,11,1
1345	addi	11,11,32
1346	stvx	22,10,1
1347	addi	10,10,32
1348	stvx	23,11,1
1349	addi	11,11,32
1350	stvx	24,10,1
1351	addi	10,10,32
1352	stvx	25,11,1
1353	addi	11,11,32
1354	stvx	26,10,1
1355	addi	10,10,32
1356	stvx	27,11,1
1357	addi	11,11,32
1358	stvx	28,10,1
1359	addi	10,10,32
1360	stvx	29,11,1
1361	addi	11,11,32
1362	stvx	30,10,1
1363	stvx	31,11,1
1364	li	0,-1
1365	stw	12,396(1)
1366	li	8,0x10
1367	std	26,400(1)
1368	li	26,0x20
1369	std	27,408(1)
1370	li	27,0x30
1371	std	28,416(1)
1372	li	28,0x40
1373	std	29,424(1)
1374	li	29,0x50
1375	std	30,432(1)
1376	li	30,0x60
1377	std	31,440(1)
1378	li	31,0x70
1379	or	0,0,0
1380
1381	subi	9,9,3
1382
1383	lvx	23,0,6
1384	lvx	30,8,6
1385	addi	6,6,0x20
1386	lvx	31,0,6
1387	vperm	23,30,23,10
1388	addi	11,1,79
1389	mtctr	9
1390
1391.Load_ctr32_enc_key:
1392	vperm	24,31,30,10
1393	lvx	30,8,6
1394	addi	6,6,0x20
1395	stvx	24,0,11
1396	vperm	25,30,31,10
1397	lvx	31,0,6
1398	stvx	25,8,11
1399	addi	11,11,0x20
1400	bdnz	.Load_ctr32_enc_key
1401
1402	lvx	26,8,6
1403	vperm	24,31,30,10
1404	lvx	27,26,6
1405	stvx	24,0,11
1406	vperm	25,26,31,10
1407	lvx	28,27,6
1408	stvx	25,8,11
1409	addi	11,1,79
1410	vperm	26,27,26,10
1411	lvx	29,28,6
1412	vperm	27,28,27,10
1413	lvx	30,29,6
1414	vperm	28,29,28,10
1415	lvx	31,30,6
1416	vperm	29,30,29,10
1417	lvx	15,31,6
1418	vperm	30,31,30,10
1419	lvx	24,0,11
1420	vperm	31,15,31,10
1421	lvx	25,8,11
1422
1423	vadduwm	7,11,11
1424	subi	3,3,15
1425	sldi	5,5,4
1426
1427	vadduwm	16,4,11
1428	vadduwm	17,4,7
1429	vxor	15,4,23
1430	li	10,8
1431	vadduwm	18,16,7
1432	vxor	16,16,23
1433	lvsl	6,0,10
1434	vadduwm	19,17,7
1435	vxor	17,17,23
1436	vspltisb	3,0x0f
1437	vadduwm	20,18,7
1438	vxor	18,18,23
1439	vxor	6,6,3
1440	vadduwm	21,19,7
1441	vxor	19,19,23
1442	vadduwm	22,20,7
1443	vxor	20,20,23
1444	vadduwm	4,21,7
1445	vxor	21,21,23
1446	vxor	22,22,23
1447
1448	mtctr	9
1449	b	.Loop_ctr32_enc8x
1450.align	5
1451.Loop_ctr32_enc8x:
1452	.long	0x11EFC508
1453	.long	0x1210C508
1454	.long	0x1231C508
1455	.long	0x1252C508
1456	.long	0x1273C508
1457	.long	0x1294C508
1458	.long	0x12B5C508
1459	.long	0x12D6C508
1460.Loop_ctr32_enc8x_middle:
1461	lvx	24,26,11
1462	addi	11,11,0x20
1463
1464	.long	0x11EFCD08
1465	.long	0x1210CD08
1466	.long	0x1231CD08
1467	.long	0x1252CD08
1468	.long	0x1273CD08
1469	.long	0x1294CD08
1470	.long	0x12B5CD08
1471	.long	0x12D6CD08
1472	lvx	25,8,11
1473	bdnz	.Loop_ctr32_enc8x
1474
1475	subic	11,5,256
1476	.long	0x11EFC508
1477	.long	0x1210C508
1478	.long	0x1231C508
1479	.long	0x1252C508
1480	.long	0x1273C508
1481	.long	0x1294C508
1482	.long	0x12B5C508
1483	.long	0x12D6C508
1484
1485	subfe	0,0,0
1486	.long	0x11EFCD08
1487	.long	0x1210CD08
1488	.long	0x1231CD08
1489	.long	0x1252CD08
1490	.long	0x1273CD08
1491	.long	0x1294CD08
1492	.long	0x12B5CD08
1493	.long	0x12D6CD08
1494
1495	and	0,0,11
1496	addi	11,1,79
1497	.long	0x11EFD508
1498	.long	0x1210D508
1499	.long	0x1231D508
1500	.long	0x1252D508
1501	.long	0x1273D508
1502	.long	0x1294D508
1503	.long	0x12B5D508
1504	.long	0x12D6D508
1505	lvx	24,0,11
1506
1507	subic	5,5,129
1508	.long	0x11EFDD08
1509	addi	5,5,1
1510	.long	0x1210DD08
1511	.long	0x1231DD08
1512	.long	0x1252DD08
1513	.long	0x1273DD08
1514	.long	0x1294DD08
1515	.long	0x12B5DD08
1516	.long	0x12D6DD08
1517	lvx	25,8,11
1518
1519	.long	0x11EFE508
1520	.long	0x7C001E99
1521	.long	0x1210E508
1522	.long	0x7C281E99
1523	.long	0x1231E508
1524	.long	0x7C5A1E99
1525	.long	0x1252E508
1526	.long	0x7C7B1E99
1527	.long	0x1273E508
1528	.long	0x7D5C1E99
1529	.long	0x1294E508
1530	.long	0x7D9D1E99
1531	.long	0x12B5E508
1532	.long	0x7DBE1E99
1533	.long	0x12D6E508
1534	.long	0x7DDF1E99
1535	addi	3,3,0x80
1536
1537	.long	0x11EFED08
1538	vperm	0,0,0,6
1539	.long	0x1210ED08
1540	vperm	1,1,1,6
1541	.long	0x1231ED08
1542	vperm	2,2,2,6
1543	.long	0x1252ED08
1544	vperm	3,3,3,6
1545	.long	0x1273ED08
1546	vperm	10,10,10,6
1547	.long	0x1294ED08
1548	vperm	12,12,12,6
1549	.long	0x12B5ED08
1550	vperm	13,13,13,6
1551	.long	0x12D6ED08
1552	vperm	14,14,14,6
1553
1554	add	3,3,0
1555
1556
1557
1558	subfe.	0,0,0
1559	.long	0x11EFF508
1560	vxor	0,0,31
1561	.long	0x1210F508
1562	vxor	1,1,31
1563	.long	0x1231F508
1564	vxor	2,2,31
1565	.long	0x1252F508
1566	vxor	3,3,31
1567	.long	0x1273F508
1568	vxor	10,10,31
1569	.long	0x1294F508
1570	vxor	12,12,31
1571	.long	0x12B5F508
1572	vxor	13,13,31
1573	.long	0x12D6F508
1574	vxor	14,14,31
1575
1576	bne	.Lctr32_enc8x_break
1577
1578	.long	0x100F0509
1579	.long	0x10300D09
1580	vadduwm	16,4,11
1581	.long	0x10511509
1582	vadduwm	17,4,7
1583	vxor	15,4,23
1584	.long	0x10721D09
1585	vadduwm	18,16,7
1586	vxor	16,16,23
1587	.long	0x11535509
1588	vadduwm	19,17,7
1589	vxor	17,17,23
1590	.long	0x11946509
1591	vadduwm	20,18,7
1592	vxor	18,18,23
1593	.long	0x11B56D09
1594	vadduwm	21,19,7
1595	vxor	19,19,23
1596	.long	0x11D67509
1597	vadduwm	22,20,7
1598	vxor	20,20,23
1599	vperm	0,0,0,6
1600	vadduwm	4,21,7
1601	vxor	21,21,23
1602	vperm	1,1,1,6
1603	vxor	22,22,23
1604	mtctr	9
1605
1606	.long	0x11EFC508
1607	.long	0x7C002799
1608	vperm	2,2,2,6
1609	.long	0x1210C508
1610	.long	0x7C282799
1611	vperm	3,3,3,6
1612	.long	0x1231C508
1613	.long	0x7C5A2799
1614	vperm	10,10,10,6
1615	.long	0x1252C508
1616	.long	0x7C7B2799
1617	vperm	12,12,12,6
1618	.long	0x1273C508
1619	.long	0x7D5C2799
1620	vperm	13,13,13,6
1621	.long	0x1294C508
1622	.long	0x7D9D2799
1623	vperm	14,14,14,6
1624	.long	0x12B5C508
1625	.long	0x7DBE2799
1626	.long	0x12D6C508
1627	.long	0x7DDF2799
1628	addi	4,4,0x80
1629
1630	b	.Loop_ctr32_enc8x_middle
1631
1632.align	5
1633.Lctr32_enc8x_break:
1634	cmpwi	5,-0x60
1635	blt	.Lctr32_enc8x_one
1636	nop
1637	beq	.Lctr32_enc8x_two
1638	cmpwi	5,-0x40
1639	blt	.Lctr32_enc8x_three
1640	nop
1641	beq	.Lctr32_enc8x_four
1642	cmpwi	5,-0x20
1643	blt	.Lctr32_enc8x_five
1644	nop
1645	beq	.Lctr32_enc8x_six
1646	cmpwi	5,0x00
1647	blt	.Lctr32_enc8x_seven
1648
1649.Lctr32_enc8x_eight:
1650	.long	0x11EF0509
1651	.long	0x12100D09
1652	.long	0x12311509
1653	.long	0x12521D09
1654	.long	0x12735509
1655	.long	0x12946509
1656	.long	0x12B56D09
1657	.long	0x12D67509
1658
1659	vperm	15,15,15,6
1660	vperm	16,16,16,6
1661	.long	0x7DE02799
1662	vperm	17,17,17,6
1663	.long	0x7E082799
1664	vperm	18,18,18,6
1665	.long	0x7E3A2799
1666	vperm	19,19,19,6
1667	.long	0x7E5B2799
1668	vperm	20,20,20,6
1669	.long	0x7E7C2799
1670	vperm	21,21,21,6
1671	.long	0x7E9D2799
1672	vperm	22,22,22,6
1673	.long	0x7EBE2799
1674	.long	0x7EDF2799
1675	addi	4,4,0x80
1676	b	.Lctr32_enc8x_done
1677
1678.align	5
1679.Lctr32_enc8x_seven:
1680	.long	0x11EF0D09
1681	.long	0x12101509
1682	.long	0x12311D09
1683	.long	0x12525509
1684	.long	0x12736509
1685	.long	0x12946D09
1686	.long	0x12B57509
1687
1688	vperm	15,15,15,6
1689	vperm	16,16,16,6
1690	.long	0x7DE02799
1691	vperm	17,17,17,6
1692	.long	0x7E082799
1693	vperm	18,18,18,6
1694	.long	0x7E3A2799
1695	vperm	19,19,19,6
1696	.long	0x7E5B2799
1697	vperm	20,20,20,6
1698	.long	0x7E7C2799
1699	vperm	21,21,21,6
1700	.long	0x7E9D2799
1701	.long	0x7EBE2799
1702	addi	4,4,0x70
1703	b	.Lctr32_enc8x_done
1704
1705.align	5
1706.Lctr32_enc8x_six:
1707	.long	0x11EF1509
1708	.long	0x12101D09
1709	.long	0x12315509
1710	.long	0x12526509
1711	.long	0x12736D09
1712	.long	0x12947509
1713
1714	vperm	15,15,15,6
1715	vperm	16,16,16,6
1716	.long	0x7DE02799
1717	vperm	17,17,17,6
1718	.long	0x7E082799
1719	vperm	18,18,18,6
1720	.long	0x7E3A2799
1721	vperm	19,19,19,6
1722	.long	0x7E5B2799
1723	vperm	20,20,20,6
1724	.long	0x7E7C2799
1725	.long	0x7E9D2799
1726	addi	4,4,0x60
1727	b	.Lctr32_enc8x_done
1728
1729.align	5
1730.Lctr32_enc8x_five:
1731	.long	0x11EF1D09
1732	.long	0x12105509
1733	.long	0x12316509
1734	.long	0x12526D09
1735	.long	0x12737509
1736
1737	vperm	15,15,15,6
1738	vperm	16,16,16,6
1739	.long	0x7DE02799
1740	vperm	17,17,17,6
1741	.long	0x7E082799
1742	vperm	18,18,18,6
1743	.long	0x7E3A2799
1744	vperm	19,19,19,6
1745	.long	0x7E5B2799
1746	.long	0x7E7C2799
1747	addi	4,4,0x50
1748	b	.Lctr32_enc8x_done
1749
1750.align	5
1751.Lctr32_enc8x_four:
1752	.long	0x11EF5509
1753	.long	0x12106509
1754	.long	0x12316D09
1755	.long	0x12527509
1756
1757	vperm	15,15,15,6
1758	vperm	16,16,16,6
1759	.long	0x7DE02799
1760	vperm	17,17,17,6
1761	.long	0x7E082799
1762	vperm	18,18,18,6
1763	.long	0x7E3A2799
1764	.long	0x7E5B2799
1765	addi	4,4,0x40
1766	b	.Lctr32_enc8x_done
1767
1768.align	5
1769.Lctr32_enc8x_three:
1770	.long	0x11EF6509
1771	.long	0x12106D09
1772	.long	0x12317509
1773
1774	vperm	15,15,15,6
1775	vperm	16,16,16,6
1776	.long	0x7DE02799
1777	vperm	17,17,17,6
1778	.long	0x7E082799
1779	.long	0x7E3A2799
1780	addi	4,4,0x30
1781	b	.Lctr32_enc8x_done
1782
1783.align	5
1784.Lctr32_enc8x_two:
1785	.long	0x11EF6D09
1786	.long	0x12107509
1787
1788	vperm	15,15,15,6
1789	vperm	16,16,16,6
1790	.long	0x7DE02799
1791	.long	0x7E082799
1792	addi	4,4,0x20
1793	b	.Lctr32_enc8x_done
1794
1795.align	5
1796.Lctr32_enc8x_one:
1797	.long	0x11EF7509
1798
1799	vperm	15,15,15,6
1800	.long	0x7DE02799
1801	addi	4,4,0x10
1802
1803.Lctr32_enc8x_done:
1804	li	10,79
1805	li	11,95
1806	stvx	6,10,1
1807	addi	10,10,32
1808	stvx	6,11,1
1809	addi	11,11,32
1810	stvx	6,10,1
1811	addi	10,10,32
1812	stvx	6,11,1
1813	addi	11,11,32
1814	stvx	6,10,1
1815	addi	10,10,32
1816	stvx	6,11,1
1817	addi	11,11,32
1818	stvx	6,10,1
1819	addi	10,10,32
1820	stvx	6,11,1
1821	addi	11,11,32
1822
1823	or	12,12,12
1824	lvx	20,10,1
1825	addi	10,10,32
1826	lvx	21,11,1
1827	addi	11,11,32
1828	lvx	22,10,1
1829	addi	10,10,32
1830	lvx	23,11,1
1831	addi	11,11,32
1832	lvx	24,10,1
1833	addi	10,10,32
1834	lvx	25,11,1
1835	addi	11,11,32
1836	lvx	26,10,1
1837	addi	10,10,32
1838	lvx	27,11,1
1839	addi	11,11,32
1840	lvx	28,10,1
1841	addi	10,10,32
1842	lvx	29,11,1
1843	addi	11,11,32
1844	lvx	30,10,1
1845	lvx	31,11,1
1846	ld	26,400(1)
1847	ld	27,408(1)
1848	ld	28,416(1)
1849	ld	29,424(1)
1850	ld	30,432(1)
1851	ld	31,440(1)
1852	addi	1,1,448
1853	blr
1854.long	0
1855.byte	0,12,0x04,0,0x80,6,6,0
1856.long	0
1857.size	aes_hw_ctr32_encrypt_blocks,.-aes_hw_ctr32_encrypt_blocks
1858.globl	aes_hw_xts_encrypt
1859.type	aes_hw_xts_encrypt,@function
1860.align	5
1861aes_hw_xts_encrypt:
1862.localentry	aes_hw_xts_encrypt,0
1863
1864	mr	10,3
1865	li	3,-1
1866	cmpldi	5,16
1867	.long	0x4dc00020
1868
1869	lis	0,0xfff0
1870	li	12,-1
1871	li	11,0
1872	or	0,0,0
1873
1874	vspltisb	9,0x07
1875	lvsl	6,11,11
1876	vspltisb	11,0x0f
1877	vxor	6,6,9
1878
1879	li	3,15
1880	lvx	8,0,8
1881	lvsl	5,0,8
1882	lvx	4,3,8
1883	vxor	5,5,11
1884	vperm	8,8,4,5
1885
1886	neg	11,10
1887	lvsr	5,0,11
1888	lvx	2,0,10
1889	addi	10,10,15
1890	vxor	5,5,11
1891
1892	cmpldi	7,0
1893	beq	.Lxts_enc_no_key2
1894
1895	lvsr	7,0,7
1896	lwz	9,240(7)
1897	srwi	9,9,1
1898	subi	9,9,1
1899	li	3,16
1900
1901	lvx	0,0,7
1902	lvx	1,3,7
1903	addi	3,3,16
1904	vperm	0,1,0,7
1905	vxor	8,8,0
1906	lvx	0,3,7
1907	addi	3,3,16
1908	mtctr	9
1909
1910.Ltweak_xts_enc:
1911	vperm	1,0,1,7
1912	.long	0x11080D08
1913	lvx	1,3,7
1914	addi	3,3,16
1915	vperm	0,1,0,7
1916	.long	0x11080508
1917	lvx	0,3,7
1918	addi	3,3,16
1919	bdnz	.Ltweak_xts_enc
1920
1921	vperm	1,0,1,7
1922	.long	0x11080D08
1923	lvx	1,3,7
1924	vperm	0,1,0,7
1925	.long	0x11080509
1926
1927	li	8,0
1928	b	.Lxts_enc
1929
1930.Lxts_enc_no_key2:
1931	li	3,-16
1932	and	5,5,3
1933
1934
1935.Lxts_enc:
1936	lvx	4,0,10
1937	addi	10,10,16
1938
1939	lvsr	7,0,6
1940	lwz	9,240(6)
1941	srwi	9,9,1
1942	subi	9,9,1
1943	li	3,16
1944
1945	vslb	10,9,9
1946	vor	10,10,9
1947	vspltisb	11,1
1948	vsldoi	10,10,11,15
1949
1950	cmpldi	5,96
1951	bge	_aesp8_xts_encrypt6x
1952
1953	andi.	7,5,15
1954	subic	0,5,32
1955	subi	7,7,16
1956	subfe	0,0,0
1957	and	0,0,7
1958	add	10,10,0
1959
1960	lvx	0,0,6
1961	lvx	1,3,6
1962	addi	3,3,16
1963	vperm	2,2,4,5
1964	vperm	0,1,0,7
1965	vxor	2,2,8
1966	vxor	2,2,0
1967	lvx	0,3,6
1968	addi	3,3,16
1969	mtctr	9
1970	b	.Loop_xts_enc
1971
1972.align	5
1973.Loop_xts_enc:
1974	vperm	1,0,1,7
1975	.long	0x10420D08
1976	lvx	1,3,6
1977	addi	3,3,16
1978	vperm	0,1,0,7
1979	.long	0x10420508
1980	lvx	0,3,6
1981	addi	3,3,16
1982	bdnz	.Loop_xts_enc
1983
1984	vperm	1,0,1,7
1985	.long	0x10420D08
1986	lvx	1,3,6
1987	li	3,16
1988	vperm	0,1,0,7
1989	vxor	0,0,8
1990	.long	0x10620509
1991
1992	vperm	11,3,3,6
1993
1994	.long	0x7D602799
1995
1996	addi	4,4,16
1997
1998	subic.	5,5,16
1999	beq	.Lxts_enc_done
2000
2001	vor	2,4,4
2002	lvx	4,0,10
2003	addi	10,10,16
2004	lvx	0,0,6
2005	lvx	1,3,6
2006	addi	3,3,16
2007
2008	subic	0,5,32
2009	subfe	0,0,0
2010	and	0,0,7
2011	add	10,10,0
2012
2013	vsrab	11,8,9
2014	vaddubm	8,8,8
2015	vsldoi	11,11,11,15
2016	vand	11,11,10
2017	vxor	8,8,11
2018
2019	vperm	2,2,4,5
2020	vperm	0,1,0,7
2021	vxor	2,2,8
2022	vxor	3,3,0
2023	vxor	2,2,0
2024	lvx	0,3,6
2025	addi	3,3,16
2026
2027	mtctr	9
2028	cmpldi	5,16
2029	bge	.Loop_xts_enc
2030
2031	vxor	3,3,8
2032	lvsr	5,0,5
2033	vxor	4,4,4
2034	vspltisb	11,-1
2035	vperm	4,4,11,5
2036	vsel	2,2,3,4
2037
2038	subi	11,4,17
2039	subi	4,4,16
2040	mtctr	5
2041	li	5,16
2042.Loop_xts_enc_steal:
2043	lbzu	0,1(11)
2044	stb	0,16(11)
2045	bdnz	.Loop_xts_enc_steal
2046
2047	mtctr	9
2048	b	.Loop_xts_enc
2049
2050.Lxts_enc_done:
2051	cmpldi	8,0
2052	beq	.Lxts_enc_ret
2053
2054	vsrab	11,8,9
2055	vaddubm	8,8,8
2056	vsldoi	11,11,11,15
2057	vand	11,11,10
2058	vxor	8,8,11
2059
2060	vperm	8,8,8,6
2061	.long	0x7D004799
2062
2063.Lxts_enc_ret:
2064	or	12,12,12
2065	li	3,0
2066	blr
2067.long	0
2068.byte	0,12,0x04,0,0x80,6,6,0
2069.long	0
2070.size	aes_hw_xts_encrypt,.-aes_hw_xts_encrypt
2071
2072.globl	aes_hw_xts_decrypt
2073.type	aes_hw_xts_decrypt,@function
2074.align	5
2075aes_hw_xts_decrypt:
2076.localentry	aes_hw_xts_decrypt,0
2077
2078	mr	10,3
2079	li	3,-1
2080	cmpldi	5,16
2081	.long	0x4dc00020
2082
2083	lis	0,0xfff8
2084	li	12,-1
2085	li	11,0
2086	or	0,0,0
2087
2088	andi.	0,5,15
2089	neg	0,0
2090	andi.	0,0,16
2091	sub	5,5,0
2092
2093	vspltisb	9,0x07
2094	lvsl	6,11,11
2095	vspltisb	11,0x0f
2096	vxor	6,6,9
2097
2098	li	3,15
2099	lvx	8,0,8
2100	lvsl	5,0,8
2101	lvx	4,3,8
2102	vxor	5,5,11
2103	vperm	8,8,4,5
2104
2105	neg	11,10
2106	lvsr	5,0,11
2107	lvx	2,0,10
2108	addi	10,10,15
2109	vxor	5,5,11
2110
2111	cmpldi	7,0
2112	beq	.Lxts_dec_no_key2
2113
2114	lvsr	7,0,7
2115	lwz	9,240(7)
2116	srwi	9,9,1
2117	subi	9,9,1
2118	li	3,16
2119
2120	lvx	0,0,7
2121	lvx	1,3,7
2122	addi	3,3,16
2123	vperm	0,1,0,7
2124	vxor	8,8,0
2125	lvx	0,3,7
2126	addi	3,3,16
2127	mtctr	9
2128
2129.Ltweak_xts_dec:
2130	vperm	1,0,1,7
2131	.long	0x11080D08
2132	lvx	1,3,7
2133	addi	3,3,16
2134	vperm	0,1,0,7
2135	.long	0x11080508
2136	lvx	0,3,7
2137	addi	3,3,16
2138	bdnz	.Ltweak_xts_dec
2139
2140	vperm	1,0,1,7
2141	.long	0x11080D08
2142	lvx	1,3,7
2143	vperm	0,1,0,7
2144	.long	0x11080509
2145
2146	li	8,0
2147	b	.Lxts_dec
2148
2149.Lxts_dec_no_key2:
2150	neg	3,5
2151	andi.	3,3,15
2152	add	5,5,3
2153
2154
2155.Lxts_dec:
2156	lvx	4,0,10
2157	addi	10,10,16
2158
2159	lvsr	7,0,6
2160	lwz	9,240(6)
2161	srwi	9,9,1
2162	subi	9,9,1
2163	li	3,16
2164
2165	vslb	10,9,9
2166	vor	10,10,9
2167	vspltisb	11,1
2168	vsldoi	10,10,11,15
2169
2170	cmpldi	5,96
2171	bge	_aesp8_xts_decrypt6x
2172
2173	lvx	0,0,6
2174	lvx	1,3,6
2175	addi	3,3,16
2176	vperm	2,2,4,5
2177	vperm	0,1,0,7
2178	vxor	2,2,8
2179	vxor	2,2,0
2180	lvx	0,3,6
2181	addi	3,3,16
2182	mtctr	9
2183
2184	cmpldi	5,16
2185	blt	.Ltail_xts_dec
2186
2187
2188.align	5
2189.Loop_xts_dec:
2190	vperm	1,0,1,7
2191	.long	0x10420D48
2192	lvx	1,3,6
2193	addi	3,3,16
2194	vperm	0,1,0,7
2195	.long	0x10420548
2196	lvx	0,3,6
2197	addi	3,3,16
2198	bdnz	.Loop_xts_dec
2199
2200	vperm	1,0,1,7
2201	.long	0x10420D48
2202	lvx	1,3,6
2203	li	3,16
2204	vperm	0,1,0,7
2205	vxor	0,0,8
2206	.long	0x10620549
2207
2208	vperm	11,3,3,6
2209
2210	.long	0x7D602799
2211
2212	addi	4,4,16
2213
2214	subic.	5,5,16
2215	beq	.Lxts_dec_done
2216
2217	vor	2,4,4
2218	lvx	4,0,10
2219	addi	10,10,16
2220	lvx	0,0,6
2221	lvx	1,3,6
2222	addi	3,3,16
2223
2224	vsrab	11,8,9
2225	vaddubm	8,8,8
2226	vsldoi	11,11,11,15
2227	vand	11,11,10
2228	vxor	8,8,11
2229
2230	vperm	2,2,4,5
2231	vperm	0,1,0,7
2232	vxor	2,2,8
2233	vxor	2,2,0
2234	lvx	0,3,6
2235	addi	3,3,16
2236
2237	mtctr	9
2238	cmpldi	5,16
2239	bge	.Loop_xts_dec
2240
2241.Ltail_xts_dec:
2242	vsrab	11,8,9
2243	vaddubm	12,8,8
2244	vsldoi	11,11,11,15
2245	vand	11,11,10
2246	vxor	12,12,11
2247
2248	subi	10,10,16
2249	add	10,10,5
2250
2251	vxor	2,2,8
2252	vxor	2,2,12
2253
2254.Loop_xts_dec_short:
2255	vperm	1,0,1,7
2256	.long	0x10420D48
2257	lvx	1,3,6
2258	addi	3,3,16
2259	vperm	0,1,0,7
2260	.long	0x10420548
2261	lvx	0,3,6
2262	addi	3,3,16
2263	bdnz	.Loop_xts_dec_short
2264
2265	vperm	1,0,1,7
2266	.long	0x10420D48
2267	lvx	1,3,6
2268	li	3,16
2269	vperm	0,1,0,7
2270	vxor	0,0,12
2271	.long	0x10620549
2272
2273	vperm	11,3,3,6
2274
2275	.long	0x7D602799
2276
2277
2278	vor	2,4,4
2279	lvx	4,0,10
2280
2281	lvx	0,0,6
2282	lvx	1,3,6
2283	addi	3,3,16
2284	vperm	2,2,4,5
2285	vperm	0,1,0,7
2286
2287	lvsr	5,0,5
2288	vxor	4,4,4
2289	vspltisb	11,-1
2290	vperm	4,4,11,5
2291	vsel	2,2,3,4
2292
2293	vxor	0,0,8
2294	vxor	2,2,0
2295	lvx	0,3,6
2296	addi	3,3,16
2297
2298	subi	11,4,1
2299	mtctr	5
2300	li	5,16
2301.Loop_xts_dec_steal:
2302	lbzu	0,1(11)
2303	stb	0,16(11)
2304	bdnz	.Loop_xts_dec_steal
2305
2306	mtctr	9
2307	b	.Loop_xts_dec
2308
2309.Lxts_dec_done:
2310	cmpldi	8,0
2311	beq	.Lxts_dec_ret
2312
2313	vsrab	11,8,9
2314	vaddubm	8,8,8
2315	vsldoi	11,11,11,15
2316	vand	11,11,10
2317	vxor	8,8,11
2318
2319	vperm	8,8,8,6
2320	.long	0x7D004799
2321
2322.Lxts_dec_ret:
2323	or	12,12,12
2324	li	3,0
2325	blr
2326.long	0
2327.byte	0,12,0x04,0,0x80,6,6,0
2328.long	0
2329.size	aes_hw_xts_decrypt,.-aes_hw_xts_decrypt
2330.align	5
2331_aesp8_xts_encrypt6x:
2332	stdu	1,-448(1)
2333	mflr	11
2334	li	7,207
2335	li	3,223
2336	std	11,464(1)
2337	stvx	20,7,1
2338	addi	7,7,32
2339	stvx	21,3,1
2340	addi	3,3,32
2341	stvx	22,7,1
2342	addi	7,7,32
2343	stvx	23,3,1
2344	addi	3,3,32
2345	stvx	24,7,1
2346	addi	7,7,32
2347	stvx	25,3,1
2348	addi	3,3,32
2349	stvx	26,7,1
2350	addi	7,7,32
2351	stvx	27,3,1
2352	addi	3,3,32
2353	stvx	28,7,1
2354	addi	7,7,32
2355	stvx	29,3,1
2356	addi	3,3,32
2357	stvx	30,7,1
2358	stvx	31,3,1
2359	li	0,-1
2360	stw	12,396(1)
2361	li	3,0x10
2362	std	26,400(1)
2363	li	26,0x20
2364	std	27,408(1)
2365	li	27,0x30
2366	std	28,416(1)
2367	li	28,0x40
2368	std	29,424(1)
2369	li	29,0x50
2370	std	30,432(1)
2371	li	30,0x60
2372	std	31,440(1)
2373	li	31,0x70
2374	or	0,0,0
2375
2376	subi	9,9,3
2377
2378	lvx	23,0,6
2379	lvx	30,3,6
2380	addi	6,6,0x20
2381	lvx	31,0,6
2382	vperm	23,30,23,7
2383	addi	7,1,79
2384	mtctr	9
2385
2386.Load_xts_enc_key:
2387	vperm	24,31,30,7
2388	lvx	30,3,6
2389	addi	6,6,0x20
2390	stvx	24,0,7
2391	vperm	25,30,31,7
2392	lvx	31,0,6
2393	stvx	25,3,7
2394	addi	7,7,0x20
2395	bdnz	.Load_xts_enc_key
2396
2397	lvx	26,3,6
2398	vperm	24,31,30,7
2399	lvx	27,26,6
2400	stvx	24,0,7
2401	vperm	25,26,31,7
2402	lvx	28,27,6
2403	stvx	25,3,7
2404	addi	7,1,79
2405	vperm	26,27,26,7
2406	lvx	29,28,6
2407	vperm	27,28,27,7
2408	lvx	30,29,6
2409	vperm	28,29,28,7
2410	lvx	31,30,6
2411	vperm	29,30,29,7
2412	lvx	22,31,6
2413	vperm	30,31,30,7
2414	lvx	24,0,7
2415	vperm	31,22,31,7
2416	lvx	25,3,7
2417
2418	vperm	0,2,4,5
2419	subi	10,10,31
2420	vxor	17,8,23
2421	vsrab	11,8,9
2422	vaddubm	8,8,8
2423	vsldoi	11,11,11,15
2424	vand	11,11,10
2425	vxor	7,0,17
2426	vxor	8,8,11
2427
2428	.long	0x7C235699
2429	vxor	18,8,23
2430	vsrab	11,8,9
2431	vaddubm	8,8,8
2432	vsldoi	11,11,11,15
2433	vperm	1,1,1,6
2434	vand	11,11,10
2435	vxor	12,1,18
2436	vxor	8,8,11
2437
2438	.long	0x7C5A5699
2439	andi.	31,5,15
2440	vxor	19,8,23
2441	vsrab	11,8,9
2442	vaddubm	8,8,8
2443	vsldoi	11,11,11,15
2444	vperm	2,2,2,6
2445	vand	11,11,10
2446	vxor	13,2,19
2447	vxor	8,8,11
2448
2449	.long	0x7C7B5699
2450	sub	5,5,31
2451	vxor	20,8,23
2452	vsrab	11,8,9
2453	vaddubm	8,8,8
2454	vsldoi	11,11,11,15
2455	vperm	3,3,3,6
2456	vand	11,11,10
2457	vxor	14,3,20
2458	vxor	8,8,11
2459
2460	.long	0x7C9C5699
2461	subi	5,5,0x60
2462	vxor	21,8,23
2463	vsrab	11,8,9
2464	vaddubm	8,8,8
2465	vsldoi	11,11,11,15
2466	vperm	4,4,4,6
2467	vand	11,11,10
2468	vxor	15,4,21
2469	vxor	8,8,11
2470
2471	.long	0x7CBD5699
2472	addi	10,10,0x60
2473	vxor	22,8,23
2474	vsrab	11,8,9
2475	vaddubm	8,8,8
2476	vsldoi	11,11,11,15
2477	vperm	5,5,5,6
2478	vand	11,11,10
2479	vxor	16,5,22
2480	vxor	8,8,11
2481
2482	vxor	31,31,23
2483	mtctr	9
2484	b	.Loop_xts_enc6x
2485
2486.align	5
2487.Loop_xts_enc6x:
2488	.long	0x10E7C508
2489	.long	0x118CC508
2490	.long	0x11ADC508
2491	.long	0x11CEC508
2492	.long	0x11EFC508
2493	.long	0x1210C508
2494	lvx	24,26,7
2495	addi	7,7,0x20
2496
2497	.long	0x10E7CD08
2498	.long	0x118CCD08
2499	.long	0x11ADCD08
2500	.long	0x11CECD08
2501	.long	0x11EFCD08
2502	.long	0x1210CD08
2503	lvx	25,3,7
2504	bdnz	.Loop_xts_enc6x
2505
2506	subic	5,5,96
2507	vxor	0,17,31
2508	.long	0x10E7C508
2509	.long	0x118CC508
2510	vsrab	11,8,9
2511	vxor	17,8,23
2512	vaddubm	8,8,8
2513	.long	0x11ADC508
2514	.long	0x11CEC508
2515	vsldoi	11,11,11,15
2516	.long	0x11EFC508
2517	.long	0x1210C508
2518
2519	subfe.	0,0,0
2520	vand	11,11,10
2521	.long	0x10E7CD08
2522	.long	0x118CCD08
2523	vxor	8,8,11
2524	.long	0x11ADCD08
2525	.long	0x11CECD08
2526	vxor	1,18,31
2527	vsrab	11,8,9
2528	vxor	18,8,23
2529	.long	0x11EFCD08
2530	.long	0x1210CD08
2531
2532	and	0,0,5
2533	vaddubm	8,8,8
2534	vsldoi	11,11,11,15
2535	.long	0x10E7D508
2536	.long	0x118CD508
2537	vand	11,11,10
2538	.long	0x11ADD508
2539	.long	0x11CED508
2540	vxor	8,8,11
2541	.long	0x11EFD508
2542	.long	0x1210D508
2543
2544	add	10,10,0
2545
2546
2547
2548	vxor	2,19,31
2549	vsrab	11,8,9
2550	vxor	19,8,23
2551	vaddubm	8,8,8
2552	.long	0x10E7DD08
2553	.long	0x118CDD08
2554	vsldoi	11,11,11,15
2555	.long	0x11ADDD08
2556	.long	0x11CEDD08
2557	vand	11,11,10
2558	.long	0x11EFDD08
2559	.long	0x1210DD08
2560
2561	addi	7,1,79
2562	vxor	8,8,11
2563	.long	0x10E7E508
2564	.long	0x118CE508
2565	vxor	3,20,31
2566	vsrab	11,8,9
2567	vxor	20,8,23
2568	.long	0x11ADE508
2569	.long	0x11CEE508
2570	vaddubm	8,8,8
2571	vsldoi	11,11,11,15
2572	.long	0x11EFE508
2573	.long	0x1210E508
2574	lvx	24,0,7
2575	vand	11,11,10
2576
2577	.long	0x10E7ED08
2578	.long	0x118CED08
2579	vxor	8,8,11
2580	.long	0x11ADED08
2581	.long	0x11CEED08
2582	vxor	4,21,31
2583	vsrab	11,8,9
2584	vxor	21,8,23
2585	.long	0x11EFED08
2586	.long	0x1210ED08
2587	lvx	25,3,7
2588	vaddubm	8,8,8
2589	vsldoi	11,11,11,15
2590
2591	.long	0x10E7F508
2592	.long	0x118CF508
2593	vand	11,11,10
2594	.long	0x11ADF508
2595	.long	0x11CEF508
2596	vxor	8,8,11
2597	.long	0x11EFF508
2598	.long	0x1210F508
2599	vxor	5,22,31
2600	vsrab	11,8,9
2601	vxor	22,8,23
2602
2603	.long	0x10E70509
2604	.long	0x7C005699
2605	vaddubm	8,8,8
2606	vsldoi	11,11,11,15
2607	.long	0x118C0D09
2608	.long	0x7C235699
2609	.long	0x11AD1509
2610	vperm	0,0,0,6
2611	.long	0x7C5A5699
2612	vand	11,11,10
2613	.long	0x11CE1D09
2614	vperm	1,1,1,6
2615	.long	0x7C7B5699
2616	.long	0x11EF2509
2617	vperm	2,2,2,6
2618	.long	0x7C9C5699
2619	vxor	8,8,11
2620	.long	0x11702D09
2621
2622	vperm	3,3,3,6
2623	.long	0x7CBD5699
2624	addi	10,10,0x60
2625	vperm	4,4,4,6
2626	vperm	5,5,5,6
2627
2628	vperm	7,7,7,6
2629	vperm	12,12,12,6
2630	.long	0x7CE02799
2631	vxor	7,0,17
2632	vperm	13,13,13,6
2633	.long	0x7D832799
2634	vxor	12,1,18
2635	vperm	14,14,14,6
2636	.long	0x7DBA2799
2637	vxor	13,2,19
2638	vperm	15,15,15,6
2639	.long	0x7DDB2799
2640	vxor	14,3,20
2641	vperm	16,11,11,6
2642	.long	0x7DFC2799
2643	vxor	15,4,21
2644	.long	0x7E1D2799
2645
2646	vxor	16,5,22
2647	addi	4,4,0x60
2648
2649	mtctr	9
2650	beq	.Loop_xts_enc6x
2651
2652	addic.	5,5,0x60
2653	beq	.Lxts_enc6x_zero
2654	cmpwi	5,0x20
2655	blt	.Lxts_enc6x_one
2656	nop
2657	beq	.Lxts_enc6x_two
2658	cmpwi	5,0x40
2659	blt	.Lxts_enc6x_three
2660	nop
2661	beq	.Lxts_enc6x_four
2662
2663.Lxts_enc6x_five:
2664	vxor	7,1,17
2665	vxor	12,2,18
2666	vxor	13,3,19
2667	vxor	14,4,20
2668	vxor	15,5,21
2669
2670	bl	_aesp8_xts_enc5x
2671
2672	vperm	7,7,7,6
2673	vor	17,22,22
2674	vperm	12,12,12,6
2675	.long	0x7CE02799
2676	vperm	13,13,13,6
2677	.long	0x7D832799
2678	vperm	14,14,14,6
2679	.long	0x7DBA2799
2680	vxor	11,15,22
2681	vperm	15,15,15,6
2682	.long	0x7DDB2799
2683	.long	0x7DFC2799
2684	addi	4,4,0x50
2685	bne	.Lxts_enc6x_steal
2686	b	.Lxts_enc6x_done
2687
2688.align	4
2689.Lxts_enc6x_four:
2690	vxor	7,2,17
2691	vxor	12,3,18
2692	vxor	13,4,19
2693	vxor	14,5,20
2694	vxor	15,15,15
2695
2696	bl	_aesp8_xts_enc5x
2697
2698	vperm	7,7,7,6
2699	vor	17,21,21
2700	vperm	12,12,12,6
2701	.long	0x7CE02799
2702	vperm	13,13,13,6
2703	.long	0x7D832799
2704	vxor	11,14,21
2705	vperm	14,14,14,6
2706	.long	0x7DBA2799
2707	.long	0x7DDB2799
2708	addi	4,4,0x40
2709	bne	.Lxts_enc6x_steal
2710	b	.Lxts_enc6x_done
2711
2712.align	4
2713.Lxts_enc6x_three:
2714	vxor	7,3,17
2715	vxor	12,4,18
2716	vxor	13,5,19
2717	vxor	14,14,14
2718	vxor	15,15,15
2719
2720	bl	_aesp8_xts_enc5x
2721
2722	vperm	7,7,7,6
2723	vor	17,20,20
2724	vperm	12,12,12,6
2725	.long	0x7CE02799
2726	vxor	11,13,20
2727	vperm	13,13,13,6
2728	.long	0x7D832799
2729	.long	0x7DBA2799
2730	addi	4,4,0x30
2731	bne	.Lxts_enc6x_steal
2732	b	.Lxts_enc6x_done
2733
2734.align	4
2735.Lxts_enc6x_two:
2736	vxor	7,4,17
2737	vxor	12,5,18
2738	vxor	13,13,13
2739	vxor	14,14,14
2740	vxor	15,15,15
2741
2742	bl	_aesp8_xts_enc5x
2743
2744	vperm	7,7,7,6
2745	vor	17,19,19
2746	vxor	11,12,19
2747	vperm	12,12,12,6
2748	.long	0x7CE02799
2749	.long	0x7D832799
2750	addi	4,4,0x20
2751	bne	.Lxts_enc6x_steal
2752	b	.Lxts_enc6x_done
2753
2754.align	4
2755.Lxts_enc6x_one:
2756	vxor	7,5,17
2757	nop
2758.Loop_xts_enc1x:
2759	.long	0x10E7C508
2760	lvx	24,26,7
2761	addi	7,7,0x20
2762
2763	.long	0x10E7CD08
2764	lvx	25,3,7
2765	bdnz	.Loop_xts_enc1x
2766
2767	add	10,10,31
2768	cmpwi	31,0
2769	.long	0x10E7C508
2770
2771	subi	10,10,16
2772	.long	0x10E7CD08
2773
2774	lvsr	5,0,31
2775	.long	0x10E7D508
2776
2777	.long	0x7C005699
2778	.long	0x10E7DD08
2779
2780	addi	7,1,79
2781	.long	0x10E7E508
2782	lvx	24,0,7
2783
2784	.long	0x10E7ED08
2785	lvx	25,3,7
2786	vxor	17,17,31
2787
2788	vperm	0,0,0,6
2789	.long	0x10E7F508
2790
2791	vperm	0,0,0,5
2792	.long	0x10E78D09
2793
2794	vor	17,18,18
2795	vxor	11,7,18
2796	vperm	7,7,7,6
2797	.long	0x7CE02799
2798	addi	4,4,0x10
2799	bne	.Lxts_enc6x_steal
2800	b	.Lxts_enc6x_done
2801
2802.align	4
2803.Lxts_enc6x_zero:
2804	cmpwi	31,0
2805	beq	.Lxts_enc6x_done
2806
2807	add	10,10,31
2808	subi	10,10,16
2809	.long	0x7C005699
2810	lvsr	5,0,31
2811	vperm	0,0,0,6
2812	vperm	0,0,0,5
2813	vxor	11,11,17
2814.Lxts_enc6x_steal:
2815	vxor	0,0,17
2816	vxor	7,7,7
2817	vspltisb	12,-1
2818	vperm	7,7,12,5
2819	vsel	7,0,11,7
2820
2821	subi	30,4,17
2822	subi	4,4,16
2823	mtctr	31
2824.Loop_xts_enc6x_steal:
2825	lbzu	0,1(30)
2826	stb	0,16(30)
2827	bdnz	.Loop_xts_enc6x_steal
2828
2829	li	31,0
2830	mtctr	9
2831	b	.Loop_xts_enc1x
2832
2833.align	4
2834.Lxts_enc6x_done:
2835	cmpldi	8,0
2836	beq	.Lxts_enc6x_ret
2837
2838	vxor	8,17,23
2839	vperm	8,8,8,6
2840	.long	0x7D004799
2841
2842.Lxts_enc6x_ret:
2843	mtlr	11
2844	li	10,79
2845	li	11,95
2846	stvx	9,10,1
2847	addi	10,10,32
2848	stvx	9,11,1
2849	addi	11,11,32
2850	stvx	9,10,1
2851	addi	10,10,32
2852	stvx	9,11,1
2853	addi	11,11,32
2854	stvx	9,10,1
2855	addi	10,10,32
2856	stvx	9,11,1
2857	addi	11,11,32
2858	stvx	9,10,1
2859	addi	10,10,32
2860	stvx	9,11,1
2861	addi	11,11,32
2862
2863	or	12,12,12
2864	lvx	20,10,1
2865	addi	10,10,32
2866	lvx	21,11,1
2867	addi	11,11,32
2868	lvx	22,10,1
2869	addi	10,10,32
2870	lvx	23,11,1
2871	addi	11,11,32
2872	lvx	24,10,1
2873	addi	10,10,32
2874	lvx	25,11,1
2875	addi	11,11,32
2876	lvx	26,10,1
2877	addi	10,10,32
2878	lvx	27,11,1
2879	addi	11,11,32
2880	lvx	28,10,1
2881	addi	10,10,32
2882	lvx	29,11,1
2883	addi	11,11,32
2884	lvx	30,10,1
2885	lvx	31,11,1
2886	ld	26,400(1)
2887	ld	27,408(1)
2888	ld	28,416(1)
2889	ld	29,424(1)
2890	ld	30,432(1)
2891	ld	31,440(1)
2892	addi	1,1,448
2893	blr
2894.long	0
2895.byte	0,12,0x04,1,0x80,6,6,0
2896.long	0
2897
2898.align	5
2899_aesp8_xts_enc5x:
2900	.long	0x10E7C508
2901	.long	0x118CC508
2902	.long	0x11ADC508
2903	.long	0x11CEC508
2904	.long	0x11EFC508
2905	lvx	24,26,7
2906	addi	7,7,0x20
2907
2908	.long	0x10E7CD08
2909	.long	0x118CCD08
2910	.long	0x11ADCD08
2911	.long	0x11CECD08
2912	.long	0x11EFCD08
2913	lvx	25,3,7
2914	bdnz	_aesp8_xts_enc5x
2915
2916	add	10,10,31
2917	cmpwi	31,0
2918	.long	0x10E7C508
2919	.long	0x118CC508
2920	.long	0x11ADC508
2921	.long	0x11CEC508
2922	.long	0x11EFC508
2923
2924	subi	10,10,16
2925	.long	0x10E7CD08
2926	.long	0x118CCD08
2927	.long	0x11ADCD08
2928	.long	0x11CECD08
2929	.long	0x11EFCD08
2930	vxor	17,17,31
2931
2932	.long	0x10E7D508
2933	lvsr	5,0,31
2934	.long	0x118CD508
2935	.long	0x11ADD508
2936	.long	0x11CED508
2937	.long	0x11EFD508
2938	vxor	1,18,31
2939
2940	.long	0x10E7DD08
2941	.long	0x7C005699
2942	.long	0x118CDD08
2943	.long	0x11ADDD08
2944	.long	0x11CEDD08
2945	.long	0x11EFDD08
2946	vxor	2,19,31
2947
2948	addi	7,1,79
2949	.long	0x10E7E508
2950	.long	0x118CE508
2951	.long	0x11ADE508
2952	.long	0x11CEE508
2953	.long	0x11EFE508
2954	lvx	24,0,7
2955	vxor	3,20,31
2956
2957	.long	0x10E7ED08
2958	vperm	0,0,0,6
2959	.long	0x118CED08
2960	.long	0x11ADED08
2961	.long	0x11CEED08
2962	.long	0x11EFED08
2963	lvx	25,3,7
2964	vxor	4,21,31
2965
2966	.long	0x10E7F508
2967	vperm	0,0,0,5
2968	.long	0x118CF508
2969	.long	0x11ADF508
2970	.long	0x11CEF508
2971	.long	0x11EFF508
2972
2973	.long	0x10E78D09
2974	.long	0x118C0D09
2975	.long	0x11AD1509
2976	.long	0x11CE1D09
2977	.long	0x11EF2509
2978	blr
2979.long	0
2980.byte	0,12,0x14,0,0,0,0,0
2981
2982.align	5
2983_aesp8_xts_decrypt6x:
2984	stdu	1,-448(1)
2985	mflr	11
2986	li	7,207
2987	li	3,223
2988	std	11,464(1)
2989	stvx	20,7,1
2990	addi	7,7,32
2991	stvx	21,3,1
2992	addi	3,3,32
2993	stvx	22,7,1
2994	addi	7,7,32
2995	stvx	23,3,1
2996	addi	3,3,32
2997	stvx	24,7,1
2998	addi	7,7,32
2999	stvx	25,3,1
3000	addi	3,3,32
3001	stvx	26,7,1
3002	addi	7,7,32
3003	stvx	27,3,1
3004	addi	3,3,32
3005	stvx	28,7,1
3006	addi	7,7,32
3007	stvx	29,3,1
3008	addi	3,3,32
3009	stvx	30,7,1
3010	stvx	31,3,1
3011	li	0,-1
3012	stw	12,396(1)
3013	li	3,0x10
3014	std	26,400(1)
3015	li	26,0x20
3016	std	27,408(1)
3017	li	27,0x30
3018	std	28,416(1)
3019	li	28,0x40
3020	std	29,424(1)
3021	li	29,0x50
3022	std	30,432(1)
3023	li	30,0x60
3024	std	31,440(1)
3025	li	31,0x70
3026	or	0,0,0
3027
3028	subi	9,9,3
3029
3030	lvx	23,0,6
3031	lvx	30,3,6
3032	addi	6,6,0x20
3033	lvx	31,0,6
3034	vperm	23,30,23,7
3035	addi	7,1,79
3036	mtctr	9
3037
3038.Load_xts_dec_key:
3039	vperm	24,31,30,7
3040	lvx	30,3,6
3041	addi	6,6,0x20
3042	stvx	24,0,7
3043	vperm	25,30,31,7
3044	lvx	31,0,6
3045	stvx	25,3,7
3046	addi	7,7,0x20
3047	bdnz	.Load_xts_dec_key
3048
3049	lvx	26,3,6
3050	vperm	24,31,30,7
3051	lvx	27,26,6
3052	stvx	24,0,7
3053	vperm	25,26,31,7
3054	lvx	28,27,6
3055	stvx	25,3,7
3056	addi	7,1,79
3057	vperm	26,27,26,7
3058	lvx	29,28,6
3059	vperm	27,28,27,7
3060	lvx	30,29,6
3061	vperm	28,29,28,7
3062	lvx	31,30,6
3063	vperm	29,30,29,7
3064	lvx	22,31,6
3065	vperm	30,31,30,7
3066	lvx	24,0,7
3067	vperm	31,22,31,7
3068	lvx	25,3,7
3069
3070	vperm	0,2,4,5
3071	subi	10,10,31
3072	vxor	17,8,23
3073	vsrab	11,8,9
3074	vaddubm	8,8,8
3075	vsldoi	11,11,11,15
3076	vand	11,11,10
3077	vxor	7,0,17
3078	vxor	8,8,11
3079
3080	.long	0x7C235699
3081	vxor	18,8,23
3082	vsrab	11,8,9
3083	vaddubm	8,8,8
3084	vsldoi	11,11,11,15
3085	vperm	1,1,1,6
3086	vand	11,11,10
3087	vxor	12,1,18
3088	vxor	8,8,11
3089
3090	.long	0x7C5A5699
3091	andi.	31,5,15
3092	vxor	19,8,23
3093	vsrab	11,8,9
3094	vaddubm	8,8,8
3095	vsldoi	11,11,11,15
3096	vperm	2,2,2,6
3097	vand	11,11,10
3098	vxor	13,2,19
3099	vxor	8,8,11
3100
3101	.long	0x7C7B5699
3102	sub	5,5,31
3103	vxor	20,8,23
3104	vsrab	11,8,9
3105	vaddubm	8,8,8
3106	vsldoi	11,11,11,15
3107	vperm	3,3,3,6
3108	vand	11,11,10
3109	vxor	14,3,20
3110	vxor	8,8,11
3111
3112	.long	0x7C9C5699
3113	subi	5,5,0x60
3114	vxor	21,8,23
3115	vsrab	11,8,9
3116	vaddubm	8,8,8
3117	vsldoi	11,11,11,15
3118	vperm	4,4,4,6
3119	vand	11,11,10
3120	vxor	15,4,21
3121	vxor	8,8,11
3122
3123	.long	0x7CBD5699
3124	addi	10,10,0x60
3125	vxor	22,8,23
3126	vsrab	11,8,9
3127	vaddubm	8,8,8
3128	vsldoi	11,11,11,15
3129	vperm	5,5,5,6
3130	vand	11,11,10
3131	vxor	16,5,22
3132	vxor	8,8,11
3133
3134	vxor	31,31,23
3135	mtctr	9
3136	b	.Loop_xts_dec6x
3137
3138.align	5
3139.Loop_xts_dec6x:
3140	.long	0x10E7C548
3141	.long	0x118CC548
3142	.long	0x11ADC548
3143	.long	0x11CEC548
3144	.long	0x11EFC548
3145	.long	0x1210C548
3146	lvx	24,26,7
3147	addi	7,7,0x20
3148
3149	.long	0x10E7CD48
3150	.long	0x118CCD48
3151	.long	0x11ADCD48
3152	.long	0x11CECD48
3153	.long	0x11EFCD48
3154	.long	0x1210CD48
3155	lvx	25,3,7
3156	bdnz	.Loop_xts_dec6x
3157
3158	subic	5,5,96
3159	vxor	0,17,31
3160	.long	0x10E7C548
3161	.long	0x118CC548
3162	vsrab	11,8,9
3163	vxor	17,8,23
3164	vaddubm	8,8,8
3165	.long	0x11ADC548
3166	.long	0x11CEC548
3167	vsldoi	11,11,11,15
3168	.long	0x11EFC548
3169	.long	0x1210C548
3170
3171	subfe.	0,0,0
3172	vand	11,11,10
3173	.long	0x10E7CD48
3174	.long	0x118CCD48
3175	vxor	8,8,11
3176	.long	0x11ADCD48
3177	.long	0x11CECD48
3178	vxor	1,18,31
3179	vsrab	11,8,9
3180	vxor	18,8,23
3181	.long	0x11EFCD48
3182	.long	0x1210CD48
3183
3184	and	0,0,5
3185	vaddubm	8,8,8
3186	vsldoi	11,11,11,15
3187	.long	0x10E7D548
3188	.long	0x118CD548
3189	vand	11,11,10
3190	.long	0x11ADD548
3191	.long	0x11CED548
3192	vxor	8,8,11
3193	.long	0x11EFD548
3194	.long	0x1210D548
3195
3196	add	10,10,0
3197
3198
3199
3200	vxor	2,19,31
3201	vsrab	11,8,9
3202	vxor	19,8,23
3203	vaddubm	8,8,8
3204	.long	0x10E7DD48
3205	.long	0x118CDD48
3206	vsldoi	11,11,11,15
3207	.long	0x11ADDD48
3208	.long	0x11CEDD48
3209	vand	11,11,10
3210	.long	0x11EFDD48
3211	.long	0x1210DD48
3212
3213	addi	7,1,79
3214	vxor	8,8,11
3215	.long	0x10E7E548
3216	.long	0x118CE548
3217	vxor	3,20,31
3218	vsrab	11,8,9
3219	vxor	20,8,23
3220	.long	0x11ADE548
3221	.long	0x11CEE548
3222	vaddubm	8,8,8
3223	vsldoi	11,11,11,15
3224	.long	0x11EFE548
3225	.long	0x1210E548
3226	lvx	24,0,7
3227	vand	11,11,10
3228
3229	.long	0x10E7ED48
3230	.long	0x118CED48
3231	vxor	8,8,11
3232	.long	0x11ADED48
3233	.long	0x11CEED48
3234	vxor	4,21,31
3235	vsrab	11,8,9
3236	vxor	21,8,23
3237	.long	0x11EFED48
3238	.long	0x1210ED48
3239	lvx	25,3,7
3240	vaddubm	8,8,8
3241	vsldoi	11,11,11,15
3242
3243	.long	0x10E7F548
3244	.long	0x118CF548
3245	vand	11,11,10
3246	.long	0x11ADF548
3247	.long	0x11CEF548
3248	vxor	8,8,11
3249	.long	0x11EFF548
3250	.long	0x1210F548
3251	vxor	5,22,31
3252	vsrab	11,8,9
3253	vxor	22,8,23
3254
3255	.long	0x10E70549
3256	.long	0x7C005699
3257	vaddubm	8,8,8
3258	vsldoi	11,11,11,15
3259	.long	0x118C0D49
3260	.long	0x7C235699
3261	.long	0x11AD1549
3262	vperm	0,0,0,6
3263	.long	0x7C5A5699
3264	vand	11,11,10
3265	.long	0x11CE1D49
3266	vperm	1,1,1,6
3267	.long	0x7C7B5699
3268	.long	0x11EF2549
3269	vperm	2,2,2,6
3270	.long	0x7C9C5699
3271	vxor	8,8,11
3272	.long	0x12102D49
3273	vperm	3,3,3,6
3274	.long	0x7CBD5699
3275	addi	10,10,0x60
3276	vperm	4,4,4,6
3277	vperm	5,5,5,6
3278
3279	vperm	7,7,7,6
3280	vperm	12,12,12,6
3281	.long	0x7CE02799
3282	vxor	7,0,17
3283	vperm	13,13,13,6
3284	.long	0x7D832799
3285	vxor	12,1,18
3286	vperm	14,14,14,6
3287	.long	0x7DBA2799
3288	vxor	13,2,19
3289	vperm	15,15,15,6
3290	.long	0x7DDB2799
3291	vxor	14,3,20
3292	vperm	16,16,16,6
3293	.long	0x7DFC2799
3294	vxor	15,4,21
3295	.long	0x7E1D2799
3296	vxor	16,5,22
3297	addi	4,4,0x60
3298
3299	mtctr	9
3300	beq	.Loop_xts_dec6x
3301
3302	addic.	5,5,0x60
3303	beq	.Lxts_dec6x_zero
3304	cmpwi	5,0x20
3305	blt	.Lxts_dec6x_one
3306	nop
3307	beq	.Lxts_dec6x_two
3308	cmpwi	5,0x40
3309	blt	.Lxts_dec6x_three
3310	nop
3311	beq	.Lxts_dec6x_four
3312
3313.Lxts_dec6x_five:
3314	vxor	7,1,17
3315	vxor	12,2,18
3316	vxor	13,3,19
3317	vxor	14,4,20
3318	vxor	15,5,21
3319
3320	bl	_aesp8_xts_dec5x
3321
3322	vperm	7,7,7,6
3323	vor	17,22,22
3324	vxor	18,8,23
3325	vperm	12,12,12,6
3326	.long	0x7CE02799
3327	vxor	7,0,18
3328	vperm	13,13,13,6
3329	.long	0x7D832799
3330	vperm	14,14,14,6
3331	.long	0x7DBA2799
3332	vperm	15,15,15,6
3333	.long	0x7DDB2799
3334	.long	0x7DFC2799
3335	addi	4,4,0x50
3336	bne	.Lxts_dec6x_steal
3337	b	.Lxts_dec6x_done
3338
3339.align	4
3340.Lxts_dec6x_four:
3341	vxor	7,2,17
3342	vxor	12,3,18
3343	vxor	13,4,19
3344	vxor	14,5,20
3345	vxor	15,15,15
3346
3347	bl	_aesp8_xts_dec5x
3348
3349	vperm	7,7,7,6
3350	vor	17,21,21
3351	vor	18,22,22
3352	vperm	12,12,12,6
3353	.long	0x7CE02799
3354	vxor	7,0,22
3355	vperm	13,13,13,6
3356	.long	0x7D832799
3357	vperm	14,14,14,6
3358	.long	0x7DBA2799
3359	.long	0x7DDB2799
3360	addi	4,4,0x40
3361	bne	.Lxts_dec6x_steal
3362	b	.Lxts_dec6x_done
3363
3364.align	4
3365.Lxts_dec6x_three:
3366	vxor	7,3,17
3367	vxor	12,4,18
3368	vxor	13,5,19
3369	vxor	14,14,14
3370	vxor	15,15,15
3371
3372	bl	_aesp8_xts_dec5x
3373
3374	vperm	7,7,7,6
3375	vor	17,20,20
3376	vor	18,21,21
3377	vperm	12,12,12,6
3378	.long	0x7CE02799
3379	vxor	7,0,21
3380	vperm	13,13,13,6
3381	.long	0x7D832799
3382	.long	0x7DBA2799
3383	addi	4,4,0x30
3384	bne	.Lxts_dec6x_steal
3385	b	.Lxts_dec6x_done
3386
3387.align	4
3388.Lxts_dec6x_two:
3389	vxor	7,4,17
3390	vxor	12,5,18
3391	vxor	13,13,13
3392	vxor	14,14,14
3393	vxor	15,15,15
3394
3395	bl	_aesp8_xts_dec5x
3396
3397	vperm	7,7,7,6
3398	vor	17,19,19
3399	vor	18,20,20
3400	vperm	12,12,12,6
3401	.long	0x7CE02799
3402	vxor	7,0,20
3403	.long	0x7D832799
3404	addi	4,4,0x20
3405	bne	.Lxts_dec6x_steal
3406	b	.Lxts_dec6x_done
3407
3408.align	4
3409.Lxts_dec6x_one:
3410	vxor	7,5,17
3411	nop
3412.Loop_xts_dec1x:
3413	.long	0x10E7C548
3414	lvx	24,26,7
3415	addi	7,7,0x20
3416
3417	.long	0x10E7CD48
3418	lvx	25,3,7
3419	bdnz	.Loop_xts_dec1x
3420
3421	subi	0,31,1
3422	.long	0x10E7C548
3423
3424	andi.	0,0,16
3425	cmpwi	31,0
3426	.long	0x10E7CD48
3427
3428	sub	10,10,0
3429	.long	0x10E7D548
3430
3431	.long	0x7C005699
3432	.long	0x10E7DD48
3433
3434	addi	7,1,79
3435	.long	0x10E7E548
3436	lvx	24,0,7
3437
3438	.long	0x10E7ED48
3439	lvx	25,3,7
3440	vxor	17,17,31
3441
3442	vperm	0,0,0,6
3443	.long	0x10E7F548
3444
3445	mtctr	9
3446	.long	0x10E78D49
3447
3448	vor	17,18,18
3449	vor	18,19,19
3450	vperm	7,7,7,6
3451	.long	0x7CE02799
3452	addi	4,4,0x10
3453	vxor	7,0,19
3454	bne	.Lxts_dec6x_steal
3455	b	.Lxts_dec6x_done
3456
3457.align	4
3458.Lxts_dec6x_zero:
3459	cmpwi	31,0
3460	beq	.Lxts_dec6x_done
3461
3462	.long	0x7C005699
3463	vperm	0,0,0,6
3464	vxor	7,0,18
3465.Lxts_dec6x_steal:
3466	.long	0x10E7C548
3467	lvx	24,26,7
3468	addi	7,7,0x20
3469
3470	.long	0x10E7CD48
3471	lvx	25,3,7
3472	bdnz	.Lxts_dec6x_steal
3473
3474	add	10,10,31
3475	.long	0x10E7C548
3476
3477	cmpwi	31,0
3478	.long	0x10E7CD48
3479
3480	.long	0x7C005699
3481	.long	0x10E7D548
3482
3483	lvsr	5,0,31
3484	.long	0x10E7DD48
3485
3486	addi	7,1,79
3487	.long	0x10E7E548
3488	lvx	24,0,7
3489
3490	.long	0x10E7ED48
3491	lvx	25,3,7
3492	vxor	18,18,31
3493
3494	vperm	0,0,0,6
3495	.long	0x10E7F548
3496
3497	vperm	0,0,0,5
3498	.long	0x11679549
3499
3500	vperm	7,11,11,6
3501	.long	0x7CE02799
3502
3503
3504	vxor	7,7,7
3505	vspltisb	12,-1
3506	vperm	7,7,12,5
3507	vsel	7,0,11,7
3508	vxor	7,7,17
3509
3510	subi	30,4,1
3511	mtctr	31
3512.Loop_xts_dec6x_steal:
3513	lbzu	0,1(30)
3514	stb	0,16(30)
3515	bdnz	.Loop_xts_dec6x_steal
3516
3517	li	31,0
3518	mtctr	9
3519	b	.Loop_xts_dec1x
3520
3521.align	4
3522.Lxts_dec6x_done:
3523	cmpldi	8,0
3524	beq	.Lxts_dec6x_ret
3525
3526	vxor	8,17,23
3527	vperm	8,8,8,6
3528	.long	0x7D004799
3529
3530.Lxts_dec6x_ret:
3531	mtlr	11
3532	li	10,79
3533	li	11,95
3534	stvx	9,10,1
3535	addi	10,10,32
3536	stvx	9,11,1
3537	addi	11,11,32
3538	stvx	9,10,1
3539	addi	10,10,32
3540	stvx	9,11,1
3541	addi	11,11,32
3542	stvx	9,10,1
3543	addi	10,10,32
3544	stvx	9,11,1
3545	addi	11,11,32
3546	stvx	9,10,1
3547	addi	10,10,32
3548	stvx	9,11,1
3549	addi	11,11,32
3550
3551	or	12,12,12
3552	lvx	20,10,1
3553	addi	10,10,32
3554	lvx	21,11,1
3555	addi	11,11,32
3556	lvx	22,10,1
3557	addi	10,10,32
3558	lvx	23,11,1
3559	addi	11,11,32
3560	lvx	24,10,1
3561	addi	10,10,32
3562	lvx	25,11,1
3563	addi	11,11,32
3564	lvx	26,10,1
3565	addi	10,10,32
3566	lvx	27,11,1
3567	addi	11,11,32
3568	lvx	28,10,1
3569	addi	10,10,32
3570	lvx	29,11,1
3571	addi	11,11,32
3572	lvx	30,10,1
3573	lvx	31,11,1
3574	ld	26,400(1)
3575	ld	27,408(1)
3576	ld	28,416(1)
3577	ld	29,424(1)
3578	ld	30,432(1)
3579	ld	31,440(1)
3580	addi	1,1,448
3581	blr
3582.long	0
3583.byte	0,12,0x04,1,0x80,6,6,0
3584.long	0
3585
3586.align	5
3587_aesp8_xts_dec5x:
3588	.long	0x10E7C548
3589	.long	0x118CC548
3590	.long	0x11ADC548
3591	.long	0x11CEC548
3592	.long	0x11EFC548
3593	lvx	24,26,7
3594	addi	7,7,0x20
3595
3596	.long	0x10E7CD48
3597	.long	0x118CCD48
3598	.long	0x11ADCD48
3599	.long	0x11CECD48
3600	.long	0x11EFCD48
3601	lvx	25,3,7
3602	bdnz	_aesp8_xts_dec5x
3603
3604	subi	0,31,1
3605	.long	0x10E7C548
3606	.long	0x118CC548
3607	.long	0x11ADC548
3608	.long	0x11CEC548
3609	.long	0x11EFC548
3610
3611	andi.	0,0,16
3612	cmpwi	31,0
3613	.long	0x10E7CD48
3614	.long	0x118CCD48
3615	.long	0x11ADCD48
3616	.long	0x11CECD48
3617	.long	0x11EFCD48
3618	vxor	17,17,31
3619
3620	sub	10,10,0
3621	.long	0x10E7D548
3622	.long	0x118CD548
3623	.long	0x11ADD548
3624	.long	0x11CED548
3625	.long	0x11EFD548
3626	vxor	1,18,31
3627
3628	.long	0x10E7DD48
3629	.long	0x7C005699
3630	.long	0x118CDD48
3631	.long	0x11ADDD48
3632	.long	0x11CEDD48
3633	.long	0x11EFDD48
3634	vxor	2,19,31
3635
3636	addi	7,1,79
3637	.long	0x10E7E548
3638	.long	0x118CE548
3639	.long	0x11ADE548
3640	.long	0x11CEE548
3641	.long	0x11EFE548
3642	lvx	24,0,7
3643	vxor	3,20,31
3644
3645	.long	0x10E7ED48
3646	vperm	0,0,0,6
3647	.long	0x118CED48
3648	.long	0x11ADED48
3649	.long	0x11CEED48
3650	.long	0x11EFED48
3651	lvx	25,3,7
3652	vxor	4,21,31
3653
3654	.long	0x10E7F548
3655	.long	0x118CF548
3656	.long	0x11ADF548
3657	.long	0x11CEF548
3658	.long	0x11EFF548
3659
3660	.long	0x10E78D49
3661	.long	0x118C0D49
3662	.long	0x11AD1549
3663	.long	0x11CE1D49
3664	.long	0x11EF2549
3665	mtctr	9
3666	blr
3667.long	0
3668.byte	0,12,0x14,0,0,0,0,0
3669#endif  // !OPENSSL_NO_ASM && __powerpc64__
3670.section	.note.GNU-stack,"",@progbits
3671