diff options
Diffstat (limited to 'cipher')
-rw-r--r-- | cipher/ChangeLog | 7 | ||||
-rw-r--r-- | cipher/blowfish.c | 14 | ||||
-rw-r--r-- | cipher/elgamal.c | 8 |
3 files changed, 18 insertions, 11 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 6b2134da2..74bafed4b 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,10 @@ +2001-03-19 Werner Koch <[email protected]> + + * blowfish.c (encrypt,do_encrypt): Changed name to do_encrypt to + avoid name clahses with an encrypt function in stdlib.h of + Dynix/PIX. Thanks to Gene Carter. + * elgamal.c (encrypt,do_encrypt): Ditto. + 2001-03-12 Werner Koch <[email protected]> * twofish.c (gnupgext_enum_func): Add some static when comnpiled diff --git a/cipher/blowfish.c b/cipher/blowfish.c index 0cb5a861f..f58c70f44 100644 --- a/cipher/blowfish.c +++ b/cipher/blowfish.c @@ -280,7 +280,7 @@ function_F( BLOWFISH_context *bc, u32 x ) static void -encrypt( BLOWFISH_context *bc, u32 *ret_xl, u32 *ret_xr ) +do_encrypt( BLOWFISH_context *bc, u32 *ret_xl, u32 *ret_xr ) { #if BLOWFISH_ROUNDS == 16 u32 xl, xr, *s0, *s1, *s2, *s3, *p; @@ -419,7 +419,7 @@ encrypt_block( BLOWFISH_context *bc, byte *outbuf, byte *inbuf ) d1 = inbuf[0] << 24 | inbuf[1] << 16 | inbuf[2] << 8 | inbuf[3]; d2 = inbuf[4] << 24 | inbuf[5] << 16 | inbuf[6] << 8 | inbuf[7]; - encrypt( bc, &d1, &d2 ); + do_encrypt( bc, &d1, &d2 ); outbuf[0] = (d1 >> 24) & 0xff; outbuf[1] = (d1 >> 16) & 0xff; outbuf[2] = (d1 >> 8) & 0xff; @@ -524,27 +524,27 @@ bf_setkey( BLOWFISH_context *c, byte *key, unsigned keylen ) datal = datar = 0; for(i=0; i < BLOWFISH_ROUNDS+2; i += 2 ) { - encrypt( c, &datal, &datar ); + do_encrypt( c, &datal, &datar ); c->p[i] = datal; c->p[i+1] = datar; } for(i=0; i < 256; i += 2 ) { - encrypt( c, &datal, &datar ); + do_encrypt( c, &datal, &datar ); c->s0[i] = datal; c->s0[i+1] = datar; } for(i=0; i < 256; i += 2 ) { - encrypt( c, &datal, &datar ); + do_encrypt( c, &datal, &datar ); c->s1[i] = datal; c->s1[i+1] = datar; } for(i=0; i < 256; i += 2 ) { - encrypt( c, &datal, &datar ); + do_encrypt( c, &datal, &datar ); c->s2[i] = datal; c->s2[i+1] = datar; } for(i=0; i < 256; i += 2 ) { - encrypt( c, &datal, &datar ); + do_encrypt( c, &datal, &datar ); c->s3[i] = datal; c->s3[i+1] = datar; } diff --git a/cipher/elgamal.c b/cipher/elgamal.c index 02469d6ce..9276631df 100644 --- a/cipher/elgamal.c +++ b/cipher/elgamal.c @@ -50,7 +50,7 @@ static void test_keys( ELG_secret_key *sk, unsigned nbits ); static MPI gen_k( MPI p ); static void generate( ELG_secret_key *sk, unsigned nbits, MPI **factors ); static int check_secret_key( ELG_secret_key *sk ); -static void encrypt(MPI a, MPI b, MPI input, ELG_public_key *pkey ); +static void do_encrypt(MPI a, MPI b, MPI input, ELG_public_key *pkey ); static void decrypt(MPI output, MPI a, MPI b, ELG_secret_key *skey ); static void sign(MPI a, MPI b, MPI input, ELG_secret_key *skey); static int verify(MPI a, MPI b, MPI input, ELG_public_key *pkey); @@ -136,7 +136,7 @@ test_keys( ELG_secret_key *sk, unsigned nbits ) m_free(p); } - encrypt( out1_a, out1_b, test, &pk ); + do_encrypt( out1_a, out1_b, test, &pk ); decrypt( out2, out1_a, out1_b, sk ); if( mpi_cmp( test, out2 ) ) log_fatal("ElGamal operation: encrypt, decrypt failed\n"); @@ -338,7 +338,7 @@ check_secret_key( ELG_secret_key *sk ) static void -encrypt(MPI a, MPI b, MPI input, ELG_public_key *pkey ) +do_encrypt(MPI a, MPI b, MPI input, ELG_public_key *pkey ) { MPI k; @@ -557,7 +557,7 @@ elg_encrypt( int algo, MPI *resarr, MPI data, MPI *pkey ) pk.y = pkey[2]; resarr[0] = mpi_alloc( mpi_get_nlimbs( pk.p ) ); resarr[1] = mpi_alloc( mpi_get_nlimbs( pk.p ) ); - encrypt( resarr[0], resarr[1], data, &pk ); + do_encrypt( resarr[0], resarr[1], data, &pk ); return 0; } |