1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

release 0.2.3

This commit is contained in:
Werner Koch 1998-02-09 17:43:42 +00:00
parent b18d1107ec
commit d6fa02add6
41 changed files with 464 additions and 110 deletions

View file

@ -65,12 +65,12 @@ generate_public_prime( unsigned nbits )
* indeed a strong prime.
*/
MPI
generate_elg_prime( unsigned pbits, unsigned qbits, MPI g )
generate_elg_prime( unsigned pbits, unsigned qbits, MPI g, MPI **ret_factors )
{
int n; /* number of factors */
int m; /* number of primes in pool */
unsigned fbits; /* length of prime factors */
MPI *factors; /* curent factors */
MPI *factors; /* current factors */
MPI *pool; /* pool of primes */
MPI q; /* first prime factor */
MPI prime; /* prime test value */
@ -167,7 +167,6 @@ generate_elg_prime( unsigned pbits, unsigned qbits, MPI g )
count2 = 0;
} while( !(nprime == pbits && check_prime( prime )) );
if( DBG_CIPHER ) {
putc('\n', stderr);
log_mpidump( "prime : ", prime );
@ -180,6 +179,12 @@ generate_elg_prime( unsigned pbits, unsigned qbits, MPI g )
putc('\n', stderr);
}
if( ret_factors ) { /* caller wants the factors */
*ret_factors = m_alloc_clear( (n+1) * sizeof **ret_factors );
for(i=0; i < n; i++ )
(*ret_factors)[i] = mpi_copy( factors[i] );
}
if( g ) { /* create a generator (start with 3)*/
MPI tmp = mpi_alloc( mpi_get_nlimbs(prime) );
MPI b = mpi_alloc( mpi_get_nlimbs(prime) );