diff options
author | Werner Koch <wk@gnupg.org> | 1997-12-31 13:32:54 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1997-12-31 13:32:54 +0100 |
commit | 4d2636eafe40bc11f2f08254ad9f5a5d376cb268 (patch) | |
tree | f3e5a05befb494ba699d8607802370b9576dcd20 /cipher/primegen.c | |
parent | changed configuration stuff, replaced some Makefile.am by distfiles. (diff) | |
download | gnupg2-4d2636eafe40bc11f2f08254ad9f5a5d376cb268.tar.xz gnupg2-4d2636eafe40bc11f2f08254ad9f5a5d376cb268.zip |
Sylvester Version
Diffstat (limited to 'cipher/primegen.c')
-rw-r--r-- | cipher/primegen.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cipher/primegen.c b/cipher/primegen.c index 8a72973e2..3f6c1f325 100644 --- a/cipher/primegen.c +++ b/cipher/primegen.c @@ -106,20 +106,24 @@ generate_elg_prime( unsigned pbits, unsigned qbits, MPI g ) /* allocate new primes */ for(i=0; i < m; i++ ) { mpi_free(pool[i]); - pool[i] = gen_prime( fbits, 0, 2 ); + pool[i] = NULL; } /* init m_out_of_n() */ perms = m_alloc_clear( m ); for(i=0; i < n; i++ ) { perms[i] = 1; + pool[i] = gen_prime( fbits, 0, 2 ); factors[i] = pool[i]; } } else { m_out_of_n( perms, n, m ); for(i=j=0; i < m && j < n ; i++ ) - if( perms[i] ) + if( perms[i] ) { + if( !pool[i] ) + pool[i] = gen_prime( fbits, 0, 2 ); factors[j++] = pool[i]; + } if( i == n ) { m_free(perms); perms = NULL; fputc('!', stderr); |