1 /* Copyright (c) 2015, Google Inc. 2 * 3 * Permission to use, copy, modify, and/or distribute this software for any 4 * purpose with or without fee is hereby granted, provided that the above 5 * copyright notice and this permission notice appear in all copies. 6 * 7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 14 15 /* This file is adapted from crypto_scalarmult/curve25519/amd64-51/ in 16 * SUPERCOP 20141124 (http://bench.cr.yp.to/supercop.html). That code is public 17 * domain licensed but the standard ISC license is included above to keep 18 * licensing simple. */ 19 20 .data 21 .p2align 4 22 23 #if defined(__APPLE__) 24 /* OS X's C ABI prefixes functions with underscore. */ 25 #define C_ABI(x) _ ## x 26 #define HIDDEN .private_extern 27 #else 28 #define C_ABI(x) x 29 #define HIDDEN .hidden 30 #endif 31 32 x25519_x86_64_REDMASK51: .quad 0x0007FFFFFFFFFFFF 33 x25519_x86_64_121666_213: .quad 996687872 34 x25519_x86_64_2P0: .quad 0xFFFFFFFFFFFDA 35 x25519_x86_64_2P1234: .quad 0xFFFFFFFFFFFFE 36 x25519_x86_64_4P0: .quad 0x1FFFFFFFFFFFB4 37 x25519_x86_64_4P1234: .quad 0x1FFFFFFFFFFFFC 38 x25519_x86_64_MU0: .quad 0xED9CE5A30A2C131B 39 x25519_x86_64_MU1: .quad 0x2106215D086329A7 40 x25519_x86_64_MU2: .quad 0xFFFFFFFFFFFFFFEB 41 x25519_x86_64_MU3: .quad 0xFFFFFFFFFFFFFFFF 42 x25519_x86_64_MU4: .quad 0x000000000000000F 43 x25519_x86_64_ORDER0: .quad 0x5812631A5CF5D3ED 44 x25519_x86_64_ORDER1: .quad 0x14DEF9DEA2F79CD6 45 x25519_x86_64_ORDER2: .quad 0x0000000000000000 46 x25519_x86_64_ORDER3: .quad 0x1000000000000000 47 x25519_x86_64_EC2D0: .quad 1859910466990425 48 x25519_x86_64_EC2D1: .quad 932731440258426 49 x25519_x86_64_EC2D2: .quad 1072319116312658 50 x25519_x86_64_EC2D3: .quad 1815898335770999 51 x25519_x86_64_EC2D4: .quad 633789495995903 52 x25519_x86_64__38: .quad 38 53 54 .text 55 .p2align 5 56 57 .globl C_ABI(x25519_x86_64_freeze) 58 HIDDEN C_ABI(x25519_x86_64_freeze) 59 C_ABI(x25519_x86_64_freeze): 60 mov %rsp,%r11 61 and $31,%r11 62 add $64,%r11 63 sub %r11,%rsp 64 movq %r11,0(%rsp) 65 movq %r12,8(%rsp) 66 movq %r13,16(%rsp) 67 movq %r14,24(%rsp) 68 movq %r15,32(%rsp) 69 movq %rbx,40(%rsp) 70 movq %rbp,48(%rsp) 71 movq 0(%rdi),%rsi 72 movq 8(%rdi),%rdx 73 movq 16(%rdi),%rcx 74 movq 24(%rdi),%r8 75 movq 32(%rdi),%r9 76 movq x25519_x86_64_REDMASK51(%rip),%rax 77 mov %rax,%r10 78 sub $18,%r10 79 mov $3,%r11 80 ._reduceloop: 81 mov %rsi,%r12 82 shr $51,%r12 83 and %rax,%rsi 84 add %r12,%rdx 85 mov %rdx,%r12 86 shr $51,%r12 87 and %rax,%rdx 88 add %r12,%rcx 89 mov %rcx,%r12 90 shr $51,%r12 91 and %rax,%rcx 92 add %r12,%r8 93 mov %r8,%r12 94 shr $51,%r12 95 and %rax,%r8 96 add %r12,%r9 97 mov %r9,%r12 98 shr $51,%r12 99 and %rax,%r9 100 imulq $19,%r12,%r12 101 add %r12,%rsi 102 sub $1,%r11 103 ja ._reduceloop 104 mov $1,%r12 105 cmp %r10,%rsi 106 cmovl %r11,%r12 107 cmp %rax,%rdx 108 cmovne %r11,%r12 109 cmp %rax,%rcx 110 cmovne %r11,%r12 111 cmp %rax,%r8 112 cmovne %r11,%r12 113 cmp %rax,%r9 114 cmovne %r11,%r12 115 neg %r12 116 and %r12,%rax 117 and %r12,%r10 118 sub %r10,%rsi 119 sub %rax,%rdx 120 sub %rax,%rcx 121 sub %rax,%r8 122 sub %rax,%r9 123 movq %rsi,0(%rdi) 124 movq %rdx,8(%rdi) 125 movq %rcx,16(%rdi) 126 movq %r8,24(%rdi) 127 movq %r9,32(%rdi) 128 movq 0(%rsp),%r11 129 movq 8(%rsp),%r12 130 movq 16(%rsp),%r13 131 movq 24(%rsp),%r14 132 movq 32(%rsp),%r15 133 movq 40(%rsp),%rbx 134 movq 48(%rsp),%rbp 135 add %r11,%rsp 136 mov %rdi,%rax 137 mov %rsi,%rdx 138 ret 139 140 .p2align 5 141 .globl C_ABI(x25519_x86_64_mul) 142 HIDDEN C_ABI(x25519_x86_64_mul) 143 C_ABI(x25519_x86_64_mul): 144 mov %rsp,%r11 145 and $31,%r11 146 add $96,%r11 147 sub %r11,%rsp 148 movq %r11,0(%rsp) 149 movq %r12,8(%rsp) 150 movq %r13,16(%rsp) 151 movq %r14,24(%rsp) 152 movq %r15,32(%rsp) 153 movq %rbx,40(%rsp) 154 movq %rbp,48(%rsp) 155 movq %rdi,56(%rsp) 156 mov %rdx,%rcx 157 movq 24(%rsi),%rdx 158 imulq $19,%rdx,%rax 159 movq %rax,64(%rsp) 160 mulq 16(%rcx) 161 mov %rax,%r8 162 mov %rdx,%r9 163 movq 32(%rsi),%rdx 164 imulq $19,%rdx,%rax 165 movq %rax,72(%rsp) 166 mulq 8(%rcx) 167 add %rax,%r8 168 adc %rdx,%r9 169 movq 0(%rsi),%rax 170 mulq 0(%rcx) 171 add %rax,%r8 172 adc %rdx,%r9 173 movq 0(%rsi),%rax 174 mulq 8(%rcx) 175 mov %rax,%r10 176 mov %rdx,%r11 177 movq 0(%rsi),%rax 178 mulq 16(%rcx) 179 mov %rax,%r12 180 mov %rdx,%r13 181 movq 0(%rsi),%rax 182 mulq 24(%rcx) 183 mov %rax,%r14 184 mov %rdx,%r15 185 movq 0(%rsi),%rax 186 mulq 32(%rcx) 187 mov %rax,%rbx 188 mov %rdx,%rbp 189 movq 8(%rsi),%rax 190 mulq 0(%rcx) 191 add %rax,%r10 192 adc %rdx,%r11 193 movq 8(%rsi),%rax 194 mulq 8(%rcx) 195 add %rax,%r12 196 adc %rdx,%r13 197 movq 8(%rsi),%rax 198 mulq 16(%rcx) 199 add %rax,%r14 200 adc %rdx,%r15 201 movq 8(%rsi),%rax 202 mulq 24(%rcx) 203 add %rax,%rbx 204 adc %rdx,%rbp 205 movq 8(%rsi),%rdx 206 imulq $19,%rdx,%rax 207 mulq 32(%rcx) 208 add %rax,%r8 209 adc %rdx,%r9 210 movq 16(%rsi),%rax 211 mulq 0(%rcx) 212 add %rax,%r12 213 adc %rdx,%r13 214 movq 16(%rsi),%rax 215 mulq 8(%rcx) 216 add %rax,%r14 217 adc %rdx,%r15 218 movq 16(%rsi),%rax 219 mulq 16(%rcx) 220 add %rax,%rbx 221 adc %rdx,%rbp 222 movq 16(%rsi),%rdx 223 imulq $19,%rdx,%rax 224 mulq 24(%rcx) 225 add %rax,%r8 226 adc %rdx,%r9 227 movq 16(%rsi),%rdx 228 imulq $19,%rdx,%rax 229 mulq 32(%rcx) 230 add %rax,%r10 231 adc %rdx,%r11 232 movq 24(%rsi),%rax 233 mulq 0(%rcx) 234 add %rax,%r14 235 adc %rdx,%r15 236 movq 24(%rsi),%rax 237 mulq 8(%rcx) 238 add %rax,%rbx 239 adc %rdx,%rbp 240 movq 64(%rsp),%rax 241 mulq 24(%rcx) 242 add %rax,%r10 243 adc %rdx,%r11 244 movq 64(%rsp),%rax 245 mulq 32(%rcx) 246 add %rax,%r12 247 adc %rdx,%r13 248 movq 32(%rsi),%rax 249 mulq 0(%rcx) 250 add %rax,%rbx 251 adc %rdx,%rbp 252 movq 72(%rsp),%rax 253 mulq 16(%rcx) 254 add %rax,%r10 255 adc %rdx,%r11 256 movq 72(%rsp),%rax 257 mulq 24(%rcx) 258 add %rax,%r12 259 adc %rdx,%r13 260 movq 72(%rsp),%rax 261 mulq 32(%rcx) 262 add %rax,%r14 263 adc %rdx,%r15 264 movq x25519_x86_64_REDMASK51(%rip),%rsi 265 shld $13,%r8,%r9 266 and %rsi,%r8 267 shld $13,%r10,%r11 268 and %rsi,%r10 269 add %r9,%r10 270 shld $13,%r12,%r13 271 and %rsi,%r12 272 add %r11,%r12 273 shld $13,%r14,%r15 274 and %rsi,%r14 275 add %r13,%r14 276 shld $13,%rbx,%rbp 277 and %rsi,%rbx 278 add %r15,%rbx 279 imulq $19,%rbp,%rdx 280 add %rdx,%r8 281 mov %r8,%rdx 282 shr $51,%rdx 283 add %r10,%rdx 284 mov %rdx,%rcx 285 shr $51,%rdx 286 and %rsi,%r8 287 add %r12,%rdx 288 mov %rdx,%r9 289 shr $51,%rdx 290 and %rsi,%rcx 291 add %r14,%rdx 292 mov %rdx,%rax 293 shr $51,%rdx 294 and %rsi,%r9 295 add %rbx,%rdx 296 mov %rdx,%r10 297 shr $51,%rdx 298 and %rsi,%rax 299 imulq $19,%rdx,%rdx 300 add %rdx,%r8 301 and %rsi,%r10 302 movq %r8,0(%rdi) 303 movq %rcx,8(%rdi) 304 movq %r9,16(%rdi) 305 movq %rax,24(%rdi) 306 movq %r10,32(%rdi) 307 movq 0(%rsp),%r11 308 movq 8(%rsp),%r12 309 movq 16(%rsp),%r13 310 movq 24(%rsp),%r14 311 movq 32(%rsp),%r15 312 movq 40(%rsp),%rbx 313 movq 48(%rsp),%rbp 314 add %r11,%rsp 315 mov %rdi,%rax 316 mov %rsi,%rdx 317 ret 318 319 .p2align 5 320 .globl C_ABI(x25519_x86_64_square) 321 HIDDEN C_ABI(x25519_x86_64_square) 322 C_ABI(x25519_x86_64_square): 323 mov %rsp,%r11 324 and $31,%r11 325 add $64,%r11 326 sub %r11,%rsp 327 movq %r11,0(%rsp) 328 movq %r12,8(%rsp) 329 movq %r13,16(%rsp) 330 movq %r14,24(%rsp) 331 movq %r15,32(%rsp) 332 movq %rbx,40(%rsp) 333 movq %rbp,48(%rsp) 334 movq 0(%rsi),%rax 335 mulq 0(%rsi) 336 mov %rax,%rcx 337 mov %rdx,%r8 338 movq 0(%rsi),%rax 339 shl $1,%rax 340 mulq 8(%rsi) 341 mov %rax,%r9 342 mov %rdx,%r10 343 movq 0(%rsi),%rax 344 shl $1,%rax 345 mulq 16(%rsi) 346 mov %rax,%r11 347 mov %rdx,%r12 348 movq 0(%rsi),%rax 349 shl $1,%rax 350 mulq 24(%rsi) 351 mov %rax,%r13 352 mov %rdx,%r14 353 movq 0(%rsi),%rax 354 shl $1,%rax 355 mulq 32(%rsi) 356 mov %rax,%r15 357 mov %rdx,%rbx 358 movq 8(%rsi),%rax 359 mulq 8(%rsi) 360 add %rax,%r11 361 adc %rdx,%r12 362 movq 8(%rsi),%rax 363 shl $1,%rax 364 mulq 16(%rsi) 365 add %rax,%r13 366 adc %rdx,%r14 367 movq 8(%rsi),%rax 368 shl $1,%rax 369 mulq 24(%rsi) 370 add %rax,%r15 371 adc %rdx,%rbx 372 movq 8(%rsi),%rdx 373 imulq $38,%rdx,%rax 374 mulq 32(%rsi) 375 add %rax,%rcx 376 adc %rdx,%r8 377 movq 16(%rsi),%rax 378 mulq 16(%rsi) 379 add %rax,%r15 380 adc %rdx,%rbx 381 movq 16(%rsi),%rdx 382 imulq $38,%rdx,%rax 383 mulq 24(%rsi) 384 add %rax,%rcx 385 adc %rdx,%r8 386 movq 16(%rsi),%rdx 387 imulq $38,%rdx,%rax 388 mulq 32(%rsi) 389 add %rax,%r9 390 adc %rdx,%r10 391 movq 24(%rsi),%rdx 392 imulq $19,%rdx,%rax 393 mulq 24(%rsi) 394 add %rax,%r9 395 adc %rdx,%r10 396 movq 24(%rsi),%rdx 397 imulq $38,%rdx,%rax 398 mulq 32(%rsi) 399 add %rax,%r11 400 adc %rdx,%r12 401 movq 32(%rsi),%rdx 402 imulq $19,%rdx,%rax 403 mulq 32(%rsi) 404 add %rax,%r13 405 adc %rdx,%r14 406 movq x25519_x86_64_REDMASK51(%rip),%rsi 407 shld $13,%rcx,%r8 408 and %rsi,%rcx 409 shld $13,%r9,%r10 410 and %rsi,%r9 411 add %r8,%r9 412 shld $13,%r11,%r12 413 and %rsi,%r11 414 add %r10,%r11 415 shld $13,%r13,%r14 416 and %rsi,%r13 417 add %r12,%r13 418 shld $13,%r15,%rbx 419 and %rsi,%r15 420 add %r14,%r15 421 imulq $19,%rbx,%rdx 422 add %rdx,%rcx 423 mov %rcx,%rdx 424 shr $51,%rdx 425 add %r9,%rdx 426 and %rsi,%rcx 427 mov %rdx,%r8 428 shr $51,%rdx 429 add %r11,%rdx 430 and %rsi,%r8 431 mov %rdx,%r9 432 shr $51,%rdx 433 add %r13,%rdx 434 and %rsi,%r9 435 mov %rdx,%rax 436 shr $51,%rdx 437 add %r15,%rdx 438 and %rsi,%rax 439 mov %rdx,%r10 440 shr $51,%rdx 441 imulq $19,%rdx,%rdx 442 add %rdx,%rcx 443 and %rsi,%r10 444 movq %rcx,0(%rdi) 445 movq %r8,8(%rdi) 446 movq %r9,16(%rdi) 447 movq %rax,24(%rdi) 448 movq %r10,32(%rdi) 449 movq 0(%rsp),%r11 450 movq 8(%rsp),%r12 451 movq 16(%rsp),%r13 452 movq 24(%rsp),%r14 453 movq 32(%rsp),%r15 454 movq 40(%rsp),%rbx 455 movq 48(%rsp),%rbp 456 add %r11,%rsp 457 mov %rdi,%rax 458 mov %rsi,%rdx 459 ret 460 461 .p2align 5 462 .globl C_ABI(x25519_x86_64_ladderstep) 463 HIDDEN C_ABI(x25519_x86_64_ladderstep) 464 C_ABI(x25519_x86_64_ladderstep): 465 mov %rsp,%r11 466 and $31,%r11 467 add $352,%r11 468 sub %r11,%rsp 469 movq %r11,0(%rsp) 470 movq %r12,8(%rsp) 471 movq %r13,16(%rsp) 472 movq %r14,24(%rsp) 473 movq %r15,32(%rsp) 474 movq %rbx,40(%rsp) 475 movq %rbp,48(%rsp) 476 movq 40(%rdi),%rsi 477 movq 48(%rdi),%rdx 478 movq 56(%rdi),%rcx 479 movq 64(%rdi),%r8 480 movq 72(%rdi),%r9 481 mov %rsi,%rax 482 mov %rdx,%r10 483 mov %rcx,%r11 484 mov %r8,%r12 485 mov %r9,%r13 486 add x25519_x86_64_2P0(%rip),%rax 487 add x25519_x86_64_2P1234(%rip),%r10 488 add x25519_x86_64_2P1234(%rip),%r11 489 add x25519_x86_64_2P1234(%rip),%r12 490 add x25519_x86_64_2P1234(%rip),%r13 491 addq 80(%rdi),%rsi 492 addq 88(%rdi),%rdx 493 addq 96(%rdi),%rcx 494 addq 104(%rdi),%r8 495 addq 112(%rdi),%r9 496 subq 80(%rdi),%rax 497 subq 88(%rdi),%r10 498 subq 96(%rdi),%r11 499 subq 104(%rdi),%r12 500 subq 112(%rdi),%r13 501 movq %rsi,56(%rsp) 502 movq %rdx,64(%rsp) 503 movq %rcx,72(%rsp) 504 movq %r8,80(%rsp) 505 movq %r9,88(%rsp) 506 movq %rax,96(%rsp) 507 movq %r10,104(%rsp) 508 movq %r11,112(%rsp) 509 movq %r12,120(%rsp) 510 movq %r13,128(%rsp) 511 movq 96(%rsp),%rax 512 mulq 96(%rsp) 513 mov %rax,%rsi 514 mov %rdx,%rcx 515 movq 96(%rsp),%rax 516 shl $1,%rax 517 mulq 104(%rsp) 518 mov %rax,%r8 519 mov %rdx,%r9 520 movq 96(%rsp),%rax 521 shl $1,%rax 522 mulq 112(%rsp) 523 mov %rax,%r10 524 mov %rdx,%r11 525 movq 96(%rsp),%rax 526 shl $1,%rax 527 mulq 120(%rsp) 528 mov %rax,%r12 529 mov %rdx,%r13 530 movq 96(%rsp),%rax 531 shl $1,%rax 532 mulq 128(%rsp) 533 mov %rax,%r14 534 mov %rdx,%r15 535 movq 104(%rsp),%rax 536 mulq 104(%rsp) 537 add %rax,%r10 538 adc %rdx,%r11 539 movq 104(%rsp),%rax 540 shl $1,%rax 541 mulq 112(%rsp) 542 add %rax,%r12 543 adc %rdx,%r13 544 movq 104(%rsp),%rax 545 shl $1,%rax 546 mulq 120(%rsp) 547 add %rax,%r14 548 adc %rdx,%r15 549 movq 104(%rsp),%rdx 550 imulq $38,%rdx,%rax 551 mulq 128(%rsp) 552 add %rax,%rsi 553 adc %rdx,%rcx 554 movq 112(%rsp),%rax 555 mulq 112(%rsp) 556 add %rax,%r14 557 adc %rdx,%r15 558 movq 112(%rsp),%rdx 559 imulq $38,%rdx,%rax 560 mulq 120(%rsp) 561 add %rax,%rsi 562 adc %rdx,%rcx 563 movq 112(%rsp),%rdx 564 imulq $38,%rdx,%rax 565 mulq 128(%rsp) 566 add %rax,%r8 567 adc %rdx,%r9 568 movq 120(%rsp),%rdx 569 imulq $19,%rdx,%rax 570 mulq 120(%rsp) 571 add %rax,%r8 572 adc %rdx,%r9 573 movq 120(%rsp),%rdx 574 imulq $38,%rdx,%rax 575 mulq 128(%rsp) 576 add %rax,%r10 577 adc %rdx,%r11 578 movq 128(%rsp),%rdx 579 imulq $19,%rdx,%rax 580 mulq 128(%rsp) 581 add %rax,%r12 582 adc %rdx,%r13 583 movq x25519_x86_64_REDMASK51(%rip),%rdx 584 shld $13,%rsi,%rcx 585 and %rdx,%rsi 586 shld $13,%r8,%r9 587 and %rdx,%r8 588 add %rcx,%r8 589 shld $13,%r10,%r11 590 and %rdx,%r10 591 add %r9,%r10 592 shld $13,%r12,%r13 593 and %rdx,%r12 594 add %r11,%r12 595 shld $13,%r14,%r15 596 and %rdx,%r14 597 add %r13,%r14 598 imulq $19,%r15,%rcx 599 add %rcx,%rsi 600 mov %rsi,%rcx 601 shr $51,%rcx 602 add %r8,%rcx 603 and %rdx,%rsi 604 mov %rcx,%r8 605 shr $51,%rcx 606 add %r10,%rcx 607 and %rdx,%r8 608 mov %rcx,%r9 609 shr $51,%rcx 610 add %r12,%rcx 611 and %rdx,%r9 612 mov %rcx,%rax 613 shr $51,%rcx 614 add %r14,%rcx 615 and %rdx,%rax 616 mov %rcx,%r10 617 shr $51,%rcx 618 imulq $19,%rcx,%rcx 619 add %rcx,%rsi 620 and %rdx,%r10 621 movq %rsi,136(%rsp) 622 movq %r8,144(%rsp) 623 movq %r9,152(%rsp) 624 movq %rax,160(%rsp) 625 movq %r10,168(%rsp) 626 movq 56(%rsp),%rax 627 mulq 56(%rsp) 628 mov %rax,%rsi 629 mov %rdx,%rcx 630 movq 56(%rsp),%rax 631 shl $1,%rax 632 mulq 64(%rsp) 633 mov %rax,%r8 634 mov %rdx,%r9 635 movq 56(%rsp),%rax 636 shl $1,%rax 637 mulq 72(%rsp) 638 mov %rax,%r10 639 mov %rdx,%r11 640 movq 56(%rsp),%rax 641 shl $1,%rax 642 mulq 80(%rsp) 643 mov %rax,%r12 644 mov %rdx,%r13 645 movq 56(%rsp),%rax 646 shl $1,%rax 647 mulq 88(%rsp) 648 mov %rax,%r14 649 mov %rdx,%r15 650 movq 64(%rsp),%rax 651 mulq 64(%rsp) 652 add %rax,%r10 653 adc %rdx,%r11 654 movq 64(%rsp),%rax 655 shl $1,%rax 656 mulq 72(%rsp) 657 add %rax,%r12 658 adc %rdx,%r13 659 movq 64(%rsp),%rax 660 shl $1,%rax 661 mulq 80(%rsp) 662 add %rax,%r14 663 adc %rdx,%r15 664 movq 64(%rsp),%rdx 665 imulq $38,%rdx,%rax 666 mulq 88(%rsp) 667 add %rax,%rsi 668 adc %rdx,%rcx 669 movq 72(%rsp),%rax 670 mulq 72(%rsp) 671 add %rax,%r14 672 adc %rdx,%r15 673 movq 72(%rsp),%rdx 674 imulq $38,%rdx,%rax 675 mulq 80(%rsp) 676 add %rax,%rsi 677 adc %rdx,%rcx 678 movq 72(%rsp),%rdx 679 imulq $38,%rdx,%rax 680 mulq 88(%rsp) 681 add %rax,%r8 682 adc %rdx,%r9 683 movq 80(%rsp),%rdx 684 imulq $19,%rdx,%rax 685 mulq 80(%rsp) 686 add %rax,%r8 687 adc %rdx,%r9 688 movq 80(%rsp),%rdx 689 imulq $38,%rdx,%rax 690 mulq 88(%rsp) 691 add %rax,%r10 692 adc %rdx,%r11 693 movq 88(%rsp),%rdx 694 imulq $19,%rdx,%rax 695 mulq 88(%rsp) 696 add %rax,%r12 697 adc %rdx,%r13 698 movq x25519_x86_64_REDMASK51(%rip),%rdx 699 shld $13,%rsi,%rcx 700 and %rdx,%rsi 701 shld $13,%r8,%r9 702 and %rdx,%r8 703 add %rcx,%r8 704 shld $13,%r10,%r11 705 and %rdx,%r10 706 add %r9,%r10 707 shld $13,%r12,%r13 708 and %rdx,%r12 709 add %r11,%r12 710 shld $13,%r14,%r15 711 and %rdx,%r14 712 add %r13,%r14 713 imulq $19,%r15,%rcx 714 add %rcx,%rsi 715 mov %rsi,%rcx 716 shr $51,%rcx 717 add %r8,%rcx 718 and %rdx,%rsi 719 mov %rcx,%r8 720 shr $51,%rcx 721 add %r10,%rcx 722 and %rdx,%r8 723 mov %rcx,%r9 724 shr $51,%rcx 725 add %r12,%rcx 726 and %rdx,%r9 727 mov %rcx,%rax 728 shr $51,%rcx 729 add %r14,%rcx 730 and %rdx,%rax 731 mov %rcx,%r10 732 shr $51,%rcx 733 imulq $19,%rcx,%rcx 734 add %rcx,%rsi 735 and %rdx,%r10 736 movq %rsi,176(%rsp) 737 movq %r8,184(%rsp) 738 movq %r9,192(%rsp) 739 movq %rax,200(%rsp) 740 movq %r10,208(%rsp) 741 mov %rsi,%rsi 742 mov %r8,%rdx 743 mov %r9,%rcx 744 mov %rax,%r8 745 mov %r10,%r9 746 add x25519_x86_64_2P0(%rip),%rsi 747 add x25519_x86_64_2P1234(%rip),%rdx 748 add x25519_x86_64_2P1234(%rip),%rcx 749 add x25519_x86_64_2P1234(%rip),%r8 750 add x25519_x86_64_2P1234(%rip),%r9 751 subq 136(%rsp),%rsi 752 subq 144(%rsp),%rdx 753 subq 152(%rsp),%rcx 754 subq 160(%rsp),%r8 755 subq 168(%rsp),%r9 756 movq %rsi,216(%rsp) 757 movq %rdx,224(%rsp) 758 movq %rcx,232(%rsp) 759 movq %r8,240(%rsp) 760 movq %r9,248(%rsp) 761 movq 120(%rdi),%rsi 762 movq 128(%rdi),%rdx 763 movq 136(%rdi),%rcx 764 movq 144(%rdi),%r8 765 movq 152(%rdi),%r9 766 mov %rsi,%rax 767 mov %rdx,%r10 768 mov %rcx,%r11 769 mov %r8,%r12 770 mov %r9,%r13 771 add x25519_x86_64_2P0(%rip),%rax 772 add x25519_x86_64_2P1234(%rip),%r10 773 add x25519_x86_64_2P1234(%rip),%r11 774 add x25519_x86_64_2P1234(%rip),%r12 775 add x25519_x86_64_2P1234(%rip),%r13 776 addq 160(%rdi),%rsi 777 addq 168(%rdi),%rdx 778 addq 176(%rdi),%rcx 779 addq 184(%rdi),%r8 780 addq 192(%rdi),%r9 781 subq 160(%rdi),%rax 782 subq 168(%rdi),%r10 783 subq 176(%rdi),%r11 784 subq 184(%rdi),%r12 785 subq 192(%rdi),%r13 786 movq %rsi,256(%rsp) 787 movq %rdx,264(%rsp) 788 movq %rcx,272(%rsp) 789 movq %r8,280(%rsp) 790 movq %r9,288(%rsp) 791 movq %rax,296(%rsp) 792 movq %r10,304(%rsp) 793 movq %r11,312(%rsp) 794 movq %r12,320(%rsp) 795 movq %r13,328(%rsp) 796 movq 280(%rsp),%rsi 797 imulq $19,%rsi,%rax 798 movq %rax,336(%rsp) 799 mulq 112(%rsp) 800 mov %rax,%rsi 801 mov %rdx,%rcx 802 movq 288(%rsp),%rdx 803 imulq $19,%rdx,%rax 804 movq %rax,344(%rsp) 805 mulq 104(%rsp) 806 add %rax,%rsi 807 adc %rdx,%rcx 808 movq 256(%rsp),%rax 809 mulq 96(%rsp) 810 add %rax,%rsi 811 adc %rdx,%rcx 812 movq 256(%rsp),%rax 813 mulq 104(%rsp) 814 mov %rax,%r8 815 mov %rdx,%r9 816 movq 256(%rsp),%rax 817 mulq 112(%rsp) 818 mov %rax,%r10 819 mov %rdx,%r11 820 movq 256(%rsp),%rax 821 mulq 120(%rsp) 822 mov %rax,%r12 823 mov %rdx,%r13 824 movq 256(%rsp),%rax 825 mulq 128(%rsp) 826 mov %rax,%r14 827 mov %rdx,%r15 828 movq 264(%rsp),%rax 829 mulq 96(%rsp) 830 add %rax,%r8 831 adc %rdx,%r9 832 movq 264(%rsp),%rax 833 mulq 104(%rsp) 834 add %rax,%r10 835 adc %rdx,%r11 836 movq 264(%rsp),%rax 837 mulq 112(%rsp) 838 add %rax,%r12 839 adc %rdx,%r13 840 movq 264(%rsp),%rax 841 mulq 120(%rsp) 842 add %rax,%r14 843 adc %rdx,%r15 844 movq 264(%rsp),%rdx 845 imulq $19,%rdx,%rax 846 mulq 128(%rsp) 847 add %rax,%rsi 848 adc %rdx,%rcx 849 movq 272(%rsp),%rax 850 mulq 96(%rsp) 851 add %rax,%r10 852 adc %rdx,%r11 853 movq 272(%rsp),%rax 854 mulq 104(%rsp) 855 add %rax,%r12 856 adc %rdx,%r13 857 movq 272(%rsp),%rax 858 mulq 112(%rsp) 859 add %rax,%r14 860 adc %rdx,%r15 861 movq 272(%rsp),%rdx 862 imulq $19,%rdx,%rax 863 mulq 120(%rsp) 864 add %rax,%rsi 865 adc %rdx,%rcx 866 movq 272(%rsp),%rdx 867 imulq $19,%rdx,%rax 868 mulq 128(%rsp) 869 add %rax,%r8 870 adc %rdx,%r9 871 movq 280(%rsp),%rax 872 mulq 96(%rsp) 873 add %rax,%r12 874 adc %rdx,%r13 875 movq 280(%rsp),%rax 876 mulq 104(%rsp) 877 add %rax,%r14 878 adc %rdx,%r15 879 movq 336(%rsp),%rax 880 mulq 120(%rsp) 881 add %rax,%r8 882 adc %rdx,%r9 883 movq 336(%rsp),%rax 884 mulq 128(%rsp) 885 add %rax,%r10 886 adc %rdx,%r11 887 movq 288(%rsp),%rax 888 mulq 96(%rsp) 889 add %rax,%r14 890 adc %rdx,%r15 891 movq 344(%rsp),%rax 892 mulq 112(%rsp) 893 add %rax,%r8 894 adc %rdx,%r9 895 movq 344(%rsp),%rax 896 mulq 120(%rsp) 897 add %rax,%r10 898 adc %rdx,%r11 899 movq 344(%rsp),%rax 900 mulq 128(%rsp) 901 add %rax,%r12 902 adc %rdx,%r13 903 movq x25519_x86_64_REDMASK51(%rip),%rdx 904 shld $13,%rsi,%rcx 905 and %rdx,%rsi 906 shld $13,%r8,%r9 907 and %rdx,%r8 908 add %rcx,%r8 909 shld $13,%r10,%r11 910 and %rdx,%r10 911 add %r9,%r10 912 shld $13,%r12,%r13 913 and %rdx,%r12 914 add %r11,%r12 915 shld $13,%r14,%r15 916 and %rdx,%r14 917 add %r13,%r14 918 imulq $19,%r15,%rcx 919 add %rcx,%rsi 920 mov %rsi,%rcx 921 shr $51,%rcx 922 add %r8,%rcx 923 mov %rcx,%r8 924 shr $51,%rcx 925 and %rdx,%rsi 926 add %r10,%rcx 927 mov %rcx,%r9 928 shr $51,%rcx 929 and %rdx,%r8 930 add %r12,%rcx 931 mov %rcx,%rax 932 shr $51,%rcx 933 and %rdx,%r9 934 add %r14,%rcx 935 mov %rcx,%r10 936 shr $51,%rcx 937 and %rdx,%rax 938 imulq $19,%rcx,%rcx 939 add %rcx,%rsi 940 and %rdx,%r10 941 movq %rsi,96(%rsp) 942 movq %r8,104(%rsp) 943 movq %r9,112(%rsp) 944 movq %rax,120(%rsp) 945 movq %r10,128(%rsp) 946 movq 320(%rsp),%rsi 947 imulq $19,%rsi,%rax 948 movq %rax,256(%rsp) 949 mulq 72(%rsp) 950 mov %rax,%rsi 951 mov %rdx,%rcx 952 movq 328(%rsp),%rdx 953 imulq $19,%rdx,%rax 954 movq %rax,264(%rsp) 955 mulq 64(%rsp) 956 add %rax,%rsi 957 adc %rdx,%rcx 958 movq 296(%rsp),%rax 959 mulq 56(%rsp) 960 add %rax,%rsi 961 adc %rdx,%rcx 962 movq 296(%rsp),%rax 963 mulq 64(%rsp) 964 mov %rax,%r8 965 mov %rdx,%r9 966 movq 296(%rsp),%rax 967 mulq 72(%rsp) 968 mov %rax,%r10 969 mov %rdx,%r11 970 movq 296(%rsp),%rax 971 mulq 80(%rsp) 972 mov %rax,%r12 973 mov %rdx,%r13 974 movq 296(%rsp),%rax 975 mulq 88(%rsp) 976 mov %rax,%r14 977 mov %rdx,%r15 978 movq 304(%rsp),%rax 979 mulq 56(%rsp) 980 add %rax,%r8 981 adc %rdx,%r9 982 movq 304(%rsp),%rax 983 mulq 64(%rsp) 984 add %rax,%r10 985 adc %rdx,%r11 986 movq 304(%rsp),%rax 987 mulq 72(%rsp) 988 add %rax,%r12 989 adc %rdx,%r13 990 movq 304(%rsp),%rax 991 mulq 80(%rsp) 992 add %rax,%r14 993 adc %rdx,%r15 994 movq 304(%rsp),%rdx 995 imulq $19,%rdx,%rax 996 mulq 88(%rsp) 997 add %rax,%rsi 998 adc %rdx,%rcx 999 movq 312(%rsp),%rax 1000 mulq 56(%rsp) 1001 add %rax,%r10 1002 adc %rdx,%r11 1003 movq 312(%rsp),%rax 1004 mulq 64(%rsp) 1005 add %rax,%r12 1006 adc %rdx,%r13 1007 movq 312(%rsp),%rax 1008 mulq 72(%rsp) 1009 add %rax,%r14 1010 adc %rdx,%r15 1011 movq 312(%rsp),%rdx 1012 imulq $19,%rdx,%rax 1013 mulq 80(%rsp) 1014 add %rax,%rsi 1015 adc %rdx,%rcx 1016 movq 312(%rsp),%rdx 1017 imulq $19,%rdx,%rax 1018 mulq 88(%rsp) 1019 add %rax,%r8 1020 adc %rdx,%r9 1021 movq 320(%rsp),%rax 1022 mulq 56(%rsp) 1023 add %rax,%r12 1024 adc %rdx,%r13 1025 movq 320(%rsp),%rax 1026 mulq 64(%rsp) 1027 add %rax,%r14 1028 adc %rdx,%r15 1029 movq 256(%rsp),%rax 1030 mulq 80(%rsp) 1031 add %rax,%r8 1032 adc %rdx,%r9 1033 movq 256(%rsp),%rax 1034 mulq 88(%rsp) 1035 add %rax,%r10 1036 adc %rdx,%r11 1037 movq 328(%rsp),%rax 1038 mulq 56(%rsp) 1039 add %rax,%r14 1040 adc %rdx,%r15 1041 movq 264(%rsp),%rax 1042 mulq 72(%rsp) 1043 add %rax,%r8 1044 adc %rdx,%r9 1045 movq 264(%rsp),%rax 1046 mulq 80(%rsp) 1047 add %rax,%r10 1048 adc %rdx,%r11 1049 movq 264(%rsp),%rax 1050 mulq 88(%rsp) 1051 add %rax,%r12 1052 adc %rdx,%r13 1053 movq x25519_x86_64_REDMASK51(%rip),%rdx 1054 shld $13,%rsi,%rcx 1055 and %rdx,%rsi 1056 shld $13,%r8,%r9 1057 and %rdx,%r8 1058 add %rcx,%r8 1059 shld $13,%r10,%r11 1060 and %rdx,%r10 1061 add %r9,%r10 1062 shld $13,%r12,%r13 1063 and %rdx,%r12 1064 add %r11,%r12 1065 shld $13,%r14,%r15 1066 and %rdx,%r14 1067 add %r13,%r14 1068 imulq $19,%r15,%rcx 1069 add %rcx,%rsi 1070 mov %rsi,%rcx 1071 shr $51,%rcx 1072 add %r8,%rcx 1073 mov %rcx,%r8 1074 shr $51,%rcx 1075 and %rdx,%rsi 1076 add %r10,%rcx 1077 mov %rcx,%r9 1078 shr $51,%rcx 1079 and %rdx,%r8 1080 add %r12,%rcx 1081 mov %rcx,%rax 1082 shr $51,%rcx 1083 and %rdx,%r9 1084 add %r14,%rcx 1085 mov %rcx,%r10 1086 shr $51,%rcx 1087 and %rdx,%rax 1088 imulq $19,%rcx,%rcx 1089 add %rcx,%rsi 1090 and %rdx,%r10 1091 mov %rsi,%rdx 1092 mov %r8,%rcx 1093 mov %r9,%r11 1094 mov %rax,%r12 1095 mov %r10,%r13 1096 add x25519_x86_64_2P0(%rip),%rdx 1097 add x25519_x86_64_2P1234(%rip),%rcx 1098 add x25519_x86_64_2P1234(%rip),%r11 1099 add x25519_x86_64_2P1234(%rip),%r12 1100 add x25519_x86_64_2P1234(%rip),%r13 1101 addq 96(%rsp),%rsi 1102 addq 104(%rsp),%r8 1103 addq 112(%rsp),%r9 1104 addq 120(%rsp),%rax 1105 addq 128(%rsp),%r10 1106 subq 96(%rsp),%rdx 1107 subq 104(%rsp),%rcx 1108 subq 112(%rsp),%r11 1109 subq 120(%rsp),%r12 1110 subq 128(%rsp),%r13 1111 movq %rsi,120(%rdi) 1112 movq %r8,128(%rdi) 1113 movq %r9,136(%rdi) 1114 movq %rax,144(%rdi) 1115 movq %r10,152(%rdi) 1116 movq %rdx,160(%rdi) 1117 movq %rcx,168(%rdi) 1118 movq %r11,176(%rdi) 1119 movq %r12,184(%rdi) 1120 movq %r13,192(%rdi) 1121 movq 120(%rdi),%rax 1122 mulq 120(%rdi) 1123 mov %rax,%rsi 1124 mov %rdx,%rcx 1125 movq 120(%rdi),%rax 1126 shl $1,%rax 1127 mulq 128(%rdi) 1128 mov %rax,%r8 1129 mov %rdx,%r9 1130 movq 120(%rdi),%rax 1131 shl $1,%rax 1132 mulq 136(%rdi) 1133 mov %rax,%r10 1134 mov %rdx,%r11 1135 movq 120(%rdi),%rax 1136 shl $1,%rax 1137 mulq 144(%rdi) 1138 mov %rax,%r12 1139 mov %rdx,%r13 1140 movq 120(%rdi),%rax 1141 shl $1,%rax 1142 mulq 152(%rdi) 1143 mov %rax,%r14 1144 mov %rdx,%r15 1145 movq 128(%rdi),%rax 1146 mulq 128(%rdi) 1147 add %rax,%r10 1148 adc %rdx,%r11 1149 movq 128(%rdi),%rax 1150 shl $1,%rax 1151 mulq 136(%rdi) 1152 add %rax,%r12 1153 adc %rdx,%r13 1154 movq 128(%rdi),%rax 1155 shl $1,%rax 1156 mulq 144(%rdi) 1157 add %rax,%r14 1158 adc %rdx,%r15 1159 movq 128(%rdi),%rdx 1160 imulq $38,%rdx,%rax 1161 mulq 152(%rdi) 1162 add %rax,%rsi 1163 adc %rdx,%rcx 1164 movq 136(%rdi),%rax 1165 mulq 136(%rdi) 1166 add %rax,%r14 1167 adc %rdx,%r15 1168 movq 136(%rdi),%rdx 1169 imulq $38,%rdx,%rax 1170 mulq 144(%rdi) 1171 add %rax,%rsi 1172 adc %rdx,%rcx 1173 movq 136(%rdi),%rdx 1174 imulq $38,%rdx,%rax 1175 mulq 152(%rdi) 1176 add %rax,%r8 1177 adc %rdx,%r9 1178 movq 144(%rdi),%rdx 1179 imulq $19,%rdx,%rax 1180 mulq 144(%rdi) 1181 add %rax,%r8 1182 adc %rdx,%r9 1183 movq 144(%rdi),%rdx 1184 imulq $38,%rdx,%rax 1185 mulq 152(%rdi) 1186 add %rax,%r10 1187 adc %rdx,%r11 1188 movq 152(%rdi),%rdx 1189 imulq $19,%rdx,%rax 1190 mulq 152(%rdi) 1191 add %rax,%r12 1192 adc %rdx,%r13 1193 movq x25519_x86_64_REDMASK51(%rip),%rdx 1194 shld $13,%rsi,%rcx 1195 and %rdx,%rsi 1196 shld $13,%r8,%r9 1197 and %rdx,%r8 1198 add %rcx,%r8 1199 shld $13,%r10,%r11 1200 and %rdx,%r10 1201 add %r9,%r10 1202 shld $13,%r12,%r13 1203 and %rdx,%r12 1204 add %r11,%r12 1205 shld $13,%r14,%r15 1206 and %rdx,%r14 1207 add %r13,%r14 1208 imulq $19,%r15,%rcx 1209 add %rcx,%rsi 1210 mov %rsi,%rcx 1211 shr $51,%rcx 1212 add %r8,%rcx 1213 and %rdx,%rsi 1214 mov %rcx,%r8 1215 shr $51,%rcx 1216 add %r10,%rcx 1217 and %rdx,%r8 1218 mov %rcx,%r9 1219 shr $51,%rcx 1220 add %r12,%rcx 1221 and %rdx,%r9 1222 mov %rcx,%rax 1223 shr $51,%rcx 1224 add %r14,%rcx 1225 and %rdx,%rax 1226 mov %rcx,%r10 1227 shr $51,%rcx 1228 imulq $19,%rcx,%rcx 1229 add %rcx,%rsi 1230 and %rdx,%r10 1231 movq %rsi,120(%rdi) 1232 movq %r8,128(%rdi) 1233 movq %r9,136(%rdi) 1234 movq %rax,144(%rdi) 1235 movq %r10,152(%rdi) 1236 movq 160(%rdi),%rax 1237 mulq 160(%rdi) 1238 mov %rax,%rsi 1239 mov %rdx,%rcx 1240 movq 160(%rdi),%rax 1241 shl $1,%rax 1242 mulq 168(%rdi) 1243 mov %rax,%r8 1244 mov %rdx,%r9 1245 movq 160(%rdi),%rax 1246 shl $1,%rax 1247 mulq 176(%rdi) 1248 mov %rax,%r10 1249 mov %rdx,%r11 1250 movq 160(%rdi),%rax 1251 shl $1,%rax 1252 mulq 184(%rdi) 1253 mov %rax,%r12 1254 mov %rdx,%r13 1255 movq 160(%rdi),%rax 1256 shl $1,%rax 1257 mulq 192(%rdi) 1258 mov %rax,%r14 1259 mov %rdx,%r15 1260 movq 168(%rdi),%rax 1261 mulq 168(%rdi) 1262 add %rax,%r10 1263 adc %rdx,%r11 1264 movq 168(%rdi),%rax 1265 shl $1,%rax 1266 mulq 176(%rdi) 1267 add %rax,%r12 1268 adc %rdx,%r13 1269 movq 168(%rdi),%rax 1270 shl $1,%rax 1271 mulq 184(%rdi) 1272 add %rax,%r14 1273 adc %rdx,%r15 1274 movq 168(%rdi),%rdx 1275 imulq $38,%rdx,%rax 1276 mulq 192(%rdi) 1277 add %rax,%rsi 1278 adc %rdx,%rcx 1279 movq 176(%rdi),%rax 1280 mulq 176(%rdi) 1281 add %rax,%r14 1282 adc %rdx,%r15 1283 movq 176(%rdi),%rdx 1284 imulq $38,%rdx,%rax 1285 mulq 184(%rdi) 1286 add %rax,%rsi 1287 adc %rdx,%rcx 1288 movq 176(%rdi),%rdx 1289 imulq $38,%rdx,%rax 1290 mulq 192(%rdi) 1291 add %rax,%r8 1292 adc %rdx,%r9 1293 movq 184(%rdi),%rdx 1294 imulq $19,%rdx,%rax 1295 mulq 184(%rdi) 1296 add %rax,%r8 1297 adc %rdx,%r9 1298 movq 184(%rdi),%rdx 1299 imulq $38,%rdx,%rax 1300 mulq 192(%rdi) 1301 add %rax,%r10 1302 adc %rdx,%r11 1303 movq 192(%rdi),%rdx 1304 imulq $19,%rdx,%rax 1305 mulq 192(%rdi) 1306 add %rax,%r12 1307 adc %rdx,%r13 1308 movq x25519_x86_64_REDMASK51(%rip),%rdx 1309 shld $13,%rsi,%rcx 1310 and %rdx,%rsi 1311 shld $13,%r8,%r9 1312 and %rdx,%r8 1313 add %rcx,%r8 1314 shld $13,%r10,%r11 1315 and %rdx,%r10 1316 add %r9,%r10 1317 shld $13,%r12,%r13 1318 and %rdx,%r12 1319 add %r11,%r12 1320 shld $13,%r14,%r15 1321 and %rdx,%r14 1322 add %r13,%r14 1323 imulq $19,%r15,%rcx 1324 add %rcx,%rsi 1325 mov %rsi,%rcx 1326 shr $51,%rcx 1327 add %r8,%rcx 1328 and %rdx,%rsi 1329 mov %rcx,%r8 1330 shr $51,%rcx 1331 add %r10,%rcx 1332 and %rdx,%r8 1333 mov %rcx,%r9 1334 shr $51,%rcx 1335 add %r12,%rcx 1336 and %rdx,%r9 1337 mov %rcx,%rax 1338 shr $51,%rcx 1339 add %r14,%rcx 1340 and %rdx,%rax 1341 mov %rcx,%r10 1342 shr $51,%rcx 1343 imulq $19,%rcx,%rcx 1344 add %rcx,%rsi 1345 and %rdx,%r10 1346 movq %rsi,160(%rdi) 1347 movq %r8,168(%rdi) 1348 movq %r9,176(%rdi) 1349 movq %rax,184(%rdi) 1350 movq %r10,192(%rdi) 1351 movq 184(%rdi),%rsi 1352 imulq $19,%rsi,%rax 1353 movq %rax,56(%rsp) 1354 mulq 16(%rdi) 1355 mov %rax,%rsi 1356 mov %rdx,%rcx 1357 movq 192(%rdi),%rdx 1358 imulq $19,%rdx,%rax 1359 movq %rax,64(%rsp) 1360 mulq 8(%rdi) 1361 add %rax,%rsi 1362 adc %rdx,%rcx 1363 movq 160(%rdi),%rax 1364 mulq 0(%rdi) 1365 add %rax,%rsi 1366 adc %rdx,%rcx 1367 movq 160(%rdi),%rax 1368 mulq 8(%rdi) 1369 mov %rax,%r8 1370 mov %rdx,%r9 1371 movq 160(%rdi),%rax 1372 mulq 16(%rdi) 1373 mov %rax,%r10 1374 mov %rdx,%r11 1375 movq 160(%rdi),%rax 1376 mulq 24(%rdi) 1377 mov %rax,%r12 1378 mov %rdx,%r13 1379 movq 160(%rdi),%rax 1380 mulq 32(%rdi) 1381 mov %rax,%r14 1382 mov %rdx,%r15 1383 movq 168(%rdi),%rax 1384 mulq 0(%rdi) 1385 add %rax,%r8 1386 adc %rdx,%r9 1387 movq 168(%rdi),%rax 1388 mulq 8(%rdi) 1389 add %rax,%r10 1390 adc %rdx,%r11 1391 movq 168(%rdi),%rax 1392 mulq 16(%rdi) 1393 add %rax,%r12 1394 adc %rdx,%r13 1395 movq 168(%rdi),%rax 1396 mulq 24(%rdi) 1397 add %rax,%r14 1398 adc %rdx,%r15 1399 movq 168(%rdi),%rdx 1400 imulq $19,%rdx,%rax 1401 mulq 32(%rdi) 1402 add %rax,%rsi 1403 adc %rdx,%rcx 1404 movq 176(%rdi),%rax 1405 mulq 0(%rdi) 1406 add %rax,%r10 1407 adc %rdx,%r11 1408 movq 176(%rdi),%rax 1409 mulq 8(%rdi) 1410 add %rax,%r12 1411 adc %rdx,%r13 1412 movq 176(%rdi),%rax 1413 mulq 16(%rdi) 1414 add %rax,%r14 1415 adc %rdx,%r15 1416 movq 176(%rdi),%rdx 1417 imulq $19,%rdx,%rax 1418 mulq 24(%rdi) 1419 add %rax,%rsi 1420 adc %rdx,%rcx 1421 movq 176(%rdi),%rdx 1422 imulq $19,%rdx,%rax 1423 mulq 32(%rdi) 1424 add %rax,%r8 1425 adc %rdx,%r9 1426 movq 184(%rdi),%rax 1427 mulq 0(%rdi) 1428 add %rax,%r12 1429 adc %rdx,%r13 1430 movq 184(%rdi),%rax 1431 mulq 8(%rdi) 1432 add %rax,%r14 1433 adc %rdx,%r15 1434 movq 56(%rsp),%rax 1435 mulq 24(%rdi) 1436 add %rax,%r8 1437 adc %rdx,%r9 1438 movq 56(%rsp),%rax 1439 mulq 32(%rdi) 1440 add %rax,%r10 1441 adc %rdx,%r11 1442 movq 192(%rdi),%rax 1443 mulq 0(%rdi) 1444 add %rax,%r14 1445 adc %rdx,%r15 1446 movq 64(%rsp),%rax 1447 mulq 16(%rdi) 1448 add %rax,%r8 1449 adc %rdx,%r9 1450 movq 64(%rsp),%rax 1451 mulq 24(%rdi) 1452 add %rax,%r10 1453 adc %rdx,%r11 1454 movq 64(%rsp),%rax 1455 mulq 32(%rdi) 1456 add %rax,%r12 1457 adc %rdx,%r13 1458 movq x25519_x86_64_REDMASK51(%rip),%rdx 1459 shld $13,%rsi,%rcx 1460 and %rdx,%rsi 1461 shld $13,%r8,%r9 1462 and %rdx,%r8 1463 add %rcx,%r8 1464 shld $13,%r10,%r11 1465 and %rdx,%r10 1466 add %r9,%r10 1467 shld $13,%r12,%r13 1468 and %rdx,%r12 1469 add %r11,%r12 1470 shld $13,%r14,%r15 1471 and %rdx,%r14 1472 add %r13,%r14 1473 imulq $19,%r15,%rcx 1474 add %rcx,%rsi 1475 mov %rsi,%rcx 1476 shr $51,%rcx 1477 add %r8,%rcx 1478 mov %rcx,%r8 1479 shr $51,%rcx 1480 and %rdx,%rsi 1481 add %r10,%rcx 1482 mov %rcx,%r9 1483 shr $51,%rcx 1484 and %rdx,%r8 1485 add %r12,%rcx 1486 mov %rcx,%rax 1487 shr $51,%rcx 1488 and %rdx,%r9 1489 add %r14,%rcx 1490 mov %rcx,%r10 1491 shr $51,%rcx 1492 and %rdx,%rax 1493 imulq $19,%rcx,%rcx 1494 add %rcx,%rsi 1495 and %rdx,%r10 1496 movq %rsi,160(%rdi) 1497 movq %r8,168(%rdi) 1498 movq %r9,176(%rdi) 1499 movq %rax,184(%rdi) 1500 movq %r10,192(%rdi) 1501 movq 200(%rsp),%rsi 1502 imulq $19,%rsi,%rax 1503 movq %rax,56(%rsp) 1504 mulq 152(%rsp) 1505 mov %rax,%rsi 1506 mov %rdx,%rcx 1507 movq 208(%rsp),%rdx 1508 imulq $19,%rdx,%rax 1509 movq %rax,64(%rsp) 1510 mulq 144(%rsp) 1511 add %rax,%rsi 1512 adc %rdx,%rcx 1513 movq 176(%rsp),%rax 1514 mulq 136(%rsp) 1515 add %rax,%rsi 1516 adc %rdx,%rcx 1517 movq 176(%rsp),%rax 1518 mulq 144(%rsp) 1519 mov %rax,%r8 1520 mov %rdx,%r9 1521 movq 176(%rsp),%rax 1522 mulq 152(%rsp) 1523 mov %rax,%r10 1524 mov %rdx,%r11 1525 movq 176(%rsp),%rax 1526 mulq 160(%rsp) 1527 mov %rax,%r12 1528 mov %rdx,%r13 1529 movq 176(%rsp),%rax 1530 mulq 168(%rsp) 1531 mov %rax,%r14 1532 mov %rdx,%r15 1533 movq 184(%rsp),%rax 1534 mulq 136(%rsp) 1535 add %rax,%r8 1536 adc %rdx,%r9 1537 movq 184(%rsp),%rax 1538 mulq 144(%rsp) 1539 add %rax,%r10 1540 adc %rdx,%r11 1541 movq 184(%rsp),%rax 1542 mulq 152(%rsp) 1543 add %rax,%r12 1544 adc %rdx,%r13 1545 movq 184(%rsp),%rax 1546 mulq 160(%rsp) 1547 add %rax,%r14 1548 adc %rdx,%r15 1549 movq 184(%rsp),%rdx 1550 imulq $19,%rdx,%rax 1551 mulq 168(%rsp) 1552 add %rax,%rsi 1553 adc %rdx,%rcx 1554 movq 192(%rsp),%rax 1555 mulq 136(%rsp) 1556 add %rax,%r10 1557 adc %rdx,%r11 1558 movq 192(%rsp),%rax 1559 mulq 144(%rsp) 1560 add %rax,%r12 1561 adc %rdx,%r13 1562 movq 192(%rsp),%rax 1563 mulq 152(%rsp) 1564 add %rax,%r14 1565 adc %rdx,%r15 1566 movq 192(%rsp),%rdx 1567 imulq $19,%rdx,%rax 1568 mulq 160(%rsp) 1569 add %rax,%rsi 1570 adc %rdx,%rcx 1571 movq 192(%rsp),%rdx 1572 imulq $19,%rdx,%rax 1573 mulq 168(%rsp) 1574 add %rax,%r8 1575 adc %rdx,%r9 1576 movq 200(%rsp),%rax 1577 mulq 136(%rsp) 1578 add %rax,%r12 1579 adc %rdx,%r13 1580 movq 200(%rsp),%rax 1581 mulq 144(%rsp) 1582 add %rax,%r14 1583 adc %rdx,%r15 1584 movq 56(%rsp),%rax 1585 mulq 160(%rsp) 1586 add %rax,%r8 1587 adc %rdx,%r9 1588 movq 56(%rsp),%rax 1589 mulq 168(%rsp) 1590 add %rax,%r10 1591 adc %rdx,%r11 1592 movq 208(%rsp),%rax 1593 mulq 136(%rsp) 1594 add %rax,%r14 1595 adc %rdx,%r15 1596 movq 64(%rsp),%rax 1597 mulq 152(%rsp) 1598 add %rax,%r8 1599 adc %rdx,%r9 1600 movq 64(%rsp),%rax 1601 mulq 160(%rsp) 1602 add %rax,%r10 1603 adc %rdx,%r11 1604 movq 64(%rsp),%rax 1605 mulq 168(%rsp) 1606 add %rax,%r12 1607 adc %rdx,%r13 1608 movq x25519_x86_64_REDMASK51(%rip),%rdx 1609 shld $13,%rsi,%rcx 1610 and %rdx,%rsi 1611 shld $13,%r8,%r9 1612 and %rdx,%r8 1613 add %rcx,%r8 1614 shld $13,%r10,%r11 1615 and %rdx,%r10 1616 add %r9,%r10 1617 shld $13,%r12,%r13 1618 and %rdx,%r12 1619 add %r11,%r12 1620 shld $13,%r14,%r15 1621 and %rdx,%r14 1622 add %r13,%r14 1623 imulq $19,%r15,%rcx 1624 add %rcx,%rsi 1625 mov %rsi,%rcx 1626 shr $51,%rcx 1627 add %r8,%rcx 1628 mov %rcx,%r8 1629 shr $51,%rcx 1630 and %rdx,%rsi 1631 add %r10,%rcx 1632 mov %rcx,%r9 1633 shr $51,%rcx 1634 and %rdx,%r8 1635 add %r12,%rcx 1636 mov %rcx,%rax 1637 shr $51,%rcx 1638 and %rdx,%r9 1639 add %r14,%rcx 1640 mov %rcx,%r10 1641 shr $51,%rcx 1642 and %rdx,%rax 1643 imulq $19,%rcx,%rcx 1644 add %rcx,%rsi 1645 and %rdx,%r10 1646 movq %rsi,40(%rdi) 1647 movq %r8,48(%rdi) 1648 movq %r9,56(%rdi) 1649 movq %rax,64(%rdi) 1650 movq %r10,72(%rdi) 1651 movq 216(%rsp),%rax 1652 mulq x25519_x86_64_121666_213(%rip) 1653 shr $13,%rax 1654 mov %rax,%rsi 1655 mov %rdx,%rcx 1656 movq 224(%rsp),%rax 1657 mulq x25519_x86_64_121666_213(%rip) 1658 shr $13,%rax 1659 add %rax,%rcx 1660 mov %rdx,%r8 1661 movq 232(%rsp),%rax 1662 mulq x25519_x86_64_121666_213(%rip) 1663 shr $13,%rax 1664 add %rax,%r8 1665 mov %rdx,%r9 1666 movq 240(%rsp),%rax 1667 mulq x25519_x86_64_121666_213(%rip) 1668 shr $13,%rax 1669 add %rax,%r9 1670 mov %rdx,%r10 1671 movq 248(%rsp),%rax 1672 mulq x25519_x86_64_121666_213(%rip) 1673 shr $13,%rax 1674 add %rax,%r10 1675 imulq $19,%rdx,%rdx 1676 add %rdx,%rsi 1677 addq 136(%rsp),%rsi 1678 addq 144(%rsp),%rcx 1679 addq 152(%rsp),%r8 1680 addq 160(%rsp),%r9 1681 addq 168(%rsp),%r10 1682 movq %rsi,80(%rdi) 1683 movq %rcx,88(%rdi) 1684 movq %r8,96(%rdi) 1685 movq %r9,104(%rdi) 1686 movq %r10,112(%rdi) 1687 movq 104(%rdi),%rsi 1688 imulq $19,%rsi,%rax 1689 movq %rax,56(%rsp) 1690 mulq 232(%rsp) 1691 mov %rax,%rsi 1692 mov %rdx,%rcx 1693 movq 112(%rdi),%rdx 1694 imulq $19,%rdx,%rax 1695 movq %rax,64(%rsp) 1696 mulq 224(%rsp) 1697 add %rax,%rsi 1698 adc %rdx,%rcx 1699 movq 80(%rdi),%rax 1700 mulq 216(%rsp) 1701 add %rax,%rsi 1702 adc %rdx,%rcx 1703 movq 80(%rdi),%rax 1704 mulq 224(%rsp) 1705 mov %rax,%r8 1706 mov %rdx,%r9 1707 movq 80(%rdi),%rax 1708 mulq 232(%rsp) 1709 mov %rax,%r10 1710 mov %rdx,%r11 1711 movq 80(%rdi),%rax 1712 mulq 240(%rsp) 1713 mov %rax,%r12 1714 mov %rdx,%r13 1715 movq 80(%rdi),%rax 1716 mulq 248(%rsp) 1717 mov %rax,%r14 1718 mov %rdx,%r15 1719 movq 88(%rdi),%rax 1720 mulq 216(%rsp) 1721 add %rax,%r8 1722 adc %rdx,%r9 1723 movq 88(%rdi),%rax 1724 mulq 224(%rsp) 1725 add %rax,%r10 1726 adc %rdx,%r11 1727 movq 88(%rdi),%rax 1728 mulq 232(%rsp) 1729 add %rax,%r12 1730 adc %rdx,%r13 1731 movq 88(%rdi),%rax 1732 mulq 240(%rsp) 1733 add %rax,%r14 1734 adc %rdx,%r15 1735 movq 88(%rdi),%rdx 1736 imulq $19,%rdx,%rax 1737 mulq 248(%rsp) 1738 add %rax,%rsi 1739 adc %rdx,%rcx 1740 movq 96(%rdi),%rax 1741 mulq 216(%rsp) 1742 add %rax,%r10 1743 adc %rdx,%r11 1744 movq 96(%rdi),%rax 1745 mulq 224(%rsp) 1746 add %rax,%r12 1747 adc %rdx,%r13 1748 movq 96(%rdi),%rax 1749 mulq 232(%rsp) 1750 add %rax,%r14 1751 adc %rdx,%r15 1752 movq 96(%rdi),%rdx 1753 imulq $19,%rdx,%rax 1754 mulq 240(%rsp) 1755 add %rax,%rsi 1756 adc %rdx,%rcx 1757 movq 96(%rdi),%rdx 1758 imulq $19,%rdx,%rax 1759 mulq 248(%rsp) 1760 add %rax,%r8 1761 adc %rdx,%r9 1762 movq 104(%rdi),%rax 1763 mulq 216(%rsp) 1764 add %rax,%r12 1765 adc %rdx,%r13 1766 movq 104(%rdi),%rax 1767 mulq 224(%rsp) 1768 add %rax,%r14 1769 adc %rdx,%r15 1770 movq 56(%rsp),%rax 1771 mulq 240(%rsp) 1772 add %rax,%r8 1773 adc %rdx,%r9 1774 movq 56(%rsp),%rax 1775 mulq 248(%rsp) 1776 add %rax,%r10 1777 adc %rdx,%r11 1778 movq 112(%rdi),%rax 1779 mulq 216(%rsp) 1780 add %rax,%r14 1781 adc %rdx,%r15 1782 movq 64(%rsp),%rax 1783 mulq 232(%rsp) 1784 add %rax,%r8 1785 adc %rdx,%r9 1786 movq 64(%rsp),%rax 1787 mulq 240(%rsp) 1788 add %rax,%r10 1789 adc %rdx,%r11 1790 movq 64(%rsp),%rax 1791 mulq 248(%rsp) 1792 add %rax,%r12 1793 adc %rdx,%r13 1794 movq x25519_x86_64_REDMASK51(%rip),%rdx 1795 shld $13,%rsi,%rcx 1796 and %rdx,%rsi 1797 shld $13,%r8,%r9 1798 and %rdx,%r8 1799 add %rcx,%r8 1800 shld $13,%r10,%r11 1801 and %rdx,%r10 1802 add %r9,%r10 1803 shld $13,%r12,%r13 1804 and %rdx,%r12 1805 add %r11,%r12 1806 shld $13,%r14,%r15 1807 and %rdx,%r14 1808 add %r13,%r14 1809 imulq $19,%r15,%rcx 1810 add %rcx,%rsi 1811 mov %rsi,%rcx 1812 shr $51,%rcx 1813 add %r8,%rcx 1814 mov %rcx,%r8 1815 shr $51,%rcx 1816 and %rdx,%rsi 1817 add %r10,%rcx 1818 mov %rcx,%r9 1819 shr $51,%rcx 1820 and %rdx,%r8 1821 add %r12,%rcx 1822 mov %rcx,%rax 1823 shr $51,%rcx 1824 and %rdx,%r9 1825 add %r14,%rcx 1826 mov %rcx,%r10 1827 shr $51,%rcx 1828 and %rdx,%rax 1829 imulq $19,%rcx,%rcx 1830 add %rcx,%rsi 1831 and %rdx,%r10 1832 movq %rsi,80(%rdi) 1833 movq %r8,88(%rdi) 1834 movq %r9,96(%rdi) 1835 movq %rax,104(%rdi) 1836 movq %r10,112(%rdi) 1837 movq 0(%rsp),%r11 1838 movq 8(%rsp),%r12 1839 movq 16(%rsp),%r13 1840 movq 24(%rsp),%r14 1841 movq 32(%rsp),%r15 1842 movq 40(%rsp),%rbx 1843 movq 48(%rsp),%rbp 1844 add %r11,%rsp 1845 mov %rdi,%rax 1846 mov %rsi,%rdx 1847 ret 1848 1849 .p2align 5 1850 .globl C_ABI(x25519_x86_64_work_cswap) 1851 HIDDEN C_ABI(x25519_x86_64_work_cswap) 1852 C_ABI(x25519_x86_64_work_cswap): 1853 mov %rsp,%r11 1854 and $31,%r11 1855 add $0,%r11 1856 sub %r11,%rsp 1857 cmp $1,%rsi 1858 movq 0(%rdi),%rsi 1859 movq 80(%rdi),%rdx 1860 movq 8(%rdi),%rcx 1861 movq 88(%rdi),%r8 1862 mov %rsi,%r9 1863 cmove %rdx,%rsi 1864 cmove %r9,%rdx 1865 mov %rcx,%r9 1866 cmove %r8,%rcx 1867 cmove %r9,%r8 1868 movq %rsi,0(%rdi) 1869 movq %rdx,80(%rdi) 1870 movq %rcx,8(%rdi) 1871 movq %r8,88(%rdi) 1872 movq 16(%rdi),%rsi 1873 movq 96(%rdi),%rdx 1874 movq 24(%rdi),%rcx 1875 movq 104(%rdi),%r8 1876 mov %rsi,%r9 1877 cmove %rdx,%rsi 1878 cmove %r9,%rdx 1879 mov %rcx,%r9 1880 cmove %r8,%rcx 1881 cmove %r9,%r8 1882 movq %rsi,16(%rdi) 1883 movq %rdx,96(%rdi) 1884 movq %rcx,24(%rdi) 1885 movq %r8,104(%rdi) 1886 movq 32(%rdi),%rsi 1887 movq 112(%rdi),%rdx 1888 movq 40(%rdi),%rcx 1889 movq 120(%rdi),%r8 1890 mov %rsi,%r9 1891 cmove %rdx,%rsi 1892 cmove %r9,%rdx 1893 mov %rcx,%r9 1894 cmove %r8,%rcx 1895 cmove %r9,%r8 1896 movq %rsi,32(%rdi) 1897 movq %rdx,112(%rdi) 1898 movq %rcx,40(%rdi) 1899 movq %r8,120(%rdi) 1900 movq 48(%rdi),%rsi 1901 movq 128(%rdi),%rdx 1902 movq 56(%rdi),%rcx 1903 movq 136(%rdi),%r8 1904 mov %rsi,%r9 1905 cmove %rdx,%rsi 1906 cmove %r9,%rdx 1907 mov %rcx,%r9 1908 cmove %r8,%rcx 1909 cmove %r9,%r8 1910 movq %rsi,48(%rdi) 1911 movq %rdx,128(%rdi) 1912 movq %rcx,56(%rdi) 1913 movq %r8,136(%rdi) 1914 movq 64(%rdi),%rsi 1915 movq 144(%rdi),%rdx 1916 movq 72(%rdi),%rcx 1917 movq 152(%rdi),%r8 1918 mov %rsi,%r9 1919 cmove %rdx,%rsi 1920 cmove %r9,%rdx 1921 mov %rcx,%r9 1922 cmove %r8,%rcx 1923 cmove %r9,%r8 1924 movq %rsi,64(%rdi) 1925 movq %rdx,144(%rdi) 1926 movq %rcx,72(%rdi) 1927 movq %r8,152(%rdi) 1928 add %r11,%rsp 1929 mov %rdi,%rax 1930 mov %rsi,%rdx 1931 ret 1932