xref: /freebsd/sys/crypto/openssl/powerpc64/keccak1600-ppc64.S (revision 3e8eb5c7f4909209c042403ddee340b2ee7003a5)
1/* $FreeBSD$ */
2/* Do not modify. This file is auto-generated from keccak1600-ppc64.pl. */
3.abiversion	2
4.text
5
6.type	KeccakF1600_int,@function
7.align	5
8KeccakF1600_int:
9.localentry	KeccakF1600_int,0
10
11	li	0,24
12	mtctr	0
13	b	.Loop
14.align	4
15.Loop:
16	xor	0,7,12
17	std	11,96(1)
18	xor	3,8,6
19	std	16,104(1)
20	xor	4,9,14
21	std	21,112(1)
22	xor	5,10,15
23	std	26,120(1)
24	xor	11,11,16
25	xor	0,0,17
26	xor	3,3,18
27	xor	4,4,19
28	xor	5,5,20
29	xor	11,11,21
30	xor	0,0,22
31	xor	3,3,23
32	xor	4,4,24
33	xor	5,5,25
34	xor	11,11,26
35	xor	0,0,27
36	xor	4,4,29
37	xor	3,3,28
38	xor	5,5,30
39	rotldi	16,4,1
40	xor	11,11,31
41	rotldi	21,5,1
42	xor	16,16,0
43	rotldi	26,11,1
44
45	xor	8,8,16
46	xor	6,6,16
47	xor	18,18,16
48	xor	23,23,16
49	xor	28,28,16
50
51	rotldi	16,0,1
52	xor	21,21,3
53	xor	4,4,26
54	rotldi	26,3,1
55	xor	5,5,16
56	xor	11,11,26
57
58	xor	3,   9,21
59	xor	14,14,21
60	xor	19,19,21
61	xor	24,24,21
62	xor	29,29,21
63
64	xor	7,7,11
65	xor	12,12,11
66	xor	17,17,11
67	xor	22,22,11
68	xor	27,27,11
69	ld	11,96(1)
70	xor	0,   10,4
71	ld	16,104(1)
72	xor	15,15,4
73	ld	21,112(1)
74	xor	20,20,4
75	ld	26,120(1)
76	xor	25,25,4
77	xor	30,30,4
78
79	xor	4,   11,5
80	xor	16,16,5
81	xor	21,21,5
82	xor	26,26,5
83	xor	31,31,5
84
85	mr	5,8
86	rotldi	8,6,44
87
88	rotldi	9,19,43
89
90	rotldi	10,25,21
91
92	rotldi	11,31,14
93
94	rotldi	6,16,20
95	rotldi	19,20,25
96	rotldi	25,24,15
97	rotldi	31,28,2
98
99	rotldi	16,29,61
100	rotldi	20,26,8
101	rotldi	24,18,10
102	rotldi	28,15,55
103
104	rotldi	29,21,39
105	rotldi	26,30,56
106	rotldi	18,14,6
107	rotldi	15,23,45
108
109	rotldi	21,27,18
110	rotldi	30,22,41
111	rotldi	14,17,3
112	rotldi	23,12,36
113
114	rotldi	12,0,28
115	rotldi	17,5,1
116	rotldi	22,4,27
117	rotldi	27,3,62
118
119	andc	0,9,8
120	andc	3,10,9
121	andc	4,7,11
122	andc	5,8,7
123	xor	7,7,0
124	andc	0,11,10
125	xor	8,8,3
126	ld	3,80(1)
127	xor	10,10,4
128	xor	11,11,5
129	xor	9,9,0
130	ldu	5,8(3)
131
132	andc	0,14,6
133	std	3,80(1)
134	andc	3,15,14
135	andc	4,12,16
136	xor	7,7,5
137	andc	5,6,12
138	xor	12,12,0
139	andc	0,16,15
140	xor	6,6,3
141	xor	15,15,4
142	xor	16,16,5
143	xor	14,14,0
144
145	andc	0,19,18
146	andc	3,20,19
147	andc	4,17,21
148	andc	5,18,17
149	xor	17,17,0
150	andc	0,21,20
151	xor	18,18,3
152	xor	20,20,4
153	xor	21,21,5
154	xor	19,19,0
155
156	andc	0,24,23
157	andc	3,25,24
158	andc	4,22,26
159	andc	5,23,22
160	xor	22,22,0
161	andc	0,26,25
162	xor	23,23,3
163	xor	25,25,4
164	xor	26,26,5
165	xor	24,24,0
166
167	andc	0,29,28
168	andc	3,30,29
169	andc	4,27,31
170	andc	5,28,27
171	xor	27,27,0
172	andc	0,31,30
173	xor	28,28,3
174	xor	30,30,4
175	xor	31,31,5
176	xor	29,29,0
177
178	bdnz	.Loop
179
180	blr
181.long	0
182.byte	0,12,0x14,0,0,0,0,0
183.size	KeccakF1600_int,.-KeccakF1600_int
184
185.type	KeccakF1600,@function
186.align	5
187KeccakF1600:
188.localentry	KeccakF1600,0
189
190	stdu	1,-272(1)
191	mflr	0
192	std	14,128(1)
193	std	15,136(1)
194	std	16,144(1)
195	std	17,152(1)
196	std	18,160(1)
197	std	19,168(1)
198	std	20,176(1)
199	std	21,184(1)
200	std	22,192(1)
201	std	23,200(1)
202	std	24,208(1)
203	std	25,216(1)
204	std	26,224(1)
205	std	27,232(1)
206	std	28,240(1)
207	std	29,248(1)
208	std	30,256(1)
209	std	31,264(1)
210	std	0,288(1)
211
212	bl	PICmeup
213	subi	12,12,8
214
215	std	3,48(1)
216
217
218
219	std	12,80(1)
220
221	ld	7,0(3)
222	ld	8,8(3)
223	ld	9,16(3)
224	ld	10,24(3)
225	ld	11,32(3)
226	ld	12,40(3)
227	ld	6,48(3)
228	ld	14,56(3)
229	ld	15,64(3)
230	ld	16,72(3)
231	ld	17,80(3)
232	ld	18,88(3)
233	ld	19,96(3)
234	ld	20,104(3)
235	ld	21,112(3)
236	ld	22,120(3)
237	ld	23,128(3)
238	ld	24,136(3)
239	ld	25,144(3)
240	ld	26,152(3)
241	ld	27,160(3)
242	ld	28,168(3)
243	ld	29,176(3)
244	ld	30,184(3)
245	ld	31,192(3)
246
247	bl	KeccakF1600_int
248
249	ld	3,48(1)
250	std	7,0(3)
251	std	8,8(3)
252	std	9,16(3)
253	std	10,24(3)
254	std	11,32(3)
255	std	12,40(3)
256	std	6,48(3)
257	std	14,56(3)
258	std	15,64(3)
259	std	16,72(3)
260	std	17,80(3)
261	std	18,88(3)
262	std	19,96(3)
263	std	20,104(3)
264	std	21,112(3)
265	std	22,120(3)
266	std	23,128(3)
267	std	24,136(3)
268	std	25,144(3)
269	std	26,152(3)
270	std	27,160(3)
271	std	28,168(3)
272	std	29,176(3)
273	std	30,184(3)
274	std	31,192(3)
275
276	ld	0,288(1)
277	ld	14,128(1)
278	ld	15,136(1)
279	ld	16,144(1)
280	ld	17,152(1)
281	ld	18,160(1)
282	ld	19,168(1)
283	ld	20,176(1)
284	ld	21,184(1)
285	ld	22,192(1)
286	ld	23,200(1)
287	ld	24,208(1)
288	ld	25,216(1)
289	ld	26,224(1)
290	ld	27,232(1)
291	ld	28,240(1)
292	ld	29,248(1)
293	ld	30,256(1)
294	ld	31,264(1)
295	mtlr	0
296	addi	1,1,272
297	blr
298.long	0
299.byte	0,12,4,1,0x80,18,1,0
300.long	0
301.size	KeccakF1600,.-KeccakF1600
302
303.type	dword_le_load,@function
304.align	5
305dword_le_load:
306.localentry	dword_le_load,0
307
308	lbzu	0,1(3)
309	lbzu	4,1(3)
310	lbzu	5,1(3)
311	insrdi	0,4,8,48
312	lbzu	4,1(3)
313	insrdi	0,5,8,40
314	lbzu	5,1(3)
315	insrdi	0,4,8,32
316	lbzu	4,1(3)
317	insrdi	0,5,8,24
318	lbzu	5,1(3)
319	insrdi	0,4,8,16
320	lbzu	4,1(3)
321	insrdi	0,5,8,8
322	insrdi	0,4,8,0
323	blr
324.long	0
325.byte	0,12,0x14,0,0,0,1,0
326.long	0
327.size	dword_le_load,.-dword_le_load
328
329.globl	SHA3_absorb
330.type	SHA3_absorb,@function
331.type	SHA3_absorb,@function
332.align	5
333SHA3_absorb:
334.localentry	SHA3_absorb,0
335
336	stdu	1,-272(1)
337	mflr	0
338	std	14,128(1)
339	std	15,136(1)
340	std	16,144(1)
341	std	17,152(1)
342	std	18,160(1)
343	std	19,168(1)
344	std	20,176(1)
345	std	21,184(1)
346	std	22,192(1)
347	std	23,200(1)
348	std	24,208(1)
349	std	25,216(1)
350	std	26,224(1)
351	std	27,232(1)
352	std	28,240(1)
353	std	29,248(1)
354	std	30,256(1)
355	std	31,264(1)
356	std	0,288(1)
357
358	bl	PICmeup
359	subi	4,4,1
360	subi	12,12,8
361
362	std	3,48(1)
363	std	4,56(1)
364	std	5,64(1)
365	std	6,72(1)
366	mr	0,6
367	std	12,80(1)
368
369	ld	7,0(3)
370	ld	8,8(3)
371	ld	9,16(3)
372	ld	10,24(3)
373	ld	11,32(3)
374	ld	12,40(3)
375	ld	6,48(3)
376	ld	14,56(3)
377	ld	15,64(3)
378	ld	16,72(3)
379	ld	17,80(3)
380	ld	18,88(3)
381	ld	19,96(3)
382	ld	20,104(3)
383	ld	21,112(3)
384	ld	22,120(3)
385	ld	23,128(3)
386	ld	24,136(3)
387	ld	25,144(3)
388	ld	26,152(3)
389	ld	27,160(3)
390	ld	28,168(3)
391	ld	29,176(3)
392	ld	30,184(3)
393	ld	31,192(3)
394
395	mr	3,4
396	mr	4,5
397	mr	5,0
398
399	b	.Loop_absorb
400
401.align	4
402.Loop_absorb:
403	cmpld	4,5
404	blt	.Labsorbed
405
406	sub	4,4,5
407	srwi	5,5,3
408	std	4,64(1)
409	mtctr	5
410	bl	dword_le_load
411	xor	7,7,0
412	bdz	.Lprocess_block
413	bl	dword_le_load
414	xor	8,8,0
415	bdz	.Lprocess_block
416	bl	dword_le_load
417	xor	9,9,0
418	bdz	.Lprocess_block
419	bl	dword_le_load
420	xor	10,10,0
421	bdz	.Lprocess_block
422	bl	dword_le_load
423	xor	11,11,0
424	bdz	.Lprocess_block
425	bl	dword_le_load
426	xor	12,12,0
427	bdz	.Lprocess_block
428	bl	dword_le_load
429	xor	6,6,0
430	bdz	.Lprocess_block
431	bl	dword_le_load
432	xor	14,14,0
433	bdz	.Lprocess_block
434	bl	dword_le_load
435	xor	15,15,0
436	bdz	.Lprocess_block
437	bl	dword_le_load
438	xor	16,16,0
439	bdz	.Lprocess_block
440	bl	dword_le_load
441	xor	17,17,0
442	bdz	.Lprocess_block
443	bl	dword_le_load
444	xor	18,18,0
445	bdz	.Lprocess_block
446	bl	dword_le_load
447	xor	19,19,0
448	bdz	.Lprocess_block
449	bl	dword_le_load
450	xor	20,20,0
451	bdz	.Lprocess_block
452	bl	dword_le_load
453	xor	21,21,0
454	bdz	.Lprocess_block
455	bl	dword_le_load
456	xor	22,22,0
457	bdz	.Lprocess_block
458	bl	dword_le_load
459	xor	23,23,0
460	bdz	.Lprocess_block
461	bl	dword_le_load
462	xor	24,24,0
463	bdz	.Lprocess_block
464	bl	dword_le_load
465	xor	25,25,0
466	bdz	.Lprocess_block
467	bl	dword_le_load
468	xor	26,26,0
469	bdz	.Lprocess_block
470	bl	dword_le_load
471	xor	27,27,0
472	bdz	.Lprocess_block
473	bl	dword_le_load
474	xor	28,28,0
475	bdz	.Lprocess_block
476	bl	dword_le_load
477	xor	29,29,0
478	bdz	.Lprocess_block
479	bl	dword_le_load
480	xor	30,30,0
481	bdz	.Lprocess_block
482	bl	dword_le_load
483	xor	31,31,0
484
485.Lprocess_block:
486	std	3,56(1)
487
488	bl	KeccakF1600_int
489
490	ld	0,80(1)
491	ld	5,72(1)
492	ld	4,64(1)
493	ld	3,56(1)
494	addic	0,0,-192
495	std	0,80(1)
496
497	b	.Loop_absorb
498
499.align	4
500.Labsorbed:
501	ld	3,48(1)
502	std	7,0(3)
503	std	8,8(3)
504	std	9,16(3)
505	std	10,24(3)
506	std	11,32(3)
507	std	12,40(3)
508	std	6,48(3)
509	std	14,56(3)
510	std	15,64(3)
511	std	16,72(3)
512	std	17,80(3)
513	std	18,88(3)
514	std	19,96(3)
515	std	20,104(3)
516	std	21,112(3)
517	std	22,120(3)
518	std	23,128(3)
519	std	24,136(3)
520	std	25,144(3)
521	std	26,152(3)
522	std	27,160(3)
523	std	28,168(3)
524	std	29,176(3)
525	std	30,184(3)
526	std	31,192(3)
527
528	mr	3,4
529	ld	0,288(1)
530	ld	14,128(1)
531	ld	15,136(1)
532	ld	16,144(1)
533	ld	17,152(1)
534	ld	18,160(1)
535	ld	19,168(1)
536	ld	20,176(1)
537	ld	21,184(1)
538	ld	22,192(1)
539	ld	23,200(1)
540	ld	24,208(1)
541	ld	25,216(1)
542	ld	26,224(1)
543	ld	27,232(1)
544	ld	28,240(1)
545	ld	29,248(1)
546	ld	30,256(1)
547	ld	31,264(1)
548	mtlr	0
549	addi	1,1,272
550	blr
551.long	0
552.byte	0,12,4,1,0x80,18,4,0
553.long	0
554.size	SHA3_absorb,.-SHA3_absorb
555.globl	SHA3_squeeze
556.type	SHA3_squeeze,@function
557.type	SHA3_squeeze,@function
558.align	5
559SHA3_squeeze:
560.localentry	SHA3_squeeze,0
561
562	stdu	1,-80(1)
563	mflr	0
564	std	28,48(1)
565	std	29,56(1)
566	std	30,64(1)
567	std	31,72(1)
568	std	0,96(1)
569
570	mr	28,3
571	subi	3,3,8
572	subi	29,4,1
573	mr	30,5
574	mr	31,6
575	b	.Loop_squeeze
576
577.align	4
578.Loop_squeeze:
579	ldu	0,8(3)
580	cmpldi	30,8
581	blt	.Lsqueeze_tail
582
583	stbu	0,1(29)
584	srdi	0,0,8
585	stbu	0,1(29)
586	srdi	0,0,8
587	stbu	0,1(29)
588	srdi	0,0,8
589	stbu	0,1(29)
590	srdi	0,0,8
591	stbu	0,1(29)
592	srdi	0,0,8
593	stbu	0,1(29)
594	srdi	0,0,8
595	stbu	0,1(29)
596	srdi	0,0,8
597	stbu	0,1(29)
598
599	subic.	30,30,8
600	beq	.Lsqueeze_done
601
602	subic.	6,6,8
603	bgt	.Loop_squeeze
604
605	mr	3,28
606	bl	KeccakF1600
607	subi	3,28,8
608	mr	6,31
609	b	.Loop_squeeze
610
611.align	4
612.Lsqueeze_tail:
613	mtctr	30
614.Loop_tail:
615	stbu	0,1(29)
616	srdi	0,0,8
617	bdnz	.Loop_tail
618
619.Lsqueeze_done:
620	ld	0,96(1)
621	ld	28,48(1)
622	ld	29,56(1)
623	ld	30,64(1)
624	ld	31,72(1)
625	mtlr	0
626	addi	1,1,80
627	blr
628.long	0
629.byte	0,12,4,1,0x80,4,4,0
630.long	0
631.size	SHA3_squeeze,.-SHA3_squeeze
632.align	6
633PICmeup:
634	mflr	0
635	bcl	20,31,$+4
636	mflr	12
637	addi	12,12,56
638	mtlr	0
639	blr
640.long	0
641.byte	0,12,0x14,0,0,0,0,0
642.space	28
643.type	iotas,@object
644iotas:
645.long	0x00000000,0x00000001
646.long	0x00000000,0x00008082
647.long	0x80000000,0x0000808a
648.long	0x80000000,0x80008000
649.long	0x00000000,0x0000808b
650.long	0x00000000,0x80000001
651.long	0x80000000,0x80008081
652.long	0x80000000,0x00008009
653.long	0x00000000,0x0000008a
654.long	0x00000000,0x00000088
655.long	0x00000000,0x80008009
656.long	0x00000000,0x8000000a
657.long	0x00000000,0x8000808b
658.long	0x80000000,0x0000008b
659.long	0x80000000,0x00008089
660.long	0x80000000,0x00008003
661.long	0x80000000,0x00008002
662.long	0x80000000,0x00000080
663.long	0x00000000,0x0000800a
664.long	0x80000000,0x8000000a
665.long	0x80000000,0x80008081
666.long	0x80000000,0x00008080
667.long	0x00000000,0x80000001
668.long	0x80000000,0x80008008
669.size	iotas,.-iotas
670.byte	75,101,99,99,97,107,45,49,54,48,48,32,97,98,115,111,114,98,32,97,110,100,32,115,113,117,101,101,122,101,32,102,111,114,32,80,80,67,54,52,44,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
671.align	2
672