diff options
-rw-r--r-- | cipher/ChangeLog | 5 | ||||
-rw-r--r-- | cipher/primegen.c | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index ad5cfb50..e69cc508 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,8 @@ +2003-03-12 Moritz Schulte <moritz@g10code.com> + + * primegen.c: Initialize `no_of_small_prime_numbers' statically. + (gen_prime): Remove calculation of `no_of_small_prime_numbers'. + 2003-03-03 Moritz Schulte <moritz@g10code.com> * md.c (gcry_md_ctl): Rewritten to use same style like the other diff --git a/cipher/primegen.c b/cipher/primegen.c index 73f678d4..ffeb52c8 100644 --- a/cipher/primegen.c +++ b/cipher/primegen.c @@ -32,7 +32,6 @@ #include "mpi.h" #include "cipher.h" -static int no_of_small_prime_numbers; static MPI gen_prime( unsigned nbits, int mode, int randomlevel ); static int check_prime( MPI prime, MPI val_2 ); static int is_prime( MPI n, int steps, int *count ); @@ -125,7 +124,7 @@ static ushort small_prime_numbers[] = { 4957, 4967, 4969, 4973, 4987, 4993, 4999, 0 }; - +static int no_of_small_prime_numbers = DIM (small_prime_numbers) - 1; void _gcry_register_primegen_progress ( void (*cb)(void *,const char*,int,int,int), void *cb_data ) @@ -390,10 +389,6 @@ gen_prime( unsigned nbits, int secret, int randomlevel ) if( 0 && DBG_CIPHER ) log_debug("generate a prime of %u bits ", nbits ); - if( !no_of_small_prime_numbers ) { - for(i=0; small_prime_numbers[i]; i++ ) - no_of_small_prime_numbers++; - } mods = gcry_xmalloc( no_of_small_prime_numbers * sizeof *mods ); /* make nbits fit into MPI implementation */ val_2 = mpi_alloc_set_ui( 2 ); |