diff options
Diffstat (limited to 'cipher')
-rw-r--r-- | cipher/ChangeLog | 6 | ||||
-rw-r--r-- | cipher/dsa.c | 10 | ||||
-rw-r--r-- | cipher/elgamal.c | 20 |
3 files changed, 21 insertions, 15 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 5497117fb..a96580ca1 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,9 @@ +2004-03-29 Werner Koch <[email protected]> + + * elgamal.c (verify): s/exp/exponent/ to shutup a compiler + warning. + * dsa.c (verify): Ditto. + 2003-11-29 David Shaw <[email protected]> * elgamal.c (gen_k): New arg SMALL_K. diff --git a/cipher/dsa.c b/cipher/dsa.c index d728a1b10..a2167adb2 100644 --- a/cipher/dsa.c +++ b/cipher/dsa.c @@ -320,7 +320,7 @@ verify(MPI r, MPI s, MPI hash, DSA_public_key *pkey ) int rc; MPI w, u1, u2, v; MPI base[3]; - MPI exp[3]; + MPI exponent[3]; if( !(mpi_cmp_ui( r, 0 ) > 0 && mpi_cmp( r, pkey->q ) < 0) ) @@ -343,10 +343,10 @@ verify(MPI r, MPI s, MPI hash, DSA_public_key *pkey ) mpi_mulm( u2, r, w, pkey->q ); /* v = g^u1 * y^u2 mod p mod q */ - base[0] = pkey->g; exp[0] = u1; - base[1] = pkey->y; exp[1] = u2; - base[2] = NULL; exp[2] = NULL; - mpi_mulpowm( v, base, exp, pkey->p ); + base[0] = pkey->g; exponent[0] = u1; + base[1] = pkey->y; exponent[1] = u2; + base[2] = NULL; exponent[2] = NULL; + mpi_mulpowm( v, base, exponent, pkey->p ); mpi_fdiv_r( v, v, pkey->q ); rc = !mpi_cmp( v, r ); diff --git a/cipher/elgamal.c b/cipher/elgamal.c index aff9a7e30..0cab9d547 100644 --- a/cipher/elgamal.c +++ b/cipher/elgamal.c @@ -458,7 +458,7 @@ verify(MPI a, MPI b, MPI input, ELG_public_key *pkey ) MPI t1; MPI t2; MPI base[4]; - MPI exp[4]; + MPI exponent[4]; if( !(mpi_cmp_ui( a, 0 ) > 0 && mpi_cmp( a, pkey->p ) < 0) ) return 0; /* assertion 0 < a < p failed */ @@ -478,10 +478,10 @@ verify(MPI a, MPI b, MPI 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; exponent[0] = a; + base[1] = a; exponent[1] = b; + base[2] = NULL; exponent[2] = NULL; + mpi_mulpowm( t1, base, exponent, pkey->p ); /* t2 = g ^ input mod p */ mpi_powm( t2, pkey->g, input, pkey->p ); @@ -490,11 +490,11 @@ verify(MPI a, MPI b, MPI 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 ; exponent[0] = input; + base[1] = pkey->y; exponent[1] = a; + base[2] = a; exponent[2] = b; + base[3] = NULL; exponent[3] = NULL; + mpi_mulpowm( t1, base, exponent, pkey->p ); rc = !mpi_cmp_ui( t1, 1 ); #endif |