summaryrefslogtreecommitdiff
path: root/mpi/mpi-mod.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2011-02-04 20:21:45 +0100
committerWerner Koch <wk@gnupg.org>2011-02-04 20:21:45 +0100
commit4f048514ecae879fa4bb7b8522baf801229be522 (patch)
treed798c8527b68e83e4419c14d7c6dd47f2abdfd9e /mpi/mpi-mod.c
parent9d00b28e0d04361fe9ccf02983bea781b5701c1d (diff)
downloadlibgcrypt-4f048514ecae879fa4bb7b8522baf801229be522.tar.gz
Nuked almost all trailing whitespace.
Check and install the standard git pre-commit hook.
Diffstat (limited to 'mpi/mpi-mod.c')
-rw-r--r--mpi/mpi-mod.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mpi/mpi-mod.c b/mpi/mpi-mod.c
index 948bf231..7ebfe6dc 100644
--- a/mpi/mpi-mod.c
+++ b/mpi/mpi-mod.c
@@ -3,17 +3,17 @@
2007 Free Software Foundation, Inc.
This file is part of Libgcrypt.
-
+
Libgcrypt is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
Libgcrypt 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 Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -35,7 +35,7 @@ struct barrett_ctx_s
gcry_mpi_t m; /* The modulus - may not be modified. */
int m_copied; /* If true, M needs to be released. */
int k;
- gcry_mpi_t y;
+ gcry_mpi_t y;
gcry_mpi_t r1; /* Helper MPI. */
gcry_mpi_t r2; /* Helper MPI. */
gcry_mpi_t r3; /* Helper MPI allocated on demand. */
@@ -56,7 +56,7 @@ _gcry_mpi_mod (gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor)
_gcry_mpi_barrett_free. If COPY is true M will be transferred to
the context and the user may change M. If COPY is false, M may not
be changed until gcry_mpi_barrett_free has been called. */
-mpi_barrett_t
+mpi_barrett_t
_gcry_mpi_barrett_init (gcry_mpi_t m, int copy)
{
mpi_barrett_t ctx;
@@ -137,7 +137,7 @@ _gcry_mpi_mod_barrett (gcry_mpi_t r, gcry_mpi_t x, mpi_barrett_t ctx)
/* 1. q1 = floor( x / b^k-1)
* q2 = q1 * y
* q3 = floor( q2 / b^k+1 )
- * Actually, we don't need qx, we can work direct on r2
+ * Actually, we don't need qx, we can work direct on r2
*/
mpi_set ( r2, x );
mpi_rshift_limbs ( r2, k-1 );
@@ -167,7 +167,7 @@ _gcry_mpi_mod_barrett (gcry_mpi_t r, gcry_mpi_t x, mpi_barrett_t ctx)
}
mpi_add ( r, r, ctx->r3 );
}
-
+
/* 4. while r >= m do r = r - m */
while ( mpi_cmp( r, m ) >= 0 )
mpi_sub ( r, r, m );
@@ -182,4 +182,3 @@ _gcry_mpi_mul_barrett (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v,
gcry_mpi_mul (w, u, v);
mpi_mod_barrett (w, w, ctx);
}
-