Print this page
3882 remove xmod & friends
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/common/crypto/arcfour/sun4u/arcfour_crypt_asm.s
+++ new/usr/src/common/crypto/arcfour/sun4u/arcfour_crypt_asm.s
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #if defined(lint) || defined(__lint)
27 27
28 28 #include "arcfour.h"
29 29
30 30 /* ARGSUSED */
31 31 void
32 32 arcfour_crypt_aligned(ARCFour_key *key, size_t len, uchar_t *in, uchar_t *out)
33 33 {}
34 34
35 35 #else /* lint || __lint */
36 36
37 37 .register %g2,#scratch
38 38 .register %g3,#scratch
39 39
40 40 .section ".text",#alloc,#execinstr
41 41 .file "arcfour_crypt_asm.s"
42 42
43 43 .section ".text",#alloc
44 44 .align 32
45 45
46 46 .section ".text",#alloc,#execinstr
47 47 .align 32
48 48 .skip 32
49 49
50 50 /*
51 51 * SUBROUTINE arcfour_crypt_aligned
↓ open down ↓ |
51 lines elided |
↑ open up ↑ |
52 52 *
53 53 * void arcfour_crypt_aligned(ARCFour_key *key, size_t len,
54 54 * uchar_t *in, uchar_t *out);
55 55 *
56 56 * in and out should be aligned on an 8-byte boundary, but len can be anything
57 57 */
58 58 .global arcfour_crypt_aligned
59 59
60 60
61 61 arcfour_crypt_aligned:
62 -
63 -/* EXPORT DELETE START */
64 62 save %sp,-144,%sp
65 63
66 64 srl %i1, 3, %l7
67 65 ldub [%i0+256], %g1
68 66
69 67 orcc %l7, %g0, %g0
70 68 ldub [%i0+257], %g2
71 69
72 70 add %g1, 1, %o1
73 71 bz %icc, .Loop2
74 72 add %i0, 0, %i5
75 73
76 74 add %o1, 1, %g1
77 75 and %o1, 255, %o1
78 76
79 77 and %g1, 255, %g1
80 78 ldub [%i5 + %o1], %o3
81 79
82 80 ldub [%i5 + %g1], %g3
83 81
84 82 add %g2, %o3, %o2
85 83
86 84 add %o2, %g3, %g2
87 85 and %o2, 255, %o2
88 86
89 87 and %g2, 255, %g2
90 88 ldub [%i5 + %o2], %o4
91 89
92 90 stb %o3, [%i5+%o2]
93 91 subcc %o2, %g1, %g0
94 92
95 93 stb %o4, [%i5 + %o1]
96 94 bz %icc, .L1A
97 95 add %o3,%o4,%o5
98 96 .L1B:
99 97 and %o5, 255, %o5
100 98 ldub [%i5 + %g2], %g4
101 99
102 100 ldub [%i5 + %o5], %o5
103 101 add %g1, 1, %o1
104 102
105 103 and %o1, 255, %o1
106 104 stb %g3, [%i5 + %g2]
107 105 add %g3, %g4, %g5
108 106
109 107 and %g5, 255, %g5
110 108 stb %g4, [%i5 + %g1]
111 109 add %o1, 1, %g1
112 110
113 111
114 112 sllx %o5, 56, %o0
115 113 ldub [%i5 + %o1], %o3
116 114 and %g1, 255, %g1
117 115
118 116 ldub [%i5 + %g1], %g3
119 117
120 118 add %g2, %o3, %o2
121 119 ldub [%i5 + %g5], %g5
122 120
123 121 add %o2, %g3, %g2
124 122 and %o2, 255, %o2
125 123
126 124 sllx %g5, 48, %g5
127 125 ldub [%i5 + %o2], %o4
128 126 and %g2, 255, %g2
129 127
130 128 or %o0, %g5, %o0
131 129 stb %o3, [%i5+%o2]
132 130 subcc %o2, %g1, %g0
133 131
134 132 stb %o4, [%i5 + %o1]
135 133 bz %icc, .L2A
136 134 add %o3,%o4,%o5
137 135 .L2B:
138 136 and %o5, 255, %o5
139 137 ldub [%i5 + %g2], %g4
140 138
141 139 ldub [%i5 + %o5], %o5
142 140 add %g1, 1, %o1
143 141
144 142 and %o1, 255, %o1
145 143 stb %g3, [%i5 + %g2]
146 144 add %g3, %g4, %g5
147 145
148 146 and %g5, 255, %g5
149 147 stb %g4, [%i5 + %g1]
150 148 add %o1, 1, %g1
151 149
152 150
153 151 sllx %o5, 40, %o5
154 152 ldub [%i5 + %o1], %o3
155 153 and %g1, 255, %g1
156 154
157 155 ldub [%i5 + %g1], %g3
158 156 or %o0, %o5, %o0
159 157
160 158 add %g2, %o3, %o2
161 159 ldub [%i5 + %g5], %g5
162 160
163 161 add %o2, %g3, %g2
164 162 and %o2, 255, %o2
165 163
166 164 sllx %g5, 32, %g5
167 165 ldub [%i5 + %o2], %o4
168 166 and %g2, 255, %g2
169 167
170 168 or %o0, %g5, %o0
171 169 stb %o3, [%i5+%o2]
172 170 subcc %o2, %g1, %g0
173 171
174 172 stb %o4, [%i5 + %o1]
175 173 bz %icc, .L3A
176 174 add %o3,%o4,%o5
177 175 .L3B:
178 176 and %o5, 255, %o5
179 177 ldub [%i5 + %g2], %g4
180 178
181 179 ldub [%i5 + %o5], %o5
182 180 add %g1, 1, %o1
183 181
184 182 and %o1, 255, %o1
185 183 stb %g3, [%i5 + %g2]
186 184 add %g3, %g4, %g5
187 185
188 186 and %g5, 255, %g5
189 187 stb %g4, [%i5 + %g1]
190 188 add %o1, 1, %g1
191 189
192 190
193 191 sll %o5, 24, %o5
194 192 ldub [%i5 + %o1], %o3
195 193 and %g1, 255, %g1
196 194
197 195 sub %i1, 8, %i1
198 196 ldub [%i5 + %g1], %g3
199 197 or %o0, %o5, %o0
200 198
201 199 srl %i1, 3, %l7
202 200 ldub [%i5 + %g5], %g5
203 201 add %g2, %o3, %o2
204 202
205 203 add %o2, %g3, %g2
206 204 and %o2, 255, %o2
207 205
208 206 sll %g5, 16, %g5
209 207 ldub [%i5 + %o2], %o4
210 208 and %g2, 255, %g2
211 209
212 210 or %o0, %g5, %o0
213 211 stb %o3, [%i5+%o2]
214 212 subcc %o2, %g1, %g0
215 213
216 214 stb %o4, [%i5 + %o1]
217 215 bz %icc, .L4A
218 216 add %o3,%o4,%o5
219 217 .L4B:
220 218 and %o5, 255, %o5
221 219 ldub [%i5 + %g2], %g4
222 220 add %g1, 1, %o1
223 221
224 222 orcc %l7, %g0, %g0
225 223 ldub [%i5 + %o5], %o5
226 224 and %o1, 255, %o1
227 225
228 226 add %g3, %g4, %g5
229 227 stb %g4, [%i5 + %g1]
230 228 add %o1, 1, %g1
231 229
232 230 stb %g3, [%i5 + %g2]
233 231 bz %icc, .EndLoop1
234 232 and %g5, 255, %g5
235 233
236 234
237 235 .Loop1:
238 236 sll %o5, 8, %o5
239 237 ldub [%i5 + %o1], %o3
240 238 and %g1, 255, %g1
241 239
242 240 ldub [%i5 + %g1], %g3
243 241 or %o0, %o5, %o0
244 242
245 243 ldub [%i5 + %g5], %g5
246 244 add %g2, %o3, %o2
247 245
248 246 add %o2, %g3, %g2
249 247 ldx [%i2], %o7
250 248 and %o2, 255, %o2
251 249
252 250 and %g2, 255, %g2
253 251 ldub [%i5 + %o2], %o4
254 252
255 253 or %o0, %g5, %o0
256 254 stb %o3, [%i5+%o2]
257 255 subcc %o2, %g1, %g0
258 256
259 257 stb %o4, [%i5 + %o1]
260 258 bz %icc, .L5A
261 259 add %o3,%o4,%o5
262 260 .L5B:
263 261 and %o5, 255, %o5
264 262 ldub [%i5 + %g2], %g4
265 263
266 264 ldub [%i5 + %o5], %o5
267 265 add %g1, 1, %o1
268 266
269 267 and %o1, 255, %o1
270 268 stb %g3, [%i5 + %g2]
271 269 add %g3, %g4, %g5
272 270
273 271 and %g5, 255, %g5
274 272 stb %g4, [%i5 + %g1]
275 273 add %o1, 1, %g1
276 274
277 275
278 276 xor %o0, %o7, %o7
279 277 ldub [%i5 + %o1], %o3
280 278 and %g1, 255, %g1
281 279
282 280 sllx %o5, 56, %o0
283 281 ldub [%i5 + %g1], %g3
284 282
285 283 add %g2, %o3, %o2
286 284 ldub [%i5 + %g5], %g5
287 285
288 286 add %o2, %g3, %g2
289 287 stx %o7, [%i3]
290 288 and %o2, 255, %o2
291 289
292 290 sllx %g5, 48, %g5
293 291 ldub [%i5 + %o2], %o4
294 292 and %g2, 255, %g2
295 293
296 294 or %o0, %g5, %o0
297 295 stb %o3, [%i5+%o2]
298 296 subcc %o2, %g1, %g0
299 297
300 298 stb %o4, [%i5 + %o1]
301 299 bz %icc, .L6A
302 300 add %o3,%o4,%o5
303 301 .L6B:
304 302 and %o5, 255, %o5
305 303 ldub [%i5 + %g2], %g4
306 304 add %i3, 8, %i3
307 305
308 306 add %i2, 8, %i2
309 307 ldub [%i5 + %o5], %o5
310 308 add %g1, 1, %o1
311 309
312 310 and %o1, 255, %o1
313 311 stb %g3, [%i5 + %g2]
314 312 add %g3, %g4, %g5
315 313
316 314 and %g5, 255, %g5
317 315 stb %g4, [%i5 + %g1]
318 316 add %o1, 1, %g1
319 317
320 318
321 319 sllx %o5, 40, %o5
322 320 ldub [%i5 + %o1], %o3
323 321 and %g1, 255, %g1
324 322
325 323 ldub [%i5 + %g1], %g3
326 324 or %o0, %o5, %o0
327 325
328 326 add %g2, %o3, %o2
329 327 ldub [%i5 + %g5], %g5
330 328
331 329 add %o2, %g3, %g2
332 330 and %o2, 255, %o2
333 331
334 332 sllx %g5, 32, %g5
335 333 ldub [%i5 + %o2], %o4
336 334 and %g2, 255, %g2
337 335
338 336 or %o0, %g5, %o0
339 337 stb %o3, [%i5 + %o2]
340 338 subcc %o2, %g1, %g0
341 339
342 340 stb %o4, [%i5 + %o1]
343 341 bz %icc, .L7A
344 342 add %o3,%o4,%o5
345 343 .L7B:
346 344 and %o5, 255, %o5
347 345 ldub [%i5 + %g2], %g4
348 346
349 347 ldub [%i5 + %o5], %o5
350 348 add %g1, 1, %o1
351 349
352 350 and %o1, 255, %o1
353 351 stb %g3, [%i5 + %g2]
354 352 add %g3, %g4, %g5
355 353
356 354 and %g5, 255, %g5
357 355 stb %g4, [%i5 + %g1]
358 356 add %o1, 1, %g1
359 357
360 358
361 359 sll %o5, 24, %o5
362 360 ldub [%i5 + %o1], %o3
363 361 and %g1, 255, %g1
364 362
365 363 sub %i1, 8, %i1
366 364 ldub [%i5 + %g1], %g3
367 365 or %o0, %o5, %o0
368 366
369 367 srl %i1, 3, %l7
370 368 ldub [%i5 + %g5], %g5
371 369 add %g2, %o3, %o2
372 370
373 371 add %o2, %g3, %g2
374 372 and %o2, 255, %o2
375 373
376 374 sll %g5, 16, %g5
377 375 ldub [%i5 + %o2], %o4
378 376 and %g2, 255, %g2
379 377
380 378 or %o0, %g5, %o0
381 379 stb %o3, [%i5 + %o2]
382 380 subcc %o2, %g1, %g0
383 381
384 382 stb %o4, [%i5 + %o1]
385 383 bz %icc, .L8A
386 384 add %o3,%o4,%o5
387 385 .L8B:
388 386 and %o5, 255, %o5
389 387 ldub [%i5 + %g2], %g4
390 388 add %g1, 1, %o1
391 389
392 390 orcc %l7, %g0, %g0
393 391 ldub [%i5 + %o5], %o5
394 392 and %o1, 255, %o1
395 393
396 394 add %g3, %g4, %g5
397 395 stb %g4, [%i5 + %g1]
398 396 add %o1, 1, %g1
399 397
400 398 stb %g3, [%i5 + %g2]
401 399 bnz %icc, .Loop1
402 400 and %g5, 255, %g5
403 401
404 402
405 403 .EndLoop1:
406 404 sll %o5, 8, %o5
407 405 ldub [%i5 + %g5], %g5
408 406 orcc %i1, %g0, %g0
409 407
410 408 or %o0, %o5, %o0
411 409 ldx [%i2], %o7
412 410 sub %g1, 2, %g1
413 411
414 412 and %g1, 255, %g1
415 413 stb %g1, [%i0 + 256]
416 414 or %o0, %g5, %o0
417 415
418 416 xor %o0, %o7, %o7
419 417 stx %o7, [%i3]
420 418 add %i2, 8, %i2
421 419
422 420 add %i3, 8, %i3
423 421 bnz %icc, .Loop2_1
424 422 stb %g2, [%i0 + 257]
425 423
426 424 ret
427 425 restore %g0,%g0,%g0
428 426
429 427
430 428 .Loop2:
431 429 orcc %i1, %g0, %g0
432 430 bnz .Loop2_1
433 431 nop
434 432 ret
435 433 restore %g0,%g0,%g0
436 434
437 435 .Loop2_1:
438 436 and %o1, 255, %g1
439 437 ldub [%i5 + %g1], %g3
440 438
441 439 add %g2, %g3, %g2
442 440
443 441 and %g2, 255, %g2
444 442
445 443 ldub [%i5 + %g2], %g4
446 444
447 445 stb %g3, [%i5 + %g2]
448 446
449 447 add %g3, %g4, %g5
450 448 stb %g4, [%i5 + %g1]
451 449
452 450 and %g5, 255, %g5
453 451 ldub [%i2], %o0
454 452
455 453 add %g1, 1, %o1
456 454 ldub [%i5 + %g5], %g5
457 455 subcc %i1, 1, %i1
458 456
459 457 add %i2, 1, %i2
460 458 add %i3, 1, %i3
461 459
462 460 xor %o0, %g5, %o0
463 461 bnz %icc, .Loop2_1
464 462 stb %o0, [%i3 - 1]
465 463
466 464 stb %g1, [%i0 + 256]
467 465
468 466 stb %g2, [%i0 + 257]
469 467
470 468 ret
471 469 restore %g0,%g0,%g0
472 470
473 471 .L1A:
474 472 add %o2, %o3, %g2
475 473 or %o3, %g0, %g3
476 474 ba .L1B
477 475 and %g2, 255, %g2
478 476
479 477 .L2A:
480 478 add %o2, %o3, %g2
481 479 or %o3, %g0, %g3
482 480 ba .L2B
483 481 and %g2, 255, %g2
484 482
485 483 .L3A:
486 484 add %o2, %o3, %g2
487 485 or %o3, %g0, %g3
488 486 ba .L3B
489 487 and %g2, 255, %g2
490 488
491 489 .L4A:
492 490 add %o2, %o3, %g2
493 491 or %o3, %g0, %g3
494 492 ba .L4B
495 493 and %g2, 255, %g2
496 494
497 495 .L5A:
498 496 add %o2, %o3, %g2
499 497 or %o3, %g0, %g3
500 498 ba .L5B
501 499 and %g2, 255, %g2
502 500
503 501 .L6A:
504 502 add %o2, %o3, %g2
505 503 or %o3, %g0, %g3
506 504 ba .L6B
507 505 and %g2, 255, %g2
508 506
509 507 .L7A:
510 508 add %o2, %o3, %g2
↓ open down ↓ |
437 lines elided |
↑ open up ↑ |
511 509 or %o3, %g0, %g3
512 510 ba .L7B
513 511 and %g2, 255, %g2
514 512
515 513 .L8A:
516 514 add %o2, %o3, %g2
517 515 or %o3, %g0, %g3
518 516 ba .L8B
519 517 and %g2, 255, %g2
520 518
521 -/* EXPORT DELETE END */
522 519 .type arcfour_crypt_aligned,2
523 520 .size arcfour_crypt_aligned,(. - arcfour_crypt_aligned)
524 521
525 522 #endif /* lint || __lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX