summaryrefslogtreecommitdiff
path: root/cipher/elgamal.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 /cipher/elgamal.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 'cipher/elgamal.c')
-rw-r--r--cipher/elgamal.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/cipher/elgamal.c b/cipher/elgamal.c
index 51e5c559..b902aba6 100644
--- a/cipher/elgamal.c
+++ b/cipher/elgamal.c
@@ -448,7 +448,7 @@ verify(gcry_mpi_t a, gcry_mpi_t b, gcry_mpi_t input, ELG_public_key *pkey )
gcry_mpi_t t1;
gcry_mpi_t t2;
gcry_mpi_t base[4];
- gcry_mpi_t exp[4];
+ gcry_mpi_t ex[4];
if( !(mpi_cmp_ui( a, 0 ) > 0 && mpi_cmp( a, pkey->p ) < 0) )
return 0; /* assertion 0 < a < p failed */
@@ -468,10 +468,10 @@ verify(gcry_mpi_t a, gcry_mpi_t b, gcry_mpi_t input, ELG_public_key *pkey )
rc = !mpi_cmp( t1, t2 );
#elif 0
/* t1 = (y^a mod p) * (a^b mod p) mod p */
- base[0] = pkey->y; exp[0] = a;
- base[1] = a; exp[1] = b;
- base[2] = NULL; exp[2] = NULL;
- mpi_mulpowm( t1, base, exp, pkey->p );
+ base[0] = pkey->y; ex[0] = a;
+ base[1] = a; ex[1] = b;
+ base[2] = NULL; ex[2] = NULL;
+ mpi_mulpowm( t1, base, ex, pkey->p );
/* t2 = g ^ input mod p */
gcry_mpi_powm( t2, pkey->g, input, pkey->p );
@@ -480,11 +480,11 @@ verify(gcry_mpi_t a, gcry_mpi_t b, gcry_mpi_t input, ELG_public_key *pkey )
#else
/* t1 = g ^ - input * y ^ a * a ^ b mod p */
mpi_invm(t2, pkey->g, pkey->p );
- base[0] = t2 ; exp[0] = input;
- base[1] = pkey->y; exp[1] = a;
- base[2] = a; exp[2] = b;
- base[3] = NULL; exp[3] = NULL;
- mpi_mulpowm( t1, base, exp, pkey->p );
+ base[0] = t2 ; ex[0] = input;
+ base[1] = pkey->y; ex[1] = a;
+ base[2] = a; ex[2] = b;
+ base[3] = NULL; ex[3] = NULL;
+ mpi_mulpowm( t1, base, ex, pkey->p );
rc = !mpi_cmp_ui( t1, 1 );
#endif