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