etc/services - sync with NetBSD-8
[minix.git] / crypto / external / bsd / openssl / lib / libcrypto / arch / sparc64 / aes-sparcv9.S
blob3fe78b66fc459f210e942b24cad6eb93342f20fe
1 .register       %g2,#scratch
2 .register       %g3,#scratch
3 .section        ".text",#alloc,#execinstr
5 .align  256
6 AES_Te:
7         .long   0xc66363a5,0xc66363a5
8         .long   0xf87c7c84,0xf87c7c84
9         .long   0xee777799,0xee777799
10         .long   0xf67b7b8d,0xf67b7b8d
11         .long   0xfff2f20d,0xfff2f20d
12         .long   0xd66b6bbd,0xd66b6bbd
13         .long   0xde6f6fb1,0xde6f6fb1
14         .long   0x91c5c554,0x91c5c554
15         .long   0x60303050,0x60303050
16         .long   0x02010103,0x02010103
17         .long   0xce6767a9,0xce6767a9
18         .long   0x562b2b7d,0x562b2b7d
19         .long   0xe7fefe19,0xe7fefe19
20         .long   0xb5d7d762,0xb5d7d762
21         .long   0x4dababe6,0x4dababe6
22         .long   0xec76769a,0xec76769a
23         .long   0x8fcaca45,0x8fcaca45
24         .long   0x1f82829d,0x1f82829d
25         .long   0x89c9c940,0x89c9c940
26         .long   0xfa7d7d87,0xfa7d7d87
27         .long   0xeffafa15,0xeffafa15
28         .long   0xb25959eb,0xb25959eb
29         .long   0x8e4747c9,0x8e4747c9
30         .long   0xfbf0f00b,0xfbf0f00b
31         .long   0x41adadec,0x41adadec
32         .long   0xb3d4d467,0xb3d4d467
33         .long   0x5fa2a2fd,0x5fa2a2fd
34         .long   0x45afafea,0x45afafea
35         .long   0x239c9cbf,0x239c9cbf
36         .long   0x53a4a4f7,0x53a4a4f7
37         .long   0xe4727296,0xe4727296
38         .long   0x9bc0c05b,0x9bc0c05b
39         .long   0x75b7b7c2,0x75b7b7c2
40         .long   0xe1fdfd1c,0xe1fdfd1c
41         .long   0x3d9393ae,0x3d9393ae
42         .long   0x4c26266a,0x4c26266a
43         .long   0x6c36365a,0x6c36365a
44         .long   0x7e3f3f41,0x7e3f3f41
45         .long   0xf5f7f702,0xf5f7f702
46         .long   0x83cccc4f,0x83cccc4f
47         .long   0x6834345c,0x6834345c
48         .long   0x51a5a5f4,0x51a5a5f4
49         .long   0xd1e5e534,0xd1e5e534
50         .long   0xf9f1f108,0xf9f1f108
51         .long   0xe2717193,0xe2717193
52         .long   0xabd8d873,0xabd8d873
53         .long   0x62313153,0x62313153
54         .long   0x2a15153f,0x2a15153f
55         .long   0x0804040c,0x0804040c
56         .long   0x95c7c752,0x95c7c752
57         .long   0x46232365,0x46232365
58         .long   0x9dc3c35e,0x9dc3c35e
59         .long   0x30181828,0x30181828
60         .long   0x379696a1,0x379696a1
61         .long   0x0a05050f,0x0a05050f
62         .long   0x2f9a9ab5,0x2f9a9ab5
63         .long   0x0e070709,0x0e070709
64         .long   0x24121236,0x24121236
65         .long   0x1b80809b,0x1b80809b
66         .long   0xdfe2e23d,0xdfe2e23d
67         .long   0xcdebeb26,0xcdebeb26
68         .long   0x4e272769,0x4e272769
69         .long   0x7fb2b2cd,0x7fb2b2cd
70         .long   0xea75759f,0xea75759f
71         .long   0x1209091b,0x1209091b
72         .long   0x1d83839e,0x1d83839e
73         .long   0x582c2c74,0x582c2c74
74         .long   0x341a1a2e,0x341a1a2e
75         .long   0x361b1b2d,0x361b1b2d
76         .long   0xdc6e6eb2,0xdc6e6eb2
77         .long   0xb45a5aee,0xb45a5aee
78         .long   0x5ba0a0fb,0x5ba0a0fb
79         .long   0xa45252f6,0xa45252f6
80         .long   0x763b3b4d,0x763b3b4d
81         .long   0xb7d6d661,0xb7d6d661
82         .long   0x7db3b3ce,0x7db3b3ce
83         .long   0x5229297b,0x5229297b
84         .long   0xdde3e33e,0xdde3e33e
85         .long   0x5e2f2f71,0x5e2f2f71
86         .long   0x13848497,0x13848497
87         .long   0xa65353f5,0xa65353f5
88         .long   0xb9d1d168,0xb9d1d168
89         .long   0x00000000,0x00000000
90         .long   0xc1eded2c,0xc1eded2c
91         .long   0x40202060,0x40202060
92         .long   0xe3fcfc1f,0xe3fcfc1f
93         .long   0x79b1b1c8,0x79b1b1c8
94         .long   0xb65b5bed,0xb65b5bed
95         .long   0xd46a6abe,0xd46a6abe
96         .long   0x8dcbcb46,0x8dcbcb46
97         .long   0x67bebed9,0x67bebed9
98         .long   0x7239394b,0x7239394b
99         .long   0x944a4ade,0x944a4ade
100         .long   0x984c4cd4,0x984c4cd4
101         .long   0xb05858e8,0xb05858e8
102         .long   0x85cfcf4a,0x85cfcf4a
103         .long   0xbbd0d06b,0xbbd0d06b
104         .long   0xc5efef2a,0xc5efef2a
105         .long   0x4faaaae5,0x4faaaae5
106         .long   0xedfbfb16,0xedfbfb16
107         .long   0x864343c5,0x864343c5
108         .long   0x9a4d4dd7,0x9a4d4dd7
109         .long   0x66333355,0x66333355
110         .long   0x11858594,0x11858594
111         .long   0x8a4545cf,0x8a4545cf
112         .long   0xe9f9f910,0xe9f9f910
113         .long   0x04020206,0x04020206
114         .long   0xfe7f7f81,0xfe7f7f81
115         .long   0xa05050f0,0xa05050f0
116         .long   0x783c3c44,0x783c3c44
117         .long   0x259f9fba,0x259f9fba
118         .long   0x4ba8a8e3,0x4ba8a8e3
119         .long   0xa25151f3,0xa25151f3
120         .long   0x5da3a3fe,0x5da3a3fe
121         .long   0x804040c0,0x804040c0
122         .long   0x058f8f8a,0x058f8f8a
123         .long   0x3f9292ad,0x3f9292ad
124         .long   0x219d9dbc,0x219d9dbc
125         .long   0x70383848,0x70383848
126         .long   0xf1f5f504,0xf1f5f504
127         .long   0x63bcbcdf,0x63bcbcdf
128         .long   0x77b6b6c1,0x77b6b6c1
129         .long   0xafdada75,0xafdada75
130         .long   0x42212163,0x42212163
131         .long   0x20101030,0x20101030
132         .long   0xe5ffff1a,0xe5ffff1a
133         .long   0xfdf3f30e,0xfdf3f30e
134         .long   0xbfd2d26d,0xbfd2d26d
135         .long   0x81cdcd4c,0x81cdcd4c
136         .long   0x180c0c14,0x180c0c14
137         .long   0x26131335,0x26131335
138         .long   0xc3ecec2f,0xc3ecec2f
139         .long   0xbe5f5fe1,0xbe5f5fe1
140         .long   0x359797a2,0x359797a2
141         .long   0x884444cc,0x884444cc
142         .long   0x2e171739,0x2e171739
143         .long   0x93c4c457,0x93c4c457
144         .long   0x55a7a7f2,0x55a7a7f2
145         .long   0xfc7e7e82,0xfc7e7e82
146         .long   0x7a3d3d47,0x7a3d3d47
147         .long   0xc86464ac,0xc86464ac
148         .long   0xba5d5de7,0xba5d5de7
149         .long   0x3219192b,0x3219192b
150         .long   0xe6737395,0xe6737395
151         .long   0xc06060a0,0xc06060a0
152         .long   0x19818198,0x19818198
153         .long   0x9e4f4fd1,0x9e4f4fd1
154         .long   0xa3dcdc7f,0xa3dcdc7f
155         .long   0x44222266,0x44222266
156         .long   0x542a2a7e,0x542a2a7e
157         .long   0x3b9090ab,0x3b9090ab
158         .long   0x0b888883,0x0b888883
159         .long   0x8c4646ca,0x8c4646ca
160         .long   0xc7eeee29,0xc7eeee29
161         .long   0x6bb8b8d3,0x6bb8b8d3
162         .long   0x2814143c,0x2814143c
163         .long   0xa7dede79,0xa7dede79
164         .long   0xbc5e5ee2,0xbc5e5ee2
165         .long   0x160b0b1d,0x160b0b1d
166         .long   0xaddbdb76,0xaddbdb76
167         .long   0xdbe0e03b,0xdbe0e03b
168         .long   0x64323256,0x64323256
169         .long   0x743a3a4e,0x743a3a4e
170         .long   0x140a0a1e,0x140a0a1e
171         .long   0x924949db,0x924949db
172         .long   0x0c06060a,0x0c06060a
173         .long   0x4824246c,0x4824246c
174         .long   0xb85c5ce4,0xb85c5ce4
175         .long   0x9fc2c25d,0x9fc2c25d
176         .long   0xbdd3d36e,0xbdd3d36e
177         .long   0x43acacef,0x43acacef
178         .long   0xc46262a6,0xc46262a6
179         .long   0x399191a8,0x399191a8
180         .long   0x319595a4,0x319595a4
181         .long   0xd3e4e437,0xd3e4e437
182         .long   0xf279798b,0xf279798b
183         .long   0xd5e7e732,0xd5e7e732
184         .long   0x8bc8c843,0x8bc8c843
185         .long   0x6e373759,0x6e373759
186         .long   0xda6d6db7,0xda6d6db7
187         .long   0x018d8d8c,0x018d8d8c
188         .long   0xb1d5d564,0xb1d5d564
189         .long   0x9c4e4ed2,0x9c4e4ed2
190         .long   0x49a9a9e0,0x49a9a9e0
191         .long   0xd86c6cb4,0xd86c6cb4
192         .long   0xac5656fa,0xac5656fa
193         .long   0xf3f4f407,0xf3f4f407
194         .long   0xcfeaea25,0xcfeaea25
195         .long   0xca6565af,0xca6565af
196         .long   0xf47a7a8e,0xf47a7a8e
197         .long   0x47aeaee9,0x47aeaee9
198         .long   0x10080818,0x10080818
199         .long   0x6fbabad5,0x6fbabad5
200         .long   0xf0787888,0xf0787888
201         .long   0x4a25256f,0x4a25256f
202         .long   0x5c2e2e72,0x5c2e2e72
203         .long   0x381c1c24,0x381c1c24
204         .long   0x57a6a6f1,0x57a6a6f1
205         .long   0x73b4b4c7,0x73b4b4c7
206         .long   0x97c6c651,0x97c6c651
207         .long   0xcbe8e823,0xcbe8e823
208         .long   0xa1dddd7c,0xa1dddd7c
209         .long   0xe874749c,0xe874749c
210         .long   0x3e1f1f21,0x3e1f1f21
211         .long   0x964b4bdd,0x964b4bdd
212         .long   0x61bdbddc,0x61bdbddc
213         .long   0x0d8b8b86,0x0d8b8b86
214         .long   0x0f8a8a85,0x0f8a8a85
215         .long   0xe0707090,0xe0707090
216         .long   0x7c3e3e42,0x7c3e3e42
217         .long   0x71b5b5c4,0x71b5b5c4
218         .long   0xcc6666aa,0xcc6666aa
219         .long   0x904848d8,0x904848d8
220         .long   0x06030305,0x06030305
221         .long   0xf7f6f601,0xf7f6f601
222         .long   0x1c0e0e12,0x1c0e0e12
223         .long   0xc26161a3,0xc26161a3
224         .long   0x6a35355f,0x6a35355f
225         .long   0xae5757f9,0xae5757f9
226         .long   0x69b9b9d0,0x69b9b9d0
227         .long   0x17868691,0x17868691
228         .long   0x99c1c158,0x99c1c158
229         .long   0x3a1d1d27,0x3a1d1d27
230         .long   0x279e9eb9,0x279e9eb9
231         .long   0xd9e1e138,0xd9e1e138
232         .long   0xebf8f813,0xebf8f813
233         .long   0x2b9898b3,0x2b9898b3
234         .long   0x22111133,0x22111133
235         .long   0xd26969bb,0xd26969bb
236         .long   0xa9d9d970,0xa9d9d970
237         .long   0x078e8e89,0x078e8e89
238         .long   0x339494a7,0x339494a7
239         .long   0x2d9b9bb6,0x2d9b9bb6
240         .long   0x3c1e1e22,0x3c1e1e22
241         .long   0x15878792,0x15878792
242         .long   0xc9e9e920,0xc9e9e920
243         .long   0x87cece49,0x87cece49
244         .long   0xaa5555ff,0xaa5555ff
245         .long   0x50282878,0x50282878
246         .long   0xa5dfdf7a,0xa5dfdf7a
247         .long   0x038c8c8f,0x038c8c8f
248         .long   0x59a1a1f8,0x59a1a1f8
249         .long   0x09898980,0x09898980
250         .long   0x1a0d0d17,0x1a0d0d17
251         .long   0x65bfbfda,0x65bfbfda
252         .long   0xd7e6e631,0xd7e6e631
253         .long   0x844242c6,0x844242c6
254         .long   0xd06868b8,0xd06868b8
255         .long   0x824141c3,0x824141c3
256         .long   0x299999b0,0x299999b0
257         .long   0x5a2d2d77,0x5a2d2d77
258         .long   0x1e0f0f11,0x1e0f0f11
259         .long   0x7bb0b0cb,0x7bb0b0cb
260         .long   0xa85454fc,0xa85454fc
261         .long   0x6dbbbbd6,0x6dbbbbd6
262         .long   0x2c16163a,0x2c16163a
263         .byte   0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5
264         .byte   0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76
265         .byte   0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0
266         .byte   0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0
267         .byte   0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc
268         .byte   0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15
269         .byte   0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a
270         .byte   0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75
271         .byte   0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0
272         .byte   0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84
273         .byte   0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b
274         .byte   0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf
275         .byte   0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85
276         .byte   0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8
277         .byte   0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5
278         .byte   0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2
279         .byte   0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17
280         .byte   0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73
281         .byte   0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88
282         .byte   0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb
283         .byte   0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c
284         .byte   0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79
285         .byte   0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9
286         .byte   0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08
287         .byte   0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6
288         .byte   0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a
289         .byte   0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e
290         .byte   0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e
291         .byte   0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94
292         .byte   0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf
293         .byte   0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68
294         .byte   0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
295 .type   AES_Te,#object
296 .size   AES_Te,(.-AES_Te)
298 .align  64
299 .skip   16
300 _sparcv9_AES_encrypt:
301         save    %sp,-192-16,%sp
302         stx     %i7,[%sp+2047+192+0]    ! off-load return address
303         ld      [%i5+240],%i7
304         ld      [%i5+0],%l4
305         ld      [%i5+4],%l5                     !
306         ld      [%i5+8],%l6
307         srl     %i7,1,%i7
308         xor     %l4,%i0,%i0
309         ld      [%i5+12],%l7
310         srl     %i0,21,%l0
311         xor     %l5,%i1,%i1
312         ld      [%i5+16],%l4
313         srl     %i1,13,%o0                      !
314         xor     %l6,%i2,%i2
315         ld      [%i5+20],%l5
316         xor     %l7,%i3,%i3
317         ld      [%i5+24],%l6
318         and     %l0,2040,%l0
319         ld      [%i5+28],%l7
320         nop
321 .Lenc_loop:
322         srl     %i2,5,%o1                       !
323         and     %o0,2040,%o0
324         ldx     [%i4+%l0],%l0
325         sll     %i3,3,%o2
326         and     %o1,2040,%o1
327         ldx     [%i4+%o0],%o0
328         srl     %i1,21,%l1
329         and     %o2,2040,%o2
330         ldx     [%i4+%o1],%o1           !
331         srl     %i2,13,%o3
332         and     %l1,2040,%l1
333         ldx     [%i4+%o2],%o2
334         srl     %i3,5,%o4
335         and     %o3,2040,%o3
336         ldx     [%i4+%l1],%l1
337         
338         sll     %i0,3,%o5                       !
339         and     %o4,2040,%o4
340         ldx     [%i4+%o3],%o3
341         srl     %i2,21,%l2
342         and     %o5,2040,%o5
343         ldx     [%i4+%o4],%o4
344         srl     %i3,13,%o7
345         and     %l2,2040,%l2
346         ldx     [%i4+%o5],%o5           !
347         srl     %i0,5,%g1
348         and     %o7,2040,%o7
349         ldx     [%i4+%l2],%l2
350         sll     %i1,3,%g2
351         and     %g1,2040,%g1
352         ldx     [%i4+%o7],%o7
353         
354         srl     %i3,21,%l3                      !
355         and     %g2,2040,%g2
356         ldx     [%i4+%g1],%g1
357         srl     %i0,13,%g3
358         and     %l3,2040,%l3
359         ldx     [%i4+%g2],%g2
360         srl     %i1,5,%g4
361         and     %g3,2040,%g3
362         ldx     [%i4+%l3],%l3           !
363         sll     %i2,3,%g5
364         and     %g4,2040,%g4
365         ldx     [%i4+%g3],%g3
366         and     %g5,2040,%g5
367         add     %i5,32,%i5
368         ldx     [%i4+%g4],%g4
369         
370         subcc   %i7,1,%i7               !
371         ldx     [%i4+%g5],%g5
372         bz,a,pn %icc,.Lenc_last
373         add     %i4,2048,%i7
375                 srlx    %o0,8,%o0
376                 xor     %l0,%l4,%l4
377         ld      [%i5+0],%i0
378         
379                 srlx    %o1,16,%o1              !
380                 xor     %o0,%l4,%l4
381         ld      [%i5+4],%i1
382                 srlx    %o2,24,%o2
383                 xor     %o1,%l4,%l4
384         ld      [%i5+8],%i2
385                 srlx    %o3,8,%o3
386                 xor     %o2,%l4,%l4
387         ld      [%i5+12],%i3                    !
388                 srlx    %o4,16,%o4
389                 xor     %l1,%l5,%l5
390         
391                 srlx    %o5,24,%o5
392                 xor     %o3,%l5,%l5
393                 srlx    %o7,8,%o7
394                 xor     %o4,%l5,%l5
395                 srlx    %g1,16,%g1      !
396                 xor     %o5,%l5,%l5
397                 srlx    %g2,24,%g2
398                 xor     %l2,%l6,%l6
399                 srlx    %g3,8,%g3
400                 xor     %o7,%l6,%l6
401                 srlx    %g4,16,%g4
402                 xor     %g1,%l6,%l6
403                 srlx    %g5,24,%g5      !
404                 xor     %g2,%l6,%l6
405                 xor     %l3,%g4,%g4
406                 xor     %g3,%l7,%l7
407         srl     %l4,21,%l0
408                 xor     %g4,%l7,%l7
409         srl     %l5,13,%o0
410                 xor     %g5,%l7,%l7
412         and     %l0,2040,%l0            !
413         srl     %l6,5,%o1
414         and     %o0,2040,%o0
415         ldx     [%i4+%l0],%l0
416         sll     %l7,3,%o2
417         and     %o1,2040,%o1
418         ldx     [%i4+%o0],%o0
419         
420         srl     %l5,21,%l1                      !
421         and     %o2,2040,%o2
422         ldx     [%i4+%o1],%o1
423         srl     %l6,13,%o3
424         and     %l1,2040,%l1
425         ldx     [%i4+%o2],%o2
426         srl     %l7,5,%o4
427         and     %o3,2040,%o3
428         ldx     [%i4+%l1],%l1           !
429         sll     %l4,3,%o5
430         and     %o4,2040,%o4
431         ldx     [%i4+%o3],%o3
432         srl     %l6,21,%l2
433         and     %o5,2040,%o5
434         ldx     [%i4+%o4],%o4
435         
436         srl     %l7,13,%o7                      !
437         and     %l2,2040,%l2
438         ldx     [%i4+%o5],%o5
439         srl     %l4,5,%g1
440         and     %o7,2040,%o7
441         ldx     [%i4+%l2],%l2
442         sll     %l5,3,%g2
443         and     %g1,2040,%g1
444         ldx     [%i4+%o7],%o7           !
445         srl     %l7,21,%l3
446         and     %g2,2040,%g2
447         ldx     [%i4+%g1],%g1
448         srl     %l4,13,%g3
449         and     %l3,2040,%l3
450         ldx     [%i4+%g2],%g2
451         
452         srl     %l5,5,%g4                       !
453         and     %g3,2040,%g3
454         ldx     [%i4+%l3],%l3
455         sll     %l6,3,%g5
456         and     %g4,2040,%g4
457         ldx     [%i4+%g3],%g3
458                 srlx    %o0,8,%o0
459         and     %g5,2040,%g5
460         ldx     [%i4+%g4],%g4           !
462                 srlx    %o1,16,%o1
463                 xor     %l0,%i0,%i0
464         ldx     [%i4+%g5],%g5
465                 srlx    %o2,24,%o2
466                 xor     %o0,%i0,%i0
467         ld      [%i5+16],%l4
468         
469                 srlx    %o3,8,%o3               !
470                 xor     %o1,%i0,%i0
471         ld      [%i5+20],%l5
472                 srlx    %o4,16,%o4
473                 xor     %o2,%i0,%i0
474         ld      [%i5+24],%l6
475                 srlx    %o5,24,%o5
476                 xor     %l1,%i1,%i1
477         ld      [%i5+28],%l7                    !
478                 srlx    %o7,8,%o7
479                 xor     %o3,%i1,%i1
480         ldx     [%i4+2048+0],%g0                ! prefetch te4
481                 srlx    %g1,16,%g1
482                 xor     %o4,%i1,%i1
483         ldx     [%i4+2048+32],%g0               ! prefetch te4
484                 srlx    %g2,24,%g2
485                 xor     %o5,%i1,%i1
486         ldx     [%i4+2048+64],%g0               ! prefetch te4
487                 srlx    %g3,8,%g3
488                 xor     %l2,%i2,%i2
489         ldx     [%i4+2048+96],%g0               ! prefetch te4
490                 srlx    %g4,16,%g4      !
491                 xor     %o7,%i2,%i2
492         ldx     [%i4+2048+128],%g0              ! prefetch te4
493                 srlx    %g5,24,%g5
494                 xor     %g1,%i2,%i2
495         ldx     [%i4+2048+160],%g0              ! prefetch te4
496         srl     %i0,21,%l0
497                 xor     %g2,%i2,%i2
498         ldx     [%i4+2048+192],%g0              ! prefetch te4
499                 xor     %l3,%g4,%g4
500                 xor     %g3,%i3,%i3
501         ldx     [%i4+2048+224],%g0              ! prefetch te4
502         srl     %i1,13,%o0                      !
503                 xor     %g4,%i3,%i3
504                 xor     %g5,%i3,%i3
505         ba      .Lenc_loop
506         and     %l0,2040,%l0
508 .align  32
509 .Lenc_last:
510                 srlx    %o0,8,%o0               !
511                 xor     %l0,%l4,%l4
512         ld      [%i5+0],%i0
513                 srlx    %o1,16,%o1
514                 xor     %o0,%l4,%l4
515         ld      [%i5+4],%i1
516                 srlx    %o2,24,%o2
517                 xor     %o1,%l4,%l4
518         ld      [%i5+8],%i2                     !
519                 srlx    %o3,8,%o3
520                 xor     %o2,%l4,%l4
521         ld      [%i5+12],%i3
522                 srlx    %o4,16,%o4
523                 xor     %l1,%l5,%l5
524                 srlx    %o5,24,%o5
525                 xor     %o3,%l5,%l5
526                 srlx    %o7,8,%o7               !
527                 xor     %o4,%l5,%l5
528                 srlx    %g1,16,%g1
529                 xor     %o5,%l5,%l5
530                 srlx    %g2,24,%g2
531                 xor     %l2,%l6,%l6
532                 srlx    %g3,8,%g3
533                 xor     %o7,%l6,%l6
534                 srlx    %g4,16,%g4      !
535                 xor     %g1,%l6,%l6
536                 srlx    %g5,24,%g5
537                 xor     %g2,%l6,%l6
538                 xor     %l3,%g4,%g4
539                 xor     %g3,%l7,%l7
540         srl     %l4,24,%l0
541                 xor     %g4,%l7,%l7
542         srl     %l5,16,%o0                      !
543                 xor     %g5,%l7,%l7
545         srl     %l6,8,%o1
546         and     %o0,255,%o0
547         ldub    [%i7+%l0],%l0
548         srl     %l5,24,%l1
549         and     %o1,255,%o1
550         ldub    [%i7+%o0],%o0
551         srl     %l6,16,%o3                      !
552         and     %l7,255,%o2
553         ldub    [%i7+%o1],%o1
554         ldub    [%i7+%o2],%o2
555         srl     %l7,8,%o4
556         and     %o3,255,%o3
557         ldub    [%i7+%l1],%l1
558         
559         srl     %l6,24,%l2                      !
560         and     %o4,255,%o4
561         ldub    [%i7+%o3],%o3
562         srl     %l7,16,%o7
563         and     %l4,255,%o5
564         ldub    [%i7+%o4],%o4
565         ldub    [%i7+%o5],%o5
566         
567         srl     %l4,8,%g1                       !
568         and     %o7,255,%o7
569         ldub    [%i7+%l2],%l2
570         srl     %l7,24,%l3
571         and     %g1,255,%g1
572         ldub    [%i7+%o7],%o7
573         srl     %l4,16,%g3
574         and     %l5,255,%g2
575         ldub    [%i7+%g1],%g1           !
576         srl     %l5,8,%g4
577         and     %g3,255,%g3
578         ldub    [%i7+%g2],%g2
579         ldub    [%i7+%l3],%l3
580         and     %g4,255,%g4
581         ldub    [%i7+%g3],%g3
582         and     %l6,255,%g5
583         ldub    [%i7+%g4],%g4           !
585                 sll     %l0,24,%l0
586                 xor     %o2,%i0,%i0
587         ldub    [%i7+%g5],%g5
588                 sll     %o0,16,%o0
589                 xor     %l0,%i0,%i0
590         ldx     [%sp+2047+192+0],%i7    ! restore return address
591         
592                 sll     %o1,8,%o1               !
593                 xor     %o0,%i0,%i0
594                 sll     %l1,24,%l1
595                 xor     %o1,%i0,%i0
596                 sll     %o3,16,%o3
597                 xor     %o5,%i1,%i1
598                 sll     %o4,8,%o4
599                 xor     %l1,%i1,%i1
600                 sll     %l2,24,%l2              !
601                 xor     %o3,%i1,%i1
602                 sll     %o7,16,%o7
603                 xor     %g2,%i2,%i2
604                 sll     %g1,8,%g1
605                 xor     %o4,%i1,%i1
606                 sll     %l3,24,%l3
607                 xor     %l2,%i2,%i2
608                 sll     %g3,16,%g3      !
609                 xor     %o7,%i2,%i2
610                 sll     %g4,8,%g4
611                 xor     %g1,%i2,%i2
612                 xor     %l3,%g4,%g4
613                 xor     %g3,%i3,%i3
614                 xor     %g4,%i3,%i3
615                 xor     %g5,%i3,%i3
617         ret
618         restore
619 .type   _sparcv9_AES_encrypt,#function
620 .size   _sparcv9_AES_encrypt,(.-_sparcv9_AES_encrypt)
622 .align  32
623 .globl  AES_encrypt
624 AES_encrypt:
625         or      %o0,%o1,%g1
626         andcc   %g1,3,%g0
627         bnz,pn  %xcc,.Lunaligned_enc
628         save    %sp,-192,%sp
630         ld      [%i0+0],%o0
631         ld      [%i0+4],%o1
632         ld      [%i0+8],%o2
633         ld      [%i0+12],%o3
635 1:      call    .+8
636         add     %o7,AES_Te-1b,%o4
637         call    _sparcv9_AES_encrypt
638         mov     %i2,%o5
640         st      %o0,[%i1+0]
641         st      %o1,[%i1+4]
642         st      %o2,[%i1+8]
643         st      %o3,[%i1+12]
645         ret
646         restore
648 .align  32
649 .Lunaligned_enc:
650         ldub    [%i0+0],%l0
651         ldub    [%i0+1],%l1
652         ldub    [%i0+2],%l2
654         sll     %l0,24,%l0
655         ldub    [%i0+3],%l3
656         sll     %l1,16,%l1
657         ldub    [%i0+4],%l4
658         sll     %l2,8,%l2
659         or      %l1,%l0,%l0
660         ldub    [%i0+5],%l5
661         sll     %l4,24,%l4
662         or      %l3,%l2,%l2
663         ldub    [%i0+6],%l6
664         sll     %l5,16,%l5
665         or      %l0,%l2,%o0
666         ldub    [%i0+7],%l7
668         sll     %l6,8,%l6
669         or      %l5,%l4,%l4
670         ldub    [%i0+8],%l0
671         or      %l7,%l6,%l6
672         ldub    [%i0+9],%l1
673         or      %l4,%l6,%o1
674         ldub    [%i0+10],%l2
676         sll     %l0,24,%l0
677         ldub    [%i0+11],%l3
678         sll     %l1,16,%l1
679         ldub    [%i0+12],%l4
680         sll     %l2,8,%l2
681         or      %l1,%l0,%l0
682         ldub    [%i0+13],%l5
683         sll     %l4,24,%l4
684         or      %l3,%l2,%l2
685         ldub    [%i0+14],%l6
686         sll     %l5,16,%l5
687         or      %l0,%l2,%o2
688         ldub    [%i0+15],%l7
690         sll     %l6,8,%l6
691         or      %l5,%l4,%l4
692         or      %l7,%l6,%l6
693         or      %l4,%l6,%o3
695 1:      call    .+8
696         add     %o7,AES_Te-1b,%o4
697         call    _sparcv9_AES_encrypt
698         mov     %i2,%o5
700         srl     %o0,24,%l0
701         srl     %o0,16,%l1
702         stb     %l0,[%i1+0]
703         srl     %o0,8,%l2
704         stb     %l1,[%i1+1]
705         stb     %l2,[%i1+2]
706         srl     %o1,24,%l4
707         stb     %o0,[%i1+3]
709         srl     %o1,16,%l5
710         stb     %l4,[%i1+4]
711         srl     %o1,8,%l6
712         stb     %l5,[%i1+5]
713         stb     %l6,[%i1+6]
714         srl     %o2,24,%l0
715         stb     %o1,[%i1+7]
717         srl     %o2,16,%l1
718         stb     %l0,[%i1+8]
719         srl     %o2,8,%l2
720         stb     %l1,[%i1+9]
721         stb     %l2,[%i1+10]
722         srl     %o3,24,%l4
723         stb     %o2,[%i1+11]
725         srl     %o3,16,%l5
726         stb     %l4,[%i1+12]
727         srl     %o3,8,%l6
728         stb     %l5,[%i1+13]
729         stb     %l6,[%i1+14]
730         stb     %o3,[%i1+15]
732         ret
733         restore
734 .type   AES_encrypt,#function
735 .size   AES_encrypt,(.-AES_encrypt)
737 .align  256
738 AES_Td:
739         .long   0x51f4a750,0x51f4a750
740         .long   0x7e416553,0x7e416553
741         .long   0x1a17a4c3,0x1a17a4c3
742         .long   0x3a275e96,0x3a275e96
743         .long   0x3bab6bcb,0x3bab6bcb
744         .long   0x1f9d45f1,0x1f9d45f1
745         .long   0xacfa58ab,0xacfa58ab
746         .long   0x4be30393,0x4be30393
747         .long   0x2030fa55,0x2030fa55
748         .long   0xad766df6,0xad766df6
749         .long   0x88cc7691,0x88cc7691
750         .long   0xf5024c25,0xf5024c25
751         .long   0x4fe5d7fc,0x4fe5d7fc
752         .long   0xc52acbd7,0xc52acbd7
753         .long   0x26354480,0x26354480
754         .long   0xb562a38f,0xb562a38f
755         .long   0xdeb15a49,0xdeb15a49
756         .long   0x25ba1b67,0x25ba1b67
757         .long   0x45ea0e98,0x45ea0e98
758         .long   0x5dfec0e1,0x5dfec0e1
759         .long   0xc32f7502,0xc32f7502
760         .long   0x814cf012,0x814cf012
761         .long   0x8d4697a3,0x8d4697a3
762         .long   0x6bd3f9c6,0x6bd3f9c6
763         .long   0x038f5fe7,0x038f5fe7
764         .long   0x15929c95,0x15929c95
765         .long   0xbf6d7aeb,0xbf6d7aeb
766         .long   0x955259da,0x955259da
767         .long   0xd4be832d,0xd4be832d
768         .long   0x587421d3,0x587421d3
769         .long   0x49e06929,0x49e06929
770         .long   0x8ec9c844,0x8ec9c844
771         .long   0x75c2896a,0x75c2896a
772         .long   0xf48e7978,0xf48e7978
773         .long   0x99583e6b,0x99583e6b
774         .long   0x27b971dd,0x27b971dd
775         .long   0xbee14fb6,0xbee14fb6
776         .long   0xf088ad17,0xf088ad17
777         .long   0xc920ac66,0xc920ac66
778         .long   0x7dce3ab4,0x7dce3ab4
779         .long   0x63df4a18,0x63df4a18
780         .long   0xe51a3182,0xe51a3182
781         .long   0x97513360,0x97513360
782         .long   0x62537f45,0x62537f45
783         .long   0xb16477e0,0xb16477e0
784         .long   0xbb6bae84,0xbb6bae84
785         .long   0xfe81a01c,0xfe81a01c
786         .long   0xf9082b94,0xf9082b94
787         .long   0x70486858,0x70486858
788         .long   0x8f45fd19,0x8f45fd19
789         .long   0x94de6c87,0x94de6c87
790         .long   0x527bf8b7,0x527bf8b7
791         .long   0xab73d323,0xab73d323
792         .long   0x724b02e2,0x724b02e2
793         .long   0xe31f8f57,0xe31f8f57
794         .long   0x6655ab2a,0x6655ab2a
795         .long   0xb2eb2807,0xb2eb2807
796         .long   0x2fb5c203,0x2fb5c203
797         .long   0x86c57b9a,0x86c57b9a
798         .long   0xd33708a5,0xd33708a5
799         .long   0x302887f2,0x302887f2
800         .long   0x23bfa5b2,0x23bfa5b2
801         .long   0x02036aba,0x02036aba
802         .long   0xed16825c,0xed16825c
803         .long   0x8acf1c2b,0x8acf1c2b
804         .long   0xa779b492,0xa779b492
805         .long   0xf307f2f0,0xf307f2f0
806         .long   0x4e69e2a1,0x4e69e2a1
807         .long   0x65daf4cd,0x65daf4cd
808         .long   0x0605bed5,0x0605bed5
809         .long   0xd134621f,0xd134621f
810         .long   0xc4a6fe8a,0xc4a6fe8a
811         .long   0x342e539d,0x342e539d
812         .long   0xa2f355a0,0xa2f355a0
813         .long   0x058ae132,0x058ae132
814         .long   0xa4f6eb75,0xa4f6eb75
815         .long   0x0b83ec39,0x0b83ec39
816         .long   0x4060efaa,0x4060efaa
817         .long   0x5e719f06,0x5e719f06
818         .long   0xbd6e1051,0xbd6e1051
819         .long   0x3e218af9,0x3e218af9
820         .long   0x96dd063d,0x96dd063d
821         .long   0xdd3e05ae,0xdd3e05ae
822         .long   0x4de6bd46,0x4de6bd46
823         .long   0x91548db5,0x91548db5
824         .long   0x71c45d05,0x71c45d05
825         .long   0x0406d46f,0x0406d46f
826         .long   0x605015ff,0x605015ff
827         .long   0x1998fb24,0x1998fb24
828         .long   0xd6bde997,0xd6bde997
829         .long   0x894043cc,0x894043cc
830         .long   0x67d99e77,0x67d99e77
831         .long   0xb0e842bd,0xb0e842bd
832         .long   0x07898b88,0x07898b88
833         .long   0xe7195b38,0xe7195b38
834         .long   0x79c8eedb,0x79c8eedb
835         .long   0xa17c0a47,0xa17c0a47
836         .long   0x7c420fe9,0x7c420fe9
837         .long   0xf8841ec9,0xf8841ec9
838         .long   0x00000000,0x00000000
839         .long   0x09808683,0x09808683
840         .long   0x322bed48,0x322bed48
841         .long   0x1e1170ac,0x1e1170ac
842         .long   0x6c5a724e,0x6c5a724e
843         .long   0xfd0efffb,0xfd0efffb
844         .long   0x0f853856,0x0f853856
845         .long   0x3daed51e,0x3daed51e
846         .long   0x362d3927,0x362d3927
847         .long   0x0a0fd964,0x0a0fd964
848         .long   0x685ca621,0x685ca621
849         .long   0x9b5b54d1,0x9b5b54d1
850         .long   0x24362e3a,0x24362e3a
851         .long   0x0c0a67b1,0x0c0a67b1
852         .long   0x9357e70f,0x9357e70f
853         .long   0xb4ee96d2,0xb4ee96d2
854         .long   0x1b9b919e,0x1b9b919e
855         .long   0x80c0c54f,0x80c0c54f
856         .long   0x61dc20a2,0x61dc20a2
857         .long   0x5a774b69,0x5a774b69
858         .long   0x1c121a16,0x1c121a16
859         .long   0xe293ba0a,0xe293ba0a
860         .long   0xc0a02ae5,0xc0a02ae5
861         .long   0x3c22e043,0x3c22e043
862         .long   0x121b171d,0x121b171d
863         .long   0x0e090d0b,0x0e090d0b
864         .long   0xf28bc7ad,0xf28bc7ad
865         .long   0x2db6a8b9,0x2db6a8b9
866         .long   0x141ea9c8,0x141ea9c8
867         .long   0x57f11985,0x57f11985
868         .long   0xaf75074c,0xaf75074c
869         .long   0xee99ddbb,0xee99ddbb
870         .long   0xa37f60fd,0xa37f60fd
871         .long   0xf701269f,0xf701269f
872         .long   0x5c72f5bc,0x5c72f5bc
873         .long   0x44663bc5,0x44663bc5
874         .long   0x5bfb7e34,0x5bfb7e34
875         .long   0x8b432976,0x8b432976
876         .long   0xcb23c6dc,0xcb23c6dc
877         .long   0xb6edfc68,0xb6edfc68
878         .long   0xb8e4f163,0xb8e4f163
879         .long   0xd731dcca,0xd731dcca
880         .long   0x42638510,0x42638510
881         .long   0x13972240,0x13972240
882         .long   0x84c61120,0x84c61120
883         .long   0x854a247d,0x854a247d
884         .long   0xd2bb3df8,0xd2bb3df8
885         .long   0xaef93211,0xaef93211
886         .long   0xc729a16d,0xc729a16d
887         .long   0x1d9e2f4b,0x1d9e2f4b
888         .long   0xdcb230f3,0xdcb230f3
889         .long   0x0d8652ec,0x0d8652ec
890         .long   0x77c1e3d0,0x77c1e3d0
891         .long   0x2bb3166c,0x2bb3166c
892         .long   0xa970b999,0xa970b999
893         .long   0x119448fa,0x119448fa
894         .long   0x47e96422,0x47e96422
895         .long   0xa8fc8cc4,0xa8fc8cc4
896         .long   0xa0f03f1a,0xa0f03f1a
897         .long   0x567d2cd8,0x567d2cd8
898         .long   0x223390ef,0x223390ef
899         .long   0x87494ec7,0x87494ec7
900         .long   0xd938d1c1,0xd938d1c1
901         .long   0x8ccaa2fe,0x8ccaa2fe
902         .long   0x98d40b36,0x98d40b36
903         .long   0xa6f581cf,0xa6f581cf
904         .long   0xa57ade28,0xa57ade28
905         .long   0xdab78e26,0xdab78e26
906         .long   0x3fadbfa4,0x3fadbfa4
907         .long   0x2c3a9de4,0x2c3a9de4
908         .long   0x5078920d,0x5078920d
909         .long   0x6a5fcc9b,0x6a5fcc9b
910         .long   0x547e4662,0x547e4662
911         .long   0xf68d13c2,0xf68d13c2
912         .long   0x90d8b8e8,0x90d8b8e8
913         .long   0x2e39f75e,0x2e39f75e
914         .long   0x82c3aff5,0x82c3aff5
915         .long   0x9f5d80be,0x9f5d80be
916         .long   0x69d0937c,0x69d0937c
917         .long   0x6fd52da9,0x6fd52da9
918         .long   0xcf2512b3,0xcf2512b3
919         .long   0xc8ac993b,0xc8ac993b
920         .long   0x10187da7,0x10187da7
921         .long   0xe89c636e,0xe89c636e
922         .long   0xdb3bbb7b,0xdb3bbb7b
923         .long   0xcd267809,0xcd267809
924         .long   0x6e5918f4,0x6e5918f4
925         .long   0xec9ab701,0xec9ab701
926         .long   0x834f9aa8,0x834f9aa8
927         .long   0xe6956e65,0xe6956e65
928         .long   0xaaffe67e,0xaaffe67e
929         .long   0x21bccf08,0x21bccf08
930         .long   0xef15e8e6,0xef15e8e6
931         .long   0xbae79bd9,0xbae79bd9
932         .long   0x4a6f36ce,0x4a6f36ce
933         .long   0xea9f09d4,0xea9f09d4
934         .long   0x29b07cd6,0x29b07cd6
935         .long   0x31a4b2af,0x31a4b2af
936         .long   0x2a3f2331,0x2a3f2331
937         .long   0xc6a59430,0xc6a59430
938         .long   0x35a266c0,0x35a266c0
939         .long   0x744ebc37,0x744ebc37
940         .long   0xfc82caa6,0xfc82caa6
941         .long   0xe090d0b0,0xe090d0b0
942         .long   0x33a7d815,0x33a7d815
943         .long   0xf104984a,0xf104984a
944         .long   0x41ecdaf7,0x41ecdaf7
945         .long   0x7fcd500e,0x7fcd500e
946         .long   0x1791f62f,0x1791f62f
947         .long   0x764dd68d,0x764dd68d
948         .long   0x43efb04d,0x43efb04d
949         .long   0xccaa4d54,0xccaa4d54
950         .long   0xe49604df,0xe49604df
951         .long   0x9ed1b5e3,0x9ed1b5e3
952         .long   0x4c6a881b,0x4c6a881b
953         .long   0xc12c1fb8,0xc12c1fb8
954         .long   0x4665517f,0x4665517f
955         .long   0x9d5eea04,0x9d5eea04
956         .long   0x018c355d,0x018c355d
957         .long   0xfa877473,0xfa877473
958         .long   0xfb0b412e,0xfb0b412e
959         .long   0xb3671d5a,0xb3671d5a
960         .long   0x92dbd252,0x92dbd252
961         .long   0xe9105633,0xe9105633
962         .long   0x6dd64713,0x6dd64713
963         .long   0x9ad7618c,0x9ad7618c
964         .long   0x37a10c7a,0x37a10c7a
965         .long   0x59f8148e,0x59f8148e
966         .long   0xeb133c89,0xeb133c89
967         .long   0xcea927ee,0xcea927ee
968         .long   0xb761c935,0xb761c935
969         .long   0xe11ce5ed,0xe11ce5ed
970         .long   0x7a47b13c,0x7a47b13c
971         .long   0x9cd2df59,0x9cd2df59
972         .long   0x55f2733f,0x55f2733f
973         .long   0x1814ce79,0x1814ce79
974         .long   0x73c737bf,0x73c737bf
975         .long   0x53f7cdea,0x53f7cdea
976         .long   0x5ffdaa5b,0x5ffdaa5b
977         .long   0xdf3d6f14,0xdf3d6f14
978         .long   0x7844db86,0x7844db86
979         .long   0xcaaff381,0xcaaff381
980         .long   0xb968c43e,0xb968c43e
981         .long   0x3824342c,0x3824342c
982         .long   0xc2a3405f,0xc2a3405f
983         .long   0x161dc372,0x161dc372
984         .long   0xbce2250c,0xbce2250c
985         .long   0x283c498b,0x283c498b
986         .long   0xff0d9541,0xff0d9541
987         .long   0x39a80171,0x39a80171
988         .long   0x080cb3de,0x080cb3de
989         .long   0xd8b4e49c,0xd8b4e49c
990         .long   0x6456c190,0x6456c190
991         .long   0x7bcb8461,0x7bcb8461
992         .long   0xd532b670,0xd532b670
993         .long   0x486c5c74,0x486c5c74
994         .long   0xd0b85742,0xd0b85742
995         .byte   0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38
996         .byte   0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb
997         .byte   0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87
998         .byte   0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb
999         .byte   0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d
1000         .byte   0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e
1001         .byte   0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2
1002         .byte   0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25
1003         .byte   0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16
1004         .byte   0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92
1005         .byte   0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda
1006         .byte   0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84
1007         .byte   0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a
1008         .byte   0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06
1009         .byte   0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02
1010         .byte   0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b
1011         .byte   0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea
1012         .byte   0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73
1013         .byte   0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85
1014         .byte   0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e
1015         .byte   0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89
1016         .byte   0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b
1017         .byte   0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20
1018         .byte   0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4
1019         .byte   0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31
1020         .byte   0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f
1021         .byte   0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d
1022         .byte   0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef
1023         .byte   0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0
1024         .byte   0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61
1025         .byte   0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26
1026         .byte   0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
1027 .type   AES_Td,#object
1028 .size   AES_Td,(.-AES_Td)
1030 .align  64
1031 .skip   16
1032 _sparcv9_AES_decrypt:
1033         save    %sp,-192-16,%sp
1034         stx     %i7,[%sp+2047+192+0]    ! off-load return address
1035         ld      [%i5+240],%i7
1036         ld      [%i5+0],%l4
1037         ld      [%i5+4],%l5                     !
1038         ld      [%i5+8],%l6
1039         ld      [%i5+12],%l7
1040         srl     %i7,1,%i7
1041         xor     %l4,%i0,%i0
1042         ld      [%i5+16],%l4
1043         xor     %l5,%i1,%i1
1044         ld      [%i5+20],%l5
1045         srl     %i0,21,%l0                      !
1046         xor     %l6,%i2,%i2
1047         ld      [%i5+24],%l6
1048         xor     %l7,%i3,%i3
1049         and     %l0,2040,%l0
1050         ld      [%i5+28],%l7
1051         srl     %i3,13,%o0
1052         nop
1053 .Ldec_loop:
1054         srl     %i2,5,%o1                       !
1055         and     %o0,2040,%o0
1056         ldx     [%i4+%l0],%l0
1057         sll     %i1,3,%o2
1058         and     %o1,2040,%o1
1059         ldx     [%i4+%o0],%o0
1060         srl     %i1,21,%l1
1061         and     %o2,2040,%o2
1062         ldx     [%i4+%o1],%o1           !
1063         srl     %i0,13,%o3
1064         and     %l1,2040,%l1
1065         ldx     [%i4+%o2],%o2
1066         srl     %i3,5,%o4
1067         and     %o3,2040,%o3
1068         ldx     [%i4+%l1],%l1
1069         
1070         sll     %i2,3,%o5                       !
1071         and     %o4,2040,%o4
1072         ldx     [%i4+%o3],%o3
1073         srl     %i2,21,%l2
1074         and     %o5,2040,%o5
1075         ldx     [%i4+%o4],%o4
1076         srl     %i1,13,%o7
1077         and     %l2,2040,%l2
1078         ldx     [%i4+%o5],%o5           !
1079         srl     %i0,5,%g1
1080         and     %o7,2040,%o7
1081         ldx     [%i4+%l2],%l2
1082         sll     %i3,3,%g2
1083         and     %g1,2040,%g1
1084         ldx     [%i4+%o7],%o7
1085         
1086         srl     %i3,21,%l3                      !
1087         and     %g2,2040,%g2
1088         ldx     [%i4+%g1],%g1
1089         srl     %i2,13,%g3
1090         and     %l3,2040,%l3
1091         ldx     [%i4+%g2],%g2
1092         srl     %i1,5,%g4
1093         and     %g3,2040,%g3
1094         ldx     [%i4+%l3],%l3           !
1095         sll     %i0,3,%g5
1096         and     %g4,2040,%g4
1097         ldx     [%i4+%g3],%g3
1098         and     %g5,2040,%g5
1099         add     %i5,32,%i5
1100         ldx     [%i4+%g4],%g4
1101         
1102         subcc   %i7,1,%i7               !
1103         ldx     [%i4+%g5],%g5
1104         bz,a,pn %icc,.Ldec_last
1105         add     %i4,2048,%i7
1107                 srlx    %o0,8,%o0
1108                 xor     %l0,%l4,%l4
1109         ld      [%i5+0],%i0
1110         
1111                 srlx    %o1,16,%o1              !
1112                 xor     %o0,%l4,%l4
1113         ld      [%i5+4],%i1
1114                 srlx    %o2,24,%o2
1115                 xor     %o1,%l4,%l4
1116         ld      [%i5+8],%i2
1117                 srlx    %o3,8,%o3
1118                 xor     %o2,%l4,%l4
1119         ld      [%i5+12],%i3                    !
1120                 srlx    %o4,16,%o4
1121                 xor     %l1,%l5,%l5
1122         
1123                 srlx    %o5,24,%o5
1124                 xor     %o3,%l5,%l5
1125                 srlx    %o7,8,%o7
1126                 xor     %o4,%l5,%l5
1127                 srlx    %g1,16,%g1      !
1128                 xor     %o5,%l5,%l5
1129                 srlx    %g2,24,%g2
1130                 xor     %l2,%l6,%l6
1131                 srlx    %g3,8,%g3
1132                 xor     %o7,%l6,%l6
1133                 srlx    %g4,16,%g4
1134                 xor     %g1,%l6,%l6
1135                 srlx    %g5,24,%g5      !
1136                 xor     %g2,%l6,%l6
1137                 xor     %l3,%g4,%g4
1138                 xor     %g3,%l7,%l7
1139         srl     %l4,21,%l0
1140                 xor     %g4,%l7,%l7
1141                 xor     %g5,%l7,%l7
1142         srl     %l7,13,%o0
1144         and     %l0,2040,%l0            !
1145         srl     %l6,5,%o1
1146         and     %o0,2040,%o0
1147         ldx     [%i4+%l0],%l0
1148         sll     %l5,3,%o2
1149         and     %o1,2040,%o1
1150         ldx     [%i4+%o0],%o0
1151         
1152         srl     %l5,21,%l1                      !
1153         and     %o2,2040,%o2
1154         ldx     [%i4+%o1],%o1
1155         srl     %l4,13,%o3
1156         and     %l1,2040,%l1
1157         ldx     [%i4+%o2],%o2
1158         srl     %l7,5,%o4
1159         and     %o3,2040,%o3
1160         ldx     [%i4+%l1],%l1           !
1161         sll     %l6,3,%o5
1162         and     %o4,2040,%o4
1163         ldx     [%i4+%o3],%o3
1164         srl     %l6,21,%l2
1165         and     %o5,2040,%o5
1166         ldx     [%i4+%o4],%o4
1167         
1168         srl     %l5,13,%o7                      !
1169         and     %l2,2040,%l2
1170         ldx     [%i4+%o5],%o5
1171         srl     %l4,5,%g1
1172         and     %o7,2040,%o7
1173         ldx     [%i4+%l2],%l2
1174         sll     %l7,3,%g2
1175         and     %g1,2040,%g1
1176         ldx     [%i4+%o7],%o7           !
1177         srl     %l7,21,%l3
1178         and     %g2,2040,%g2
1179         ldx     [%i4+%g1],%g1
1180         srl     %l6,13,%g3
1181         and     %l3,2040,%l3
1182         ldx     [%i4+%g2],%g2
1183         
1184         srl     %l5,5,%g4                       !
1185         and     %g3,2040,%g3
1186         ldx     [%i4+%l3],%l3
1187         sll     %l4,3,%g5
1188         and     %g4,2040,%g4
1189         ldx     [%i4+%g3],%g3
1190                 srlx    %o0,8,%o0
1191         and     %g5,2040,%g5
1192         ldx     [%i4+%g4],%g4           !
1194                 srlx    %o1,16,%o1
1195                 xor     %l0,%i0,%i0
1196         ldx     [%i4+%g5],%g5
1197                 srlx    %o2,24,%o2
1198                 xor     %o0,%i0,%i0
1199         ld      [%i5+16],%l4
1200         
1201                 srlx    %o3,8,%o3               !
1202                 xor     %o1,%i0,%i0
1203         ld      [%i5+20],%l5
1204                 srlx    %o4,16,%o4
1205                 xor     %o2,%i0,%i0
1206         ld      [%i5+24],%l6
1207                 srlx    %o5,24,%o5
1208                 xor     %l1,%i1,%i1
1209         ld      [%i5+28],%l7                    !
1210                 srlx    %o7,8,%o7
1211                 xor     %o3,%i1,%i1
1212         ldx     [%i4+2048+0],%g0                ! prefetch td4
1213                 srlx    %g1,16,%g1
1214                 xor     %o4,%i1,%i1
1215         ldx     [%i4+2048+32],%g0               ! prefetch td4
1216                 srlx    %g2,24,%g2
1217                 xor     %o5,%i1,%i1
1218         ldx     [%i4+2048+64],%g0               ! prefetch td4
1219                 srlx    %g3,8,%g3
1220                 xor     %l2,%i2,%i2
1221         ldx     [%i4+2048+96],%g0               ! prefetch td4
1222                 srlx    %g4,16,%g4      !
1223                 xor     %o7,%i2,%i2
1224         ldx     [%i4+2048+128],%g0              ! prefetch td4
1225                 srlx    %g5,24,%g5
1226                 xor     %g1,%i2,%i2
1227         ldx     [%i4+2048+160],%g0              ! prefetch td4
1228         srl     %i0,21,%l0
1229                 xor     %g2,%i2,%i2
1230         ldx     [%i4+2048+192],%g0              ! prefetch td4
1231                 xor     %l3,%g4,%g4
1232                 xor     %g3,%i3,%i3
1233         ldx     [%i4+2048+224],%g0              ! prefetch td4
1234         and     %l0,2040,%l0            !
1235                 xor     %g4,%i3,%i3
1236                 xor     %g5,%i3,%i3
1237         ba      .Ldec_loop
1238         srl     %i3,13,%o0
1240 .align  32
1241 .Ldec_last:
1242                 srlx    %o0,8,%o0               !
1243                 xor     %l0,%l4,%l4
1244         ld      [%i5+0],%i0
1245                 srlx    %o1,16,%o1
1246                 xor     %o0,%l4,%l4
1247         ld      [%i5+4],%i1
1248                 srlx    %o2,24,%o2
1249                 xor     %o1,%l4,%l4
1250         ld      [%i5+8],%i2                     !
1251                 srlx    %o3,8,%o3
1252                 xor     %o2,%l4,%l4
1253         ld      [%i5+12],%i3
1254                 srlx    %o4,16,%o4
1255                 xor     %l1,%l5,%l5
1256                 srlx    %o5,24,%o5
1257                 xor     %o3,%l5,%l5
1258                 srlx    %o7,8,%o7               !
1259                 xor     %o4,%l5,%l5
1260                 srlx    %g1,16,%g1
1261                 xor     %o5,%l5,%l5
1262                 srlx    %g2,24,%g2
1263                 xor     %l2,%l6,%l6
1264                 srlx    %g3,8,%g3
1265                 xor     %o7,%l6,%l6
1266                 srlx    %g4,16,%g4      !
1267                 xor     %g1,%l6,%l6
1268                 srlx    %g5,24,%g5
1269                 xor     %g2,%l6,%l6
1270                 xor     %l3,%g4,%g4
1271                 xor     %g3,%l7,%l7
1272         srl     %l4,24,%l0
1273                 xor     %g4,%l7,%l7
1274                 xor     %g5,%l7,%l7             !
1275         srl     %l7,16,%o0
1277         srl     %l6,8,%o1
1278         and     %o0,255,%o0
1279         ldub    [%i7+%l0],%l0
1280         srl     %l5,24,%l1
1281         and     %o1,255,%o1
1282         ldub    [%i7+%o0],%o0
1283         srl     %l4,16,%o3                      !
1284         and     %l5,255,%o2
1285         ldub    [%i7+%o1],%o1
1286         ldub    [%i7+%o2],%o2
1287         srl     %l7,8,%o4
1288         and     %o3,255,%o3
1289         ldub    [%i7+%l1],%l1
1290         
1291         srl     %l6,24,%l2                      !
1292         and     %o4,255,%o4
1293         ldub    [%i7+%o3],%o3
1294         srl     %l5,16,%o7
1295         and     %l6,255,%o5
1296         ldub    [%i7+%o4],%o4
1297         ldub    [%i7+%o5],%o5
1298         
1299         srl     %l4,8,%g1                       !
1300         and     %o7,255,%o7
1301         ldub    [%i7+%l2],%l2
1302         srl     %l7,24,%l3
1303         and     %g1,255,%g1
1304         ldub    [%i7+%o7],%o7
1305         srl     %l6,16,%g3
1306         and     %l7,255,%g2
1307         ldub    [%i7+%g1],%g1           !
1308         srl     %l5,8,%g4
1309         and     %g3,255,%g3
1310         ldub    [%i7+%g2],%g2
1311         ldub    [%i7+%l3],%l3
1312         and     %g4,255,%g4
1313         ldub    [%i7+%g3],%g3
1314         and     %l4,255,%g5
1315         ldub    [%i7+%g4],%g4           !
1317                 sll     %l0,24,%l0
1318                 xor     %o2,%i0,%i0
1319         ldub    [%i7+%g5],%g5
1320                 sll     %o0,16,%o0
1321                 xor     %l0,%i0,%i0
1322         ldx     [%sp+2047+192+0],%i7    ! restore return address
1323         
1324                 sll     %o1,8,%o1               !
1325                 xor     %o0,%i0,%i0
1326                 sll     %l1,24,%l1
1327                 xor     %o1,%i0,%i0
1328                 sll     %o3,16,%o3
1329                 xor     %o5,%i1,%i1
1330                 sll     %o4,8,%o4
1331                 xor     %l1,%i1,%i1
1332                 sll     %l2,24,%l2              !
1333                 xor     %o3,%i1,%i1
1334                 sll     %o7,16,%o7
1335                 xor     %g2,%i2,%i2
1336                 sll     %g1,8,%g1
1337                 xor     %o4,%i1,%i1
1338                 sll     %l3,24,%l3
1339                 xor     %l2,%i2,%i2
1340                 sll     %g3,16,%g3      !
1341                 xor     %o7,%i2,%i2
1342                 sll     %g4,8,%g4
1343                 xor     %g1,%i2,%i2
1344                 xor     %l3,%g4,%g4
1345                 xor     %g3,%i3,%i3
1346                 xor     %g4,%i3,%i3
1347                 xor     %g5,%i3,%i3
1349         ret
1350         restore
1351 .type   _sparcv9_AES_decrypt,#function
1352 .size   _sparcv9_AES_decrypt,(.-_sparcv9_AES_decrypt)
1354 .align  32
1355 .globl  AES_decrypt
1356 AES_decrypt:
1357         or      %o0,%o1,%g1
1358         andcc   %g1,3,%g0
1359         bnz,pn  %xcc,.Lunaligned_dec
1360         save    %sp,-192,%sp
1362         ld      [%i0+0],%o0
1363         ld      [%i0+4],%o1
1364         ld      [%i0+8],%o2
1365         ld      [%i0+12],%o3
1367 1:      call    .+8
1368         add     %o7,AES_Td-1b,%o4
1369         call    _sparcv9_AES_decrypt
1370         mov     %i2,%o5
1372         st      %o0,[%i1+0]
1373         st      %o1,[%i1+4]
1374         st      %o2,[%i1+8]
1375         st      %o3,[%i1+12]
1377         ret
1378         restore
1380 .align  32
1381 .Lunaligned_dec:
1382         ldub    [%i0+0],%l0
1383         ldub    [%i0+1],%l1
1384         ldub    [%i0+2],%l2
1386         sll     %l0,24,%l0
1387         ldub    [%i0+3],%l3
1388         sll     %l1,16,%l1
1389         ldub    [%i0+4],%l4
1390         sll     %l2,8,%l2
1391         or      %l1,%l0,%l0
1392         ldub    [%i0+5],%l5
1393         sll     %l4,24,%l4
1394         or      %l3,%l2,%l2
1395         ldub    [%i0+6],%l6
1396         sll     %l5,16,%l5
1397         or      %l0,%l2,%o0
1398         ldub    [%i0+7],%l7
1400         sll     %l6,8,%l6
1401         or      %l5,%l4,%l4
1402         ldub    [%i0+8],%l0
1403         or      %l7,%l6,%l6
1404         ldub    [%i0+9],%l1
1405         or      %l4,%l6,%o1
1406         ldub    [%i0+10],%l2
1408         sll     %l0,24,%l0
1409         ldub    [%i0+11],%l3
1410         sll     %l1,16,%l1
1411         ldub    [%i0+12],%l4
1412         sll     %l2,8,%l2
1413         or      %l1,%l0,%l0
1414         ldub    [%i0+13],%l5
1415         sll     %l4,24,%l4
1416         or      %l3,%l2,%l2
1417         ldub    [%i0+14],%l6
1418         sll     %l5,16,%l5
1419         or      %l0,%l2,%o2
1420         ldub    [%i0+15],%l7
1422         sll     %l6,8,%l6
1423         or      %l5,%l4,%l4
1424         or      %l7,%l6,%l6
1425         or      %l4,%l6,%o3
1427 1:      call    .+8
1428         add     %o7,AES_Td-1b,%o4
1429         call    _sparcv9_AES_decrypt
1430         mov     %i2,%o5
1432         srl     %o0,24,%l0
1433         srl     %o0,16,%l1
1434         stb     %l0,[%i1+0]
1435         srl     %o0,8,%l2
1436         stb     %l1,[%i1+1]
1437         stb     %l2,[%i1+2]
1438         srl     %o1,24,%l4
1439         stb     %o0,[%i1+3]
1441         srl     %o1,16,%l5
1442         stb     %l4,[%i1+4]
1443         srl     %o1,8,%l6
1444         stb     %l5,[%i1+5]
1445         stb     %l6,[%i1+6]
1446         srl     %o2,24,%l0
1447         stb     %o1,[%i1+7]
1449         srl     %o2,16,%l1
1450         stb     %l0,[%i1+8]
1451         srl     %o2,8,%l2
1452         stb     %l1,[%i1+9]
1453         stb     %l2,[%i1+10]
1454         srl     %o3,24,%l4
1455         stb     %o2,[%i1+11]
1457         srl     %o3,16,%l5
1458         stb     %l4,[%i1+12]
1459         srl     %o3,8,%l6
1460         stb     %l5,[%i1+13]
1461         stb     %l6,[%i1+14]
1462         stb     %o3,[%i1+15]
1464         ret
1465         restore
1466 .type   AES_decrypt,#function
1467 .size   AES_decrypt,(.-AES_decrypt)