rc5-586.s revision 127326
1 # $FreeBSD: head/secure/lib/libcrypto/i386/rc5-586.s 127326 2004-03-23 08:32:29Z markm $ 2 3 4 5 6 7 8 .file "rc5-586.s" 9 .version "01.01" 10gcc2_compiled.: 11.text 12 .align 16 13.globl RC5_32_encrypt 14 .type RC5_32_encrypt,@function 15RC5_32_encrypt: 16 17 pushl %ebp 18 pushl %esi 19 pushl %edi 20 movl 16(%esp), %edx 21 movl 20(%esp), %ebp 22 23 movl (%edx), %edi 24 movl 4(%edx), %esi 25 pushl %ebx 26 movl (%ebp), %ebx 27 addl 4(%ebp), %edi 28 addl 8(%ebp), %esi 29 xorl %esi, %edi 30 movl 12(%ebp), %eax 31 movl %esi, %ecx 32 roll %cl, %edi 33 addl %eax, %edi 34 xorl %edi, %esi 35 movl 16(%ebp), %eax 36 movl %edi, %ecx 37 roll %cl, %esi 38 addl %eax, %esi 39 xorl %esi, %edi 40 movl 20(%ebp), %eax 41 movl %esi, %ecx 42 roll %cl, %edi 43 addl %eax, %edi 44 xorl %edi, %esi 45 movl 24(%ebp), %eax 46 movl %edi, %ecx 47 roll %cl, %esi 48 addl %eax, %esi 49 xorl %esi, %edi 50 movl 28(%ebp), %eax 51 movl %esi, %ecx 52 roll %cl, %edi 53 addl %eax, %edi 54 xorl %edi, %esi 55 movl 32(%ebp), %eax 56 movl %edi, %ecx 57 roll %cl, %esi 58 addl %eax, %esi 59 xorl %esi, %edi 60 movl 36(%ebp), %eax 61 movl %esi, %ecx 62 roll %cl, %edi 63 addl %eax, %edi 64 xorl %edi, %esi 65 movl 40(%ebp), %eax 66 movl %edi, %ecx 67 roll %cl, %esi 68 addl %eax, %esi 69 xorl %esi, %edi 70 movl 44(%ebp), %eax 71 movl %esi, %ecx 72 roll %cl, %edi 73 addl %eax, %edi 74 xorl %edi, %esi 75 movl 48(%ebp), %eax 76 movl %edi, %ecx 77 roll %cl, %esi 78 addl %eax, %esi 79 xorl %esi, %edi 80 movl 52(%ebp), %eax 81 movl %esi, %ecx 82 roll %cl, %edi 83 addl %eax, %edi 84 xorl %edi, %esi 85 movl 56(%ebp), %eax 86 movl %edi, %ecx 87 roll %cl, %esi 88 addl %eax, %esi 89 xorl %esi, %edi 90 movl 60(%ebp), %eax 91 movl %esi, %ecx 92 roll %cl, %edi 93 addl %eax, %edi 94 xorl %edi, %esi 95 movl 64(%ebp), %eax 96 movl %edi, %ecx 97 roll %cl, %esi 98 addl %eax, %esi 99 xorl %esi, %edi 100 movl 68(%ebp), %eax 101 movl %esi, %ecx 102 roll %cl, %edi 103 addl %eax, %edi 104 xorl %edi, %esi 105 movl 72(%ebp), %eax 106 movl %edi, %ecx 107 roll %cl, %esi 108 addl %eax, %esi 109 cmpl $8, %ebx 110 je .L000rc5_exit 111 xorl %esi, %edi 112 movl 76(%ebp), %eax 113 movl %esi, %ecx 114 roll %cl, %edi 115 addl %eax, %edi 116 xorl %edi, %esi 117 movl 80(%ebp), %eax 118 movl %edi, %ecx 119 roll %cl, %esi 120 addl %eax, %esi 121 xorl %esi, %edi 122 movl 84(%ebp), %eax 123 movl %esi, %ecx 124 roll %cl, %edi 125 addl %eax, %edi 126 xorl %edi, %esi 127 movl 88(%ebp), %eax 128 movl %edi, %ecx 129 roll %cl, %esi 130 addl %eax, %esi 131 xorl %esi, %edi 132 movl 92(%ebp), %eax 133 movl %esi, %ecx 134 roll %cl, %edi 135 addl %eax, %edi 136 xorl %edi, %esi 137 movl 96(%ebp), %eax 138 movl %edi, %ecx 139 roll %cl, %esi 140 addl %eax, %esi 141 xorl %esi, %edi 142 movl 100(%ebp), %eax 143 movl %esi, %ecx 144 roll %cl, %edi 145 addl %eax, %edi 146 xorl %edi, %esi 147 movl 104(%ebp), %eax 148 movl %edi, %ecx 149 roll %cl, %esi 150 addl %eax, %esi 151 cmpl $12, %ebx 152 je .L000rc5_exit 153 xorl %esi, %edi 154 movl 108(%ebp), %eax 155 movl %esi, %ecx 156 roll %cl, %edi 157 addl %eax, %edi 158 xorl %edi, %esi 159 movl 112(%ebp), %eax 160 movl %edi, %ecx 161 roll %cl, %esi 162 addl %eax, %esi 163 xorl %esi, %edi 164 movl 116(%ebp), %eax 165 movl %esi, %ecx 166 roll %cl, %edi 167 addl %eax, %edi 168 xorl %edi, %esi 169 movl 120(%ebp), %eax 170 movl %edi, %ecx 171 roll %cl, %esi 172 addl %eax, %esi 173 xorl %esi, %edi 174 movl 124(%ebp), %eax 175 movl %esi, %ecx 176 roll %cl, %edi 177 addl %eax, %edi 178 xorl %edi, %esi 179 movl 128(%ebp), %eax 180 movl %edi, %ecx 181 roll %cl, %esi 182 addl %eax, %esi 183 xorl %esi, %edi 184 movl 132(%ebp), %eax 185 movl %esi, %ecx 186 roll %cl, %edi 187 addl %eax, %edi 188 xorl %edi, %esi 189 movl 136(%ebp), %eax 190 movl %edi, %ecx 191 roll %cl, %esi 192 addl %eax, %esi 193.L000rc5_exit: 194 movl %edi, (%edx) 195 movl %esi, 4(%edx) 196 popl %ebx 197 popl %edi 198 popl %esi 199 popl %ebp 200 ret 201.L_RC5_32_encrypt_end: 202 .size RC5_32_encrypt,.L_RC5_32_encrypt_end-RC5_32_encrypt 203.ident "desasm.pl" 204.text 205 .align 16 206.globl RC5_32_decrypt 207 .type RC5_32_decrypt,@function 208RC5_32_decrypt: 209 210 pushl %ebp 211 pushl %esi 212 pushl %edi 213 movl 16(%esp), %edx 214 movl 20(%esp), %ebp 215 216 movl (%edx), %edi 217 movl 4(%edx), %esi 218 pushl %ebx 219 movl (%ebp), %ebx 220 cmpl $12, %ebx 221 je .L001rc5_dec_12 222 cmpl $8, %ebx 223 je .L002rc5_dec_8 224 movl 136(%ebp), %eax 225 subl %eax, %esi 226 movl %edi, %ecx 227 rorl %cl, %esi 228 xorl %edi, %esi 229 movl 132(%ebp), %eax 230 subl %eax, %edi 231 movl %esi, %ecx 232 rorl %cl, %edi 233 xorl %esi, %edi 234 movl 128(%ebp), %eax 235 subl %eax, %esi 236 movl %edi, %ecx 237 rorl %cl, %esi 238 xorl %edi, %esi 239 movl 124(%ebp), %eax 240 subl %eax, %edi 241 movl %esi, %ecx 242 rorl %cl, %edi 243 xorl %esi, %edi 244 movl 120(%ebp), %eax 245 subl %eax, %esi 246 movl %edi, %ecx 247 rorl %cl, %esi 248 xorl %edi, %esi 249 movl 116(%ebp), %eax 250 subl %eax, %edi 251 movl %esi, %ecx 252 rorl %cl, %edi 253 xorl %esi, %edi 254 movl 112(%ebp), %eax 255 subl %eax, %esi 256 movl %edi, %ecx 257 rorl %cl, %esi 258 xorl %edi, %esi 259 movl 108(%ebp), %eax 260 subl %eax, %edi 261 movl %esi, %ecx 262 rorl %cl, %edi 263 xorl %esi, %edi 264.L001rc5_dec_12: 265 movl 104(%ebp), %eax 266 subl %eax, %esi 267 movl %edi, %ecx 268 rorl %cl, %esi 269 xorl %edi, %esi 270 movl 100(%ebp), %eax 271 subl %eax, %edi 272 movl %esi, %ecx 273 rorl %cl, %edi 274 xorl %esi, %edi 275 movl 96(%ebp), %eax 276 subl %eax, %esi 277 movl %edi, %ecx 278 rorl %cl, %esi 279 xorl %edi, %esi 280 movl 92(%ebp), %eax 281 subl %eax, %edi 282 movl %esi, %ecx 283 rorl %cl, %edi 284 xorl %esi, %edi 285 movl 88(%ebp), %eax 286 subl %eax, %esi 287 movl %edi, %ecx 288 rorl %cl, %esi 289 xorl %edi, %esi 290 movl 84(%ebp), %eax 291 subl %eax, %edi 292 movl %esi, %ecx 293 rorl %cl, %edi 294 xorl %esi, %edi 295 movl 80(%ebp), %eax 296 subl %eax, %esi 297 movl %edi, %ecx 298 rorl %cl, %esi 299 xorl %edi, %esi 300 movl 76(%ebp), %eax 301 subl %eax, %edi 302 movl %esi, %ecx 303 rorl %cl, %edi 304 xorl %esi, %edi 305.L002rc5_dec_8: 306 movl 72(%ebp), %eax 307 subl %eax, %esi 308 movl %edi, %ecx 309 rorl %cl, %esi 310 xorl %edi, %esi 311 movl 68(%ebp), %eax 312 subl %eax, %edi 313 movl %esi, %ecx 314 rorl %cl, %edi 315 xorl %esi, %edi 316 movl 64(%ebp), %eax 317 subl %eax, %esi 318 movl %edi, %ecx 319 rorl %cl, %esi 320 xorl %edi, %esi 321 movl 60(%ebp), %eax 322 subl %eax, %edi 323 movl %esi, %ecx 324 rorl %cl, %edi 325 xorl %esi, %edi 326 movl 56(%ebp), %eax 327 subl %eax, %esi 328 movl %edi, %ecx 329 rorl %cl, %esi 330 xorl %edi, %esi 331 movl 52(%ebp), %eax 332 subl %eax, %edi 333 movl %esi, %ecx 334 rorl %cl, %edi 335 xorl %esi, %edi 336 movl 48(%ebp), %eax 337 subl %eax, %esi 338 movl %edi, %ecx 339 rorl %cl, %esi 340 xorl %edi, %esi 341 movl 44(%ebp), %eax 342 subl %eax, %edi 343 movl %esi, %ecx 344 rorl %cl, %edi 345 xorl %esi, %edi 346 movl 40(%ebp), %eax 347 subl %eax, %esi 348 movl %edi, %ecx 349 rorl %cl, %esi 350 xorl %edi, %esi 351 movl 36(%ebp), %eax 352 subl %eax, %edi 353 movl %esi, %ecx 354 rorl %cl, %edi 355 xorl %esi, %edi 356 movl 32(%ebp), %eax 357 subl %eax, %esi 358 movl %edi, %ecx 359 rorl %cl, %esi 360 xorl %edi, %esi 361 movl 28(%ebp), %eax 362 subl %eax, %edi 363 movl %esi, %ecx 364 rorl %cl, %edi 365 xorl %esi, %edi 366 movl 24(%ebp), %eax 367 subl %eax, %esi 368 movl %edi, %ecx 369 rorl %cl, %esi 370 xorl %edi, %esi 371 movl 20(%ebp), %eax 372 subl %eax, %edi 373 movl %esi, %ecx 374 rorl %cl, %edi 375 xorl %esi, %edi 376 movl 16(%ebp), %eax 377 subl %eax, %esi 378 movl %edi, %ecx 379 rorl %cl, %esi 380 xorl %edi, %esi 381 movl 12(%ebp), %eax 382 subl %eax, %edi 383 movl %esi, %ecx 384 rorl %cl, %edi 385 xorl %esi, %edi 386 subl 8(%ebp), %esi 387 subl 4(%ebp), %edi 388.L003rc5_exit: 389 movl %edi, (%edx) 390 movl %esi, 4(%edx) 391 popl %ebx 392 popl %edi 393 popl %esi 394 popl %ebp 395 ret 396.L_RC5_32_decrypt_end: 397 .size RC5_32_decrypt,.L_RC5_32_decrypt_end-RC5_32_decrypt 398.ident "desasm.pl" 399.text 400 .align 16 401.globl RC5_32_cbc_encrypt 402 .type RC5_32_cbc_encrypt,@function 403RC5_32_cbc_encrypt: 404 405 pushl %ebp 406 pushl %ebx 407 pushl %esi 408 pushl %edi 409 movl 28(%esp), %ebp 410 411 movl 36(%esp), %ebx 412 movl (%ebx), %esi 413 movl 4(%ebx), %edi 414 pushl %edi 415 pushl %esi 416 pushl %edi 417 pushl %esi 418 movl %esp, %ebx 419 movl 36(%esp), %esi 420 movl 40(%esp), %edi 421 422 movl 56(%esp), %ecx 423 424 movl 48(%esp), %eax 425 pushl %eax 426 pushl %ebx 427 cmpl $0, %ecx 428 jz .L004decrypt 429 andl $4294967288, %ebp 430 movl 8(%esp), %eax 431 movl 12(%esp), %ebx 432 jz .L005encrypt_finish 433.L006encrypt_loop: 434 movl (%esi), %ecx 435 movl 4(%esi), %edx 436 xorl %ecx, %eax 437 xorl %edx, %ebx 438 movl %eax, 8(%esp) 439 movl %ebx, 12(%esp) 440 call RC5_32_encrypt 441 movl 8(%esp), %eax 442 movl 12(%esp), %ebx 443 movl %eax, (%edi) 444 movl %ebx, 4(%edi) 445 addl $8, %esi 446 addl $8, %edi 447 subl $8, %ebp 448 jnz .L006encrypt_loop 449.L005encrypt_finish: 450 movl 52(%esp), %ebp 451 andl $7, %ebp 452 jz .L007finish 453 call .L008PIC_point 454.L008PIC_point: 455 popl %edx 456 leal .L009cbc_enc_jmp_table-.L008PIC_point(%edx),%ecx 457 movl (%ecx,%ebp,4), %ebp 458 addl %edx, %ebp 459 xorl %ecx, %ecx 460 xorl %edx, %edx 461 jmp *%ebp 462.L010ej7: 463 movb 6(%esi), %dh 464 sall $8, %edx 465.L011ej6: 466 movb 5(%esi), %dh 467.L012ej5: 468 movb 4(%esi), %dl 469.L013ej4: 470 movl (%esi), %ecx 471 jmp .L014ejend 472.L015ej3: 473 movb 2(%esi), %ch 474 sall $8, %ecx 475.L016ej2: 476 movb 1(%esi), %ch 477.L017ej1: 478 movb (%esi), %cl 479.L014ejend: 480 xorl %ecx, %eax 481 xorl %edx, %ebx 482 movl %eax, 8(%esp) 483 movl %ebx, 12(%esp) 484 call RC5_32_encrypt 485 movl 8(%esp), %eax 486 movl 12(%esp), %ebx 487 movl %eax, (%edi) 488 movl %ebx, 4(%edi) 489 jmp .L007finish 490.align 16 491.L004decrypt: 492 andl $4294967288, %ebp 493 movl 16(%esp), %eax 494 movl 20(%esp), %ebx 495 jz .L018decrypt_finish 496.L019decrypt_loop: 497 movl (%esi), %eax 498 movl 4(%esi), %ebx 499 movl %eax, 8(%esp) 500 movl %ebx, 12(%esp) 501 call RC5_32_decrypt 502 movl 8(%esp), %eax 503 movl 12(%esp), %ebx 504 movl 16(%esp), %ecx 505 movl 20(%esp), %edx 506 xorl %eax, %ecx 507 xorl %ebx, %edx 508 movl (%esi), %eax 509 movl 4(%esi), %ebx 510 movl %ecx, (%edi) 511 movl %edx, 4(%edi) 512 movl %eax, 16(%esp) 513 movl %ebx, 20(%esp) 514 addl $8, %esi 515 addl $8, %edi 516 subl $8, %ebp 517 jnz .L019decrypt_loop 518.L018decrypt_finish: 519 movl 52(%esp), %ebp 520 andl $7, %ebp 521 jz .L007finish 522 movl (%esi), %eax 523 movl 4(%esi), %ebx 524 movl %eax, 8(%esp) 525 movl %ebx, 12(%esp) 526 call RC5_32_decrypt 527 movl 8(%esp), %eax 528 movl 12(%esp), %ebx 529 movl 16(%esp), %ecx 530 movl 20(%esp), %edx 531 xorl %eax, %ecx 532 xorl %ebx, %edx 533 movl (%esi), %eax 534 movl 4(%esi), %ebx 535.L020dj7: 536 rorl $16, %edx 537 movb %dl, 6(%edi) 538 shrl $16, %edx 539.L021dj6: 540 movb %dh, 5(%edi) 541.L022dj5: 542 movb %dl, 4(%edi) 543.L023dj4: 544 movl %ecx, (%edi) 545 jmp .L024djend 546.L025dj3: 547 rorl $16, %ecx 548 movb %cl, 2(%edi) 549 sall $16, %ecx 550.L026dj2: 551 movb %ch, 1(%esi) 552.L027dj1: 553 movb %cl, (%esi) 554.L024djend: 555 jmp .L007finish 556.align 16 557.L007finish: 558 movl 60(%esp), %ecx 559 addl $24, %esp 560 movl %eax, (%ecx) 561 movl %ebx, 4(%ecx) 562 popl %edi 563 popl %esi 564 popl %ebx 565 popl %ebp 566 ret 567.align 16 568.L009cbc_enc_jmp_table: 569 .long 0 570 .long .L017ej1-.L008PIC_point 571 .long .L016ej2-.L008PIC_point 572 .long .L015ej3-.L008PIC_point 573 .long .L013ej4-.L008PIC_point 574 .long .L012ej5-.L008PIC_point 575 .long .L011ej6-.L008PIC_point 576 .long .L010ej7-.L008PIC_point 577.L_RC5_32_cbc_encrypt_end: 578 .size RC5_32_cbc_encrypt,.L_RC5_32_cbc_encrypt_end-RC5_32_cbc_encrypt 579.ident "desasm.pl" 580