summaryrefslogtreecommitdiff
path: root/mpi/mpi-pow.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2003-10-31 05:06:09 +0000
committerWerner Koch <wk@gnupg.org>2003-10-31 05:06:09 +0000
commit42fe74d70b1b3f2dd2a033ee525a2dd1d186345e (patch)
tree3288aec9c23c344f2adb04ea0c198138a06a7759 /mpi/mpi-pow.c
parent21dece6b2618a281567a631a7adbce1266d002b4 (diff)
downloadlibgcrypt-42fe74d70b1b3f2dd2a033ee525a2dd1d186345e.tar.gz
* acinclude.m4 (AC_CHECK_PTH): Added.
* configure.ac: Use it here instead of the generic lib test. Bumbed LT vesion to C9/A2/R0. * dsa.c (verify): s/exp/ex/ due to shadowing of a builtin. * elgamal.c (verify): Ditto. * ac.c (gcry_ac_data_get_index): s/index/idx/ (gcry_ac_data_copy_internal): Remove the cast in _gcry_malloc. (gcry_ac_data_add): Must use gcry_realloc instead of realloc. * pubkey.c (sexp_elements_extract): s/index/idx/ as tribute to the forehackers. (gcry_pk_encrypt): Removed shadowed definition of I. Reordered arguments to malloc for clarity. (gcry_pk_sign, gcry_pk_genkey): Ditto. * primegen.c (prime_generate_internal): s/random/randomlevel/. * i386/mpih-rshift.S, i386/mpih-lshift.S: Use %dl and not %edx for testb; this avoids an assembler warning. * mpi-pow.c (gcry_mpi_powm): s/exp/expo/ to avoid shadowing warning. * autogen.sh: Allow to override the tool name. Do not run libtoolize. Update required version numbers. * libgcrypt.vers (_gcry_generate_elg_prime): Removed this symbol; gnutls does not need it anymore. * secmem.c (mb_get_new): s/pool/block/ due to global pool. * misc.c (gcry_set_log_handler): s/logf/f/ to avoid shadowing warning against a builtin. * ath-pth-compat.c: cast pth_connect to get rid of the const prototype. * basic.c (check_aes128_cbc_cts_cipher): Make it a prototype * ac.c (check_run): Comment unused variable.
Diffstat (limited to 'mpi/mpi-pow.c')
-rw-r--r--mpi/mpi-pow.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mpi/mpi-pow.c b/mpi/mpi-pow.c
index 7f4b6503..e0331d7f 100644
--- a/mpi/mpi-pow.c
+++ b/mpi/mpi-pow.c
@@ -34,10 +34,10 @@
/****************
- * RES = BASE ^ EXP mod MOD
+ * RES = BASE ^ EXPO mod MOD
*/
void
-gcry_mpi_powm( gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t exp, gcry_mpi_t mod)
+gcry_mpi_powm( gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t expo, gcry_mpi_t mod)
{
mpi_ptr_t rp, ep, mp, bp;
mpi_size_t esize, msize, bsize, rsize;
@@ -53,19 +53,19 @@ gcry_mpi_powm( gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t exp, gcry_mpi_t mod)
mpi_size_t tsize=0; /* to avoid compiler warning */
/* fixme: we should check that the warning is void*/
- esize = exp->nlimbs;
+ esize = expo->nlimbs;
msize = mod->nlimbs;
size = 2 * msize;
- esign = exp->sign;
+ esign = expo->sign;
msign = mod->sign;
- esec = mpi_is_secure(exp);
+ esec = mpi_is_secure(expo);
msec = mpi_is_secure(mod);
bsec = mpi_is_secure(base);
rsec = mpi_is_secure(res);
rp = res->d;
- ep = exp->d;
+ ep = expo->d;
if( !msize )
msize = 1 / msize; /* provoke a signal */
@@ -127,7 +127,7 @@ gcry_mpi_powm( gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t exp, gcry_mpi_t mod)
rp = res->d;
}
}
- else { /* Make BASE, EXP and MOD not overlap with RES. */
+ else { /* Make BASE, EXPO and MOD not overlap with RES. */
if( rp == bp ) {
/* RES and BASE are identical. Allocate temp. space for BASE. */
assert( !bp_marker );
@@ -135,7 +135,7 @@ gcry_mpi_powm( gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t exp, gcry_mpi_t mod)
MPN_COPY(bp, rp, bsize);
}
if( rp == ep ) {
- /* RES and EXP are identical. Allocate temp. space for EXP. */
+ /* RES and EXPO are identical. Allocate temp. space for EXPO. */
ep = ep_marker = mpi_alloc_limb_space( esize, esec );
MPN_COPY(ep, rp, esize);
}
@@ -165,7 +165,7 @@ gcry_mpi_powm( gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t exp, gcry_mpi_t mod)
i = esize - 1;
e = ep[i];
count_leading_zeros (c, e);
- e = (e << c) << 1; /* shift the exp bits to the left, lose msb */
+ e = (e << c) << 1; /* shift the expo bits to the left, lose msb */
c = BITS_PER_MPI_LIMB - 1 - c;
/* Main loop.