Mercurial > dropbear
comparison curve25519-donna.c @ 1069:2fa71c3b2827 pam
merge pam branch up to date
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 16 Mar 2015 21:34:05 +0800 |
parents | d3925ed45a85 |
children | 27b9ddb06b09 |
comparison
equal
deleted
inserted
replaced
1068:9a6395ddb1b6 | 1069:2fa71c3b2827 |
---|---|
525 limb origx[10], origxprime[10], zzz[19], xx[19], zz[19], xxprime[19], | 525 limb origx[10], origxprime[10], zzz[19], xx[19], zz[19], xxprime[19], |
526 zzprime[19], zzzprime[19], xxxprime[19]; | 526 zzprime[19], zzzprime[19], xxxprime[19]; |
527 | 527 |
528 memcpy(origx, x, 10 * sizeof(limb)); | 528 memcpy(origx, x, 10 * sizeof(limb)); |
529 fsum(x, z); | 529 fsum(x, z); |
530 fdifference(z, origx); // does x - z | 530 fdifference(z, origx); /* does x - z */ |
531 | 531 |
532 memcpy(origxprime, xprime, sizeof(limb) * 10); | 532 memcpy(origxprime, xprime, sizeof(limb) * 10); |
533 fsum(xprime, zprime); | 533 fsum(xprime, zprime); |
534 fdifference(zprime, origxprime); | 534 fdifference(zprime, origxprime); |
535 fproduct(xxprime, xprime, z); | 535 fproduct(xxprime, xprime, z); |
552 fsquare(xx, x); | 552 fsquare(xx, x); |
553 fsquare(zz, z); | 553 fsquare(zz, z); |
554 fproduct(x2, xx, zz); | 554 fproduct(x2, xx, zz); |
555 freduce_degree(x2); | 555 freduce_degree(x2); |
556 freduce_coefficients(x2); | 556 freduce_coefficients(x2); |
557 fdifference(zz, xx); // does zz = xx - zz | 557 fdifference(zz, xx); /* does zz = xx - zz */ |
558 memset(zzz + 10, 0, sizeof(limb) * 9); | 558 memset(zzz + 10, 0, sizeof(limb) * 9); |
559 fscalar_product(zzz, zz, 121665); | 559 fscalar_product(zzz, zz, 121665); |
560 /* No need to call freduce_degree here: | 560 /* No need to call freduce_degree here: |
561 fscalar_product doesn't increase the degree of its input. */ | 561 fscalar_product doesn't increase the degree of its input. */ |
562 freduce_coefficients(zzz); | 562 freduce_coefficients(zzz); |
639 | 639 |
640 memcpy(resultx, nqx, sizeof(limb) * 10); | 640 memcpy(resultx, nqx, sizeof(limb) * 10); |
641 memcpy(resultz, nqz, sizeof(limb) * 10); | 641 memcpy(resultz, nqz, sizeof(limb) * 10); |
642 } | 642 } |
643 | 643 |
644 // ----------------------------------------------------------------------------- | 644 /* ----------------------------------------------------------------------------- |
645 // Shamelessly copied from djb's code | 645 * Shamelessly copied from djb's code |
646 // ----------------------------------------------------------------------------- | 646 * ----------------------------------------------------------------------------- */ |
647 static void | 647 static void |
648 crecip(limb *out, const limb *z) { | 648 crecip(limb *out, const limb *z) { |
649 limb z2[10]; | 649 limb z2[10]; |
650 limb z9[10]; | 650 limb z9[10]; |
651 limb z11[10]; | 651 limb z11[10]; |