summaryrefslogtreecommitdiff
path: root/deps/openssl/config/archs/aix-gcc/asm/crypto/chacha/chacha-ppc.s
blob: e4e4612d3aab3073c996f70c944bcec872d978cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
.machine	"any"
.csect	.text[PR],7

.globl	.ChaCha20_ctr32_int
.align	5
.ChaCha20_ctr32_int:
__ChaCha20_ctr32_int:
	cmplwi	5,0
	bclr	14,2

	stwu	1,-160(1)
	mflr	0

	stw	14,88(1)
	stw	15,92(1)
	stw	16,96(1)
	stw	17,100(1)
	stw	18,104(1)
	stw	19,108(1)
	stw	20,112(1)
	stw	21,116(1)
	stw	22,120(1)
	stw	23,124(1)
	stw	24,128(1)
	stw	25,132(1)
	stw	26,136(1)
	stw	27,140(1)
	stw	28,144(1)
	stw	29,148(1)
	stw	30,152(1)
	stw	31,156(1)
	stw	0,164(1)

	lwz	11,0(7)
	lwz	12,4(7)
	lwz	14,8(7)
	lwz	15,12(7)

	bl	__ChaCha20_1x

	lwz	0,164(1)
	lwz	14,88(1)
	lwz	15,92(1)
	lwz	16,96(1)
	lwz	17,100(1)
	lwz	18,104(1)
	lwz	19,108(1)
	lwz	20,112(1)
	lwz	21,116(1)
	lwz	22,120(1)
	lwz	23,124(1)
	lwz	24,128(1)
	lwz	25,132(1)
	lwz	26,136(1)
	lwz	27,140(1)
	lwz	28,144(1)
	lwz	29,148(1)
	lwz	30,152(1)
	lwz	31,156(1)
	mtlr	0
	addi	1,1,160
	blr	
.long	0
.byte	0,12,4,1,0x80,18,5,0
.long	0


.align	5
__ChaCha20_1x:
Loop_outer:
	lis	16,0x6170
	lis	17,0x3320
	lis	18,0x7962
	lis	19,0x6b20
	ori	16,16,0x7865
	ori	17,17,0x646e
	ori	18,18,0x2d32
	ori	19,19,0x6574

	li	0,10
	lwz	20,0(6)
	lwz	21,4(6)
	lwz	22,8(6)
	lwz	23,12(6)
	lwz	24,16(6)
	mr	28,11
	lwz	25,20(6)
	mr	29,12
	lwz	26,24(6)
	mr	30,14
	lwz	27,28(6)
	mr	31,15

	mr	7,20
	mr	8,21
	mr	9,22
	mr	10,23

	mtctr	0
Loop:
	add	16,16,20
	add	17,17,21
	add	18,18,22
	add	19,19,23
	xor	28,28,16
	xor	29,29,17
	xor	30,30,18
	xor	31,31,19
	rotlwi	28,28,16
	rotlwi	29,29,16
	rotlwi	30,30,16
	rotlwi	31,31,16
	add	24,24,28
	add	25,25,29
	add	26,26,30
	add	27,27,31
	xor	20,20,24
	xor	21,21,25
	xor	22,22,26
	xor	23,23,27
	rotlwi	20,20,12
	rotlwi	21,21,12
	rotlwi	22,22,12
	rotlwi	23,23,12
	add	16,16,20
	add	17,17,21
	add	18,18,22
	add	19,19,23
	xor	28,28,16
	xor	29,29,17
	xor	30,30,18
	xor	31,31,19
	rotlwi	28,28,8
	rotlwi	29,29,8
	rotlwi	30,30,8
	rotlwi	31,31,8
	add	24,24,28
	add	25,25,29
	add	26,26,30
	add	27,27,31
	xor	20,20,24
	xor	21,21,25
	xor	22,22,26
	xor	23,23,27
	rotlwi	20,20,7
	rotlwi	21,21,7
	rotlwi	22,22,7
	rotlwi	23,23,7
	add	16,16,21
	add	17,17,22
	add	18,18,23
	add	19,19,20
	xor	31,31,16
	xor	28,28,17
	xor	29,29,18
	xor	30,30,19
	rotlwi	31,31,16
	rotlwi	28,28,16
	rotlwi	29,29,16
	rotlwi	30,30,16
	add	26,26,31
	add	27,27,28
	add	24,24,29
	add	25,25,30
	xor	21,21,26
	xor	22,22,27
	xor	23,23,24
	xor	20,20,25
	rotlwi	21,21,12
	rotlwi	22,22,12
	rotlwi	23,23,12
	rotlwi	20,20,12
	add	16,16,21
	add	17,17,22
	add	18,18,23
	add	19,19,20
	xor	31,31,16
	xor	28,28,17
	xor	29,29,18
	xor	30,30,19
	rotlwi	31,31,8
	rotlwi	28,28,8
	rotlwi	29,29,8
	rotlwi	30,30,8
	add	26,26,31
	add	27,27,28
	add	24,24,29
	add	25,25,30
	xor	21,21,26
	xor	22,22,27
	xor	23,23,24
	xor	20,20,25
	rotlwi	21,21,7
	rotlwi	22,22,7
	rotlwi	23,23,7
	rotlwi	20,20,7
	bc	16,0,Loop

	subic	5,5,64
	addi	16,16,0x7865
	addi	17,17,0x646e
	addi	18,18,0x2d32
	addi	19,19,0x6574
	addis	16,16,0x6170
	addis	17,17,0x3320
	addis	18,18,0x7962
	addis	19,19,0x6b20

	subfe.	0,0,0
	add	20,20,7
	lwz	7,16(6)
	add	21,21,8
	lwz	8,20(6)
	add	22,22,9
	lwz	9,24(6)
	add	23,23,10
	lwz	10,28(6)
	add	24,24,7
	add	25,25,8
	add	26,26,9
	add	27,27,10

	add	28,28,11
	add	29,29,12
	add	30,30,14
	add	31,31,15
	addi	11,11,1
	mr	7,16
	rotlwi	16,16,8
	rlwimi	16,7,24,0,7
	rlwimi	16,7,24,16,23
	mr	8,17
	rotlwi	17,17,8
	rlwimi	17,8,24,0,7
	rlwimi	17,8,24,16,23
	mr	9,18
	rotlwi	18,18,8
	rlwimi	18,9,24,0,7
	rlwimi	18,9,24,16,23
	mr	10,19
	rotlwi	19,19,8
	rlwimi	19,10,24,0,7
	rlwimi	19,10,24,16,23
	mr	7,20
	rotlwi	20,20,8
	rlwimi	20,7,24,0,7
	rlwimi	20,7,24,16,23
	mr	8,21
	rotlwi	21,21,8
	rlwimi	21,8,24,0,7
	rlwimi	21,8,24,16,23
	mr	9,22
	rotlwi	22,22,8
	rlwimi	22,9,24,0,7
	rlwimi	22,9,24,16,23
	mr	10,23
	rotlwi	23,23,8
	rlwimi	23,10,24,0,7
	rlwimi	23,10,24,16,23
	mr	7,24
	rotlwi	24,24,8
	rlwimi	24,7,24,0,7
	rlwimi	24,7,24,16,23
	mr	8,25
	rotlwi	25,25,8
	rlwimi	25,8,24,0,7
	rlwimi	25,8,24,16,23
	mr	9,26
	rotlwi	26,26,8
	rlwimi	26,9,24,0,7
	rlwimi	26,9,24,16,23
	mr	10,27
	rotlwi	27,27,8
	rlwimi	27,10,24,0,7
	rlwimi	27,10,24,16,23
	mr	7,28
	rotlwi	28,28,8
	rlwimi	28,7,24,0,7
	rlwimi	28,7,24,16,23
	mr	8,29
	rotlwi	29,29,8
	rlwimi	29,8,24,0,7
	rlwimi	29,8,24,16,23
	mr	9,30
	rotlwi	30,30,8
	rlwimi	30,9,24,0,7
	rlwimi	30,9,24,16,23
	mr	10,31
	rotlwi	31,31,8
	rlwimi	31,10,24,0,7
	rlwimi	31,10,24,16,23
	bne	Ltail

	lwz	7,0(4)
	lwz	8,4(4)
	cmplwi	5,0
	lwz	9,8(4)
	lwz	10,12(4)
	xor	16,16,7
	lwz	7,16(4)
	xor	17,17,8
	lwz	8,20(4)
	xor	18,18,9
	lwz	9,24(4)
	xor	19,19,10
	lwz	10,28(4)
	xor	20,20,7
	lwz	7,32(4)
	xor	21,21,8
	lwz	8,36(4)
	xor	22,22,9
	lwz	9,40(4)
	xor	23,23,10
	lwz	10,44(4)
	xor	24,24,7
	lwz	7,48(4)
	xor	25,25,8
	lwz	8,52(4)
	xor	26,26,9
	lwz	9,56(4)
	xor	27,27,10
	lwz	10,60(4)
	xor	28,28,7
	stw	16,0(3)
	xor	29,29,8
	stw	17,4(3)
	xor	30,30,9
	stw	18,8(3)
	xor	31,31,10
	stw	19,12(3)
	stw	20,16(3)
	stw	21,20(3)
	stw	22,24(3)
	stw	23,28(3)
	stw	24,32(3)
	stw	25,36(3)
	stw	26,40(3)
	stw	27,44(3)
	stw	28,48(3)
	stw	29,52(3)
	stw	30,56(3)
	addi	4,4,64
	stw	31,60(3)
	addi	3,3,64

	bne	Loop_outer

	blr	

.align	4
Ltail:
	addi	5,5,64
	subi	4,4,1
	subi	3,3,1
	addi	7,1,24-1
	mtctr	5

	stw	16,24(1)
	stw	17,28(1)
	stw	18,32(1)
	stw	19,36(1)
	stw	20,40(1)
	stw	21,44(1)
	stw	22,48(1)
	stw	23,52(1)
	stw	24,56(1)
	stw	25,60(1)
	stw	26,64(1)
	stw	27,68(1)
	stw	28,72(1)
	stw	29,76(1)
	stw	30,80(1)
	stw	31,84(1)

Loop_tail:
	lbzu	11,1(4)
	lbzu	16,1(7)
	xor	12,11,16
	stbu	12,1(3)
	bc	16,0,Loop_tail

	stw	1,24(1)
	stw	1,28(1)
	stw	1,32(1)
	stw	1,36(1)
	stw	1,40(1)
	stw	1,44(1)
	stw	1,48(1)
	stw	1,52(1)
	stw	1,56(1)
	stw	1,60(1)
	stw	1,64(1)
	stw	1,68(1)
	stw	1,72(1)
	stw	1,76(1)
	stw	1,80(1)
	stw	1,84(1)

	blr	
.long	0
.byte	0,12,0x14,0,0,0,0,0

.globl	.ChaCha20_ctr32_vmx
.align	5
.ChaCha20_ctr32_vmx:
	cmplwi	5,256
	blt	__ChaCha20_ctr32_int

	stwu	1,-368(1)
	mflr	0
	li	10,103
	li	11,119
	li	12,-1
	stvx	20,10,1
	addi	10,10,32
	stvx	21,11,1
	addi	11,11,32
	stvx	22,10,1
	addi	10,10,32
	stvx	23,11,1
	addi	11,11,32
	stvx	24,10,1
	addi	10,10,32
	stvx	25,11,1
	addi	11,11,32
	stvx	26,10,1
	addi	10,10,32
	stvx	27,11,1
	addi	11,11,32
	stvx	28,10,1
	addi	10,10,32
	stvx	29,11,1
	addi	11,11,32
	stvx	30,10,1
	stvx	31,11,1
	stw	12,292(1)
	stw	14,296(1)
	stw	15,300(1)
	stw	16,304(1)
	stw	17,308(1)
	stw	18,312(1)
	stw	19,316(1)
	stw	20,320(1)
	stw	21,324(1)
	stw	22,328(1)
	stw	23,332(1)
	stw	24,336(1)
	stw	25,340(1)
	stw	26,344(1)
	stw	27,348(1)
	stw	28,352(1)
	stw	29,356(1)
	stw	30,360(1)
	stw	31,364(1)
	li	12,-1
	stw	0, 372(1)
	or	12,12,12

	bl	Lconsts
	li	16,16
	li	17,32
	li	18,48
	li	19,64
	li	20,31
	li	21,15

	lvx	16,0,6
	lvsl	12,0,6
	lvx	17,16,6
	lvx	31,20,6

	lvx	18,0,7
	lvsl	13,0,7
	lvx	27,21,7

	lvx	15,0,12
	lvx	20,16,12
	lvx	21,17,12
	lvx	22,18,12
	lvx	23,19,12

	vperm	16,16,17,12
	vperm	17,17,31,12
	vperm	18,18,27,13

	lwz	11,0(7)
	lwz	12,4(7)
	vadduwm	18,18,20
	lwz	14,8(7)
	vadduwm	19,18,20
	lwz	15,12(7)
	vadduwm	20,19,20

	vspltisw	24,-12
	vspltisw	25,12
	vspltisw	26,-7


	vxor	12,12,12
	vspltisw	30,-1
	lvsl	28,0,4
	lvsr	29,0,3
	vperm	30,12,30,29

	lvsl	12,0,16
	vspltisb	13,3
	vxor	12,12,13
	vxor	29,29,13
	vperm	28,28,28,12

	b	Loop_outer_vmx

.align	4
Loop_outer_vmx:
	lis	16,0x6170
	lis	17,0x3320
	vor	0,15,15
	lis	18,0x7962
	lis	19,0x6b20
	vor	4,15,15
	ori	16,16,0x7865
	ori	17,17,0x646e
	vor	8,15,15
	ori	18,18,0x2d32
	ori	19,19,0x6574
	vor	1,16,16

	li	0,10
	lwz	20,0(6)
	vor	5,16,16
	lwz	21,4(6)
	vor	9,16,16
	lwz	22,8(6)
	vor	2,17,17
	lwz	23,12(6)
	vor	6,17,17
	lwz	24,16(6)
	vor	10,17,17
	mr	28,11
	lwz	25,20(6)
	vor	3,18,18
	mr	29,12
	lwz	26,24(6)
	vor	7,19,19
	mr	30,14
	lwz	27,28(6)
	vor	11,20,20
	mr	31,15

	mr	7,20
	mr	8,21
	mr	9,22
	mr	10,23
	vspltisw	27,7

	mtctr	0
	nop	
Loop_vmx:
	vadduwm	0,0,1
	add	16,16,20
	vadduwm	4,4,5
	add	17,17,21
	vadduwm	8,8,9
	add	18,18,22
	vxor	3,3,0
	add	19,19,23
	vxor	7,7,4
	xor	28,28,16
	vxor	11,11,8
	xor	29,29,17
	vperm	3,3,3,22
	xor	30,30,18
	vperm	7,7,7,22
	xor	31,31,19
	vperm	11,11,11,22
	rotlwi	28,28,16
	vadduwm	2,2,3
	rotlwi	29,29,16
	vadduwm	6,6,7
	rotlwi	30,30,16
	vadduwm	10,10,11
	rotlwi	31,31,16
	vxor	12,1,2
	add	24,24,28
	vxor	13,5,6
	add	25,25,29
	vxor	14,9,10
	add	26,26,30
	vsrw	1,12,24
	add	27,27,31
	vsrw	5,13,24
	xor	20,20,24
	vsrw	9,14,24
	xor	21,21,25
	vslw	12,12,25
	xor	22,22,26
	vslw	13,13,25
	xor	23,23,27
	vslw	14,14,25
	rotlwi	20,20,12
	vor	1,1,12
	rotlwi	21,21,12
	vor	5,5,13
	rotlwi	22,22,12
	vor	9,9,14
	rotlwi	23,23,12
	vadduwm	0,0,1
	add	16,16,20
	vadduwm	4,4,5
	add	17,17,21
	vadduwm	8,8,9
	add	18,18,22
	vxor	3,3,0
	add	19,19,23
	vxor	7,7,4
	xor	28,28,16
	vxor	11,11,8
	xor	29,29,17
	vperm	3,3,3,23
	xor	30,30,18
	vperm	7,7,7,23
	xor	31,31,19
	vperm	11,11,11,23
	rotlwi	28,28,8
	vadduwm	2,2,3
	rotlwi	29,29,8
	vadduwm	6,6,7
	rotlwi	30,30,8
	vadduwm	10,10,11
	rotlwi	31,31,8
	vxor	12,1,2
	add	24,24,28
	vxor	13,5,6
	add	25,25,29
	vxor	14,9,10
	add	26,26,30
	vsrw	1,12,26
	add	27,27,31
	vsrw	5,13,26
	xor	20,20,24
	vsrw	9,14,26
	xor	21,21,25
	vslw	12,12,27
	xor	22,22,26
	vslw	13,13,27
	xor	23,23,27
	vslw	14,14,27
	rotlwi	20,20,7
	vor	1,1,12
	rotlwi	21,21,7
	vor	5,5,13
	rotlwi	22,22,7
	vor	9,9,14
	rotlwi	23,23,7
	vsldoi	2,2,2, 16-8
	vsldoi	6,6,6, 16-8
	vsldoi	10,10,10, 16-8
	vsldoi	1,1,1, 16-12
	vsldoi	5,5,5, 16-12
	vsldoi	9,9,9, 16-12
	vsldoi	3,3,3, 16-4
	vsldoi	7,7,7, 16-4
	vsldoi	11,11,11, 16-4
	vadduwm	0,0,1
	add	16,16,21
	vadduwm	4,4,5
	add	17,17,22
	vadduwm	8,8,9
	add	18,18,23
	vxor	3,3,0
	add	19,19,20
	vxor	7,7,4
	xor	31,31,16
	vxor	11,11,8
	xor	28,28,17
	vperm	3,3,3,22
	xor	29,29,18
	vperm	7,7,7,22
	xor	30,30,19
	vperm	11,11,11,22
	rotlwi	31,31,16
	vadduwm	2,2,3
	rotlwi	28,28,16
	vadduwm	6,6,7
	rotlwi	29,29,16
	vadduwm	10,10,11
	rotlwi	30,30,16
	vxor	12,1,2
	add	26,26,31
	vxor	13,5,6
	add	27,27,28
	vxor	14,9,10
	add	24,24,29
	vsrw	1,12,24
	add	25,25,30
	vsrw	5,13,24
	xor	21,21,26
	vsrw	9,14,24
	xor	22,22,27
	vslw	12,12,25
	xor	23,23,24
	vslw	13,13,25
	xor	20,20,25
	vslw	14,14,25
	rotlwi	21,21,12
	vor	1,1,12
	rotlwi	22,22,12
	vor	5,5,13
	rotlwi	23,23,12
	vor	9,9,14
	rotlwi	20,20,12
	vadduwm	0,0,1
	add	16,16,21
	vadduwm	4,4,5
	add	17,17,22
	vadduwm	8,8,9
	add	18,18,23
	vxor	3,3,0
	add	19,19,20
	vxor	7,7,4
	xor	31,31,16
	vxor	11,11,8
	xor	28,28,17
	vperm	3,3,3,23
	xor	29,29,18
	vperm	7,7,7,23
	xor	30,30,19
	vperm	11,11,11,23
	rotlwi	31,31,8
	vadduwm	2,2,3
	rotlwi	28,28,8
	vadduwm	6,6,7
	rotlwi	29,29,8
	vadduwm	10,10,11
	rotlwi	30,30,8
	vxor	12,1,2
	add	26,26,31
	vxor	13,5,6
	add	27,27,28
	vxor	14,9,10
	add	24,24,29
	vsrw	1,12,26
	add	25,25,30
	vsrw	5,13,26
	xor	21,21,26
	vsrw	9,14,26
	xor	22,22,27
	vslw	12,12,27
	xor	23,23,24
	vslw	13,13,27
	xor	20,20,25
	vslw	14,14,27
	rotlwi	21,21,7
	vor	1,1,12
	rotlwi	22,22,7
	vor	5,5,13
	rotlwi	23,23,7
	vor	9,9,14
	rotlwi	20,20,7
	vsldoi	2,2,2, 16-8
	vsldoi	6,6,6, 16-8
	vsldoi	10,10,10, 16-8
	vsldoi	1,1,1, 16-4
	vsldoi	5,5,5, 16-4
	vsldoi	9,9,9, 16-4
	vsldoi	3,3,3, 16-12
	vsldoi	7,7,7, 16-12
	vsldoi	11,11,11, 16-12
	bc	16,0,Loop_vmx

	subi	5,5,256
	addi	16,16,0x7865
	addi	17,17,0x646e
	addi	18,18,0x2d32
	addi	19,19,0x6574
	addis	16,16,0x6170
	addis	17,17,0x3320
	addis	18,18,0x7962
	addis	19,19,0x6b20
	add	20,20,7
	lwz	7,16(6)
	add	21,21,8
	lwz	8,20(6)
	add	22,22,9
	lwz	9,24(6)
	add	23,23,10
	lwz	10,28(6)
	add	24,24,7
	add	25,25,8
	add	26,26,9
	add	27,27,10
	add	28,28,11
	add	29,29,12
	add	30,30,14
	add	31,31,15

	vadduwm	0,0,15
	vadduwm	4,4,15
	vadduwm	8,8,15
	vadduwm	1,1,16
	vadduwm	5,5,16
	vadduwm	9,9,16
	vadduwm	2,2,17
	vadduwm	6,6,17
	vadduwm	10,10,17
	vadduwm	3,3,18
	vadduwm	7,7,19
	vadduwm	11,11,20

	addi	11,11,4
	vadduwm	18,18,21
	vadduwm	19,19,21
	vadduwm	20,20,21

	mr	7,16
	rotlwi	16,16,8
	rlwimi	16,7,24,0,7
	rlwimi	16,7,24,16,23
	mr	8,17
	rotlwi	17,17,8
	rlwimi	17,8,24,0,7
	rlwimi	17,8,24,16,23
	mr	9,18
	rotlwi	18,18,8
	rlwimi	18,9,24,0,7
	rlwimi	18,9,24,16,23
	mr	10,19
	rotlwi	19,19,8
	rlwimi	19,10,24,0,7
	rlwimi	19,10,24,16,23
	mr	7,20
	rotlwi	20,20,8
	rlwimi	20,7,24,0,7
	rlwimi	20,7,24,16,23
	mr	8,21
	rotlwi	21,21,8
	rlwimi	21,8,24,0,7
	rlwimi	21,8,24,16,23
	mr	9,22
	rotlwi	22,22,8
	rlwimi	22,9,24,0,7
	rlwimi	22,9,24,16,23
	mr	10,23
	rotlwi	23,23,8
	rlwimi	23,10,24,0,7
	rlwimi	23,10,24,16,23
	mr	7,24
	rotlwi	24,24,8
	rlwimi	24,7,24,0,7
	rlwimi	24,7,24,16,23
	mr	8,25
	rotlwi	25,25,8
	rlwimi	25,8,24,0,7
	rlwimi	25,8,24,16,23
	mr	9,26
	rotlwi	26,26,8
	rlwimi	26,9,24,0,7
	rlwimi	26,9,24,16,23
	mr	10,27
	rotlwi	27,27,8
	rlwimi	27,10,24,0,7
	rlwimi	27,10,24,16,23
	mr	7,28
	rotlwi	28,28,8
	rlwimi	28,7,24,0,7
	rlwimi	28,7,24,16,23
	mr	8,29
	rotlwi	29,29,8
	rlwimi	29,8,24,0,7
	rlwimi	29,8,24,16,23
	mr	9,30
	rotlwi	30,30,8
	rlwimi	30,9,24,0,7
	rlwimi	30,9,24,16,23
	mr	10,31
	rotlwi	31,31,8
	rlwimi	31,10,24,0,7
	rlwimi	31,10,24,16,23
	lwz	7,0(4)
	lwz	8,4(4)
	lwz	9,8(4)
	lwz	10,12(4)
	xor	16,16,7
	lwz	7,16(4)
	xor	17,17,8
	lwz	8,20(4)
	xor	18,18,9
	lwz	9,24(4)
	xor	19,19,10
	lwz	10,28(4)
	xor	20,20,7
	lwz	7,32(4)
	xor	21,21,8
	lwz	8,36(4)
	xor	22,22,9
	lwz	9,40(4)
	xor	23,23,10
	lwz	10,44(4)
	xor	24,24,7
	lwz	7,48(4)
	xor	25,25,8
	lwz	8,52(4)
	xor	26,26,9
	lwz	9,56(4)
	xor	27,27,10
	lwz	10,60(4)
	xor	28,28,7
	stw	16,0(3)
	xor	29,29,8
	stw	17,4(3)
	xor	30,30,9
	stw	18,8(3)
	xor	31,31,10
	stw	19,12(3)
	addi	4,4,64
	stw	20,16(3)
	li	7,16
	stw	21,20(3)
	li	8,32
	stw	22,24(3)
	li	9,48
	stw	23,28(3)
	li	10,64
	stw	24,32(3)
	stw	25,36(3)
	stw	26,40(3)
	stw	27,44(3)
	stw	28,48(3)
	stw	29,52(3)
	stw	30,56(3)
	stw	31,60(3)
	addi	3,3,64

	lvx	31,0,4
	lvx	27,7,4
	lvx	12,8,4
	lvx	13,9,4
	lvx	14,10,4
	addi	4,4,64

	vperm	31,31,27,28
	vperm	27,27,12,28
	vperm	12,12,13,28
	vperm	13,13,14,28
	vxor	0,0,31
	vxor	1,1,27
	lvx	27,7,4
	vxor	2,2,12
	lvx	12,8,4
	vxor	3,3,13
	lvx	13,9,4
	lvx	31,10,4
	addi	4,4,64
	li	10,63
	vperm	0,0,0,29
	vperm	1,1,1,29
	vperm	2,2,2,29
	vperm	3,3,3,29

	vperm	14,14,27,28
	vperm	27,27,12,28
	vperm	12,12,13,28
	vperm	13,13,31,28
	vxor	4,4,14
	vxor	5,5,27
	lvx	27,7,4
	vxor	6,6,12
	lvx	12,8,4
	vxor	7,7,13
	lvx	13,9,4
	lvx	14,10,4
	addi	4,4,64
	vperm	4,4,4,29
	vperm	5,5,5,29
	vperm	6,6,6,29
	vperm	7,7,7,29

	vperm	31,31,27,28
	vperm	27,27,12,28
	vperm	12,12,13,28
	vperm	13,13,14,28
	vxor	8,8,31
	vxor	9,9,27
	vxor	10,10,12
	vxor	11,11,13
	vperm	8,8,8,29
	vperm	9,9,9,29
	vperm	10,10,10,29
	vperm	11,11,11,29

	andi.	17,3,15
	mr	16,3

	vsel	31,0,1,30
	vsel	27,1,2,30
	vsel	12,2,3,30
	vsel	13,3,4,30
	vsel	1,4,5,30
	vsel	2,5,6,30
	vsel	3,6,7,30
	vsel	4,7,8,30
	vsel	5,8,9,30
	vsel	6,9,10,30
	vsel	7,10,11,30


	stvx	31,7,3
	stvx	27,8,3
	stvx	12,9,3
	addi	3,3,64
	stvx	13,0,3
	stvx	1,7,3
	stvx	2,8,3
	stvx	3,9,3
	addi	3,3,64
	stvx	4,0,3
	stvx	5,7,3
	stvx	6,8,3
	stvx	7,9,3
	addi	3,3,64

	beq	Laligned_vmx

	sub	18,3,17
	li	19,0
Lunaligned_tail_vmx:
	stvebx	11,19,18
	addi	19,19,1
	cmpw	19,17
	bne	Lunaligned_tail_vmx

	sub	18,16,17
Lunaligned_head_vmx:
	stvebx	0,17,18
	cmpwi	17,15
	addi	17,17,1
	bne	Lunaligned_head_vmx

	cmplwi	5,255
	bgt	Loop_outer_vmx

	b	Ldone_vmx

.align	4
Laligned_vmx:
	stvx	0,0,16

	cmplwi	5,255
	bgt	Loop_outer_vmx
	nop	

Ldone_vmx:
	cmplwi	5,0
	bnel	__ChaCha20_1x

	lwz	12,292(1)
	li	10,103
	li	11,119
	or	12,12,12
	lvx	20,10,1
	addi	10,10,32
	lvx	21,11,1
	addi	11,11,32
	lvx	22,10,1
	addi	10,10,32
	lvx	23,11,1
	addi	11,11,32
	lvx	24,10,1
	addi	10,10,32
	lvx	25,11,1
	addi	11,11,32
	lvx	26,10,1
	addi	10,10,32
	lvx	27,11,1
	addi	11,11,32
	lvx	28,10,1
	addi	10,10,32
	lvx	29,11,1
	addi	11,11,32
	lvx	30,10,1
	lvx	31,11,1
	lwz	0, 372(1)
	lwz	14,296(1)
	lwz	15,300(1)
	lwz	16,304(1)
	lwz	17,308(1)
	lwz	18,312(1)
	lwz	19,316(1)
	lwz	20,320(1)
	lwz	21,324(1)
	lwz	22,328(1)
	lwz	23,332(1)
	lwz	24,336(1)
	lwz	25,340(1)
	lwz	26,344(1)
	lwz	27,348(1)
	lwz	28,352(1)
	lwz	29,356(1)
	lwz	30,360(1)
	lwz	31,364(1)
	mtlr	0
	addi	1,1,368
	blr	
.long	0
.byte	0,12,0x04,1,0x80,18,5,0
.long	0


.align	5
Lconsts:
	mflr	0
	bcl	20,31,$+4
	mflr	12
	addi	12,12,56
	mtlr	0
	blr	
.long	0
.byte	0,12,0x14,0,0,0,0,0
.space	28
Lsigma:
.long	0x61707865,0x3320646e,0x79622d32,0x6b206574
.long	1,0,0,0
.long	4,0,0,0
.long	0x02030001,0x06070405,0x0a0b0809,0x0e0f0c0d
.long	0x01020300,0x05060704,0x090a0b08,0x0d0e0f0c
.byte	67,104,97,67,104,97,50,48,32,102,111,114,32,80,111,119,101,114,80,67,47,65,108,116,105,86,101,99,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
.align	2
.align	2