X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/222c8a436f09da82e2ee7c84c7aca47d11a2c843..813390c45f438f411662b1a55678e63f11681eb4:/mp-modsqrt.c diff --git a/mp-modsqrt.c b/mp-modsqrt.c index 1cacacd..1791185 100644 --- a/mp-modsqrt.c +++ b/mp-modsqrt.c @@ -7,7 +7,7 @@ * (c) 2000 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,12 +15,12 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, @@ -89,7 +89,7 @@ mp *mp_modsqrt(mp *d, mp *a, mp *p) /* --- Find the inverse of %$a$% --- */ ainv = mp_modinv(MP_NEW, a, p); - + /* --- Split %$p - 1$% into a power of two and an odd number --- */ t = mp_sub(MP_NEW, p, MP_ONE); @@ -119,7 +119,7 @@ mp *mp_modsqrt(mp *d, mp *a, mp *p) dd = mpmont_reduce(&mm, dd, dd); dd = mpmont_mul(&mm, dd, dd, ainv); - /* --- Now %$d = d_0^{s - i - 1}$% --- */ + /* --- Now %$d = d_0^{2^{s - i - 1}}$% --- */ for (j = i; j < s - 1; j++) { dd = mp_sqr(dd, dd); @@ -175,11 +175,11 @@ static int verify(dstr *v) fputs("a = ", stderr); mp_writefile(a, stderr, 10); fputc('\n', stderr); fputs("p = ", stderr); mp_writefile(p, stderr, 10); fputc('\n', stderr); if (r) { - fputs("r = ", stderr); + fputs("r = ", stderr); mp_writefile(r, stderr, 10); fputc('\n', stderr); } else - fputs("r = \n", stderr); + fputs("r = \n", stderr); fputs("rr = ", stderr); mp_writefile(rr, stderr, 10); fputc('\n', stderr); ok = 0; }