aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/rsa.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1997-11-24 22:24:04 +0000
committerWerner Koch <[email protected]>1997-11-24 22:24:04 +0000
commit46900fbd437a134bd16e5030182fb3a219cd370e (patch)
treef13063a7c4896b189c7a3d09791d5464241174c7 /cipher/rsa.c
parentIDEA removed, signing works (diff)
downloadgnupg-46900fbd437a134bd16e5030182fb3a219cd370e.tar.gz
gnupg-46900fbd437a134bd16e5030182fb3a219cd370e.zip
ElGamal funktioniert und ist default
Diffstat (limited to 'cipher/rsa.c')
-rw-r--r--cipher/rsa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cipher/rsa.c b/cipher/rsa.c
index b2694ed5e..a1f08457b 100644
--- a/cipher/rsa.c
+++ b/cipher/rsa.c
@@ -95,8 +95,8 @@ rsa_generate( RSA_public_key *pk, RSA_secret_key *sk, unsigned nbits )
MPI f;
/* select two (very secret) primes */
- p = generate_random_prime( nbits / 2 );
- q = generate_random_prime( nbits / 2 );
+ p = generate_secret_prime( nbits / 2 );
+ q = generate_secret_prime( nbits / 2 );
if( mpi_cmp( p, q ) > 0 ) /* p shall be smaller than q (for calc of u)*/
mpi_swap(p,q);
/* calculate Euler totient: phi = (p-1)(q-1) */
@@ -120,10 +120,10 @@ rsa_generate( RSA_public_key *pk, RSA_secret_key *sk, unsigned nbits )
mpi_add_ui( e, e, 2);
/* calculate the secret key d = e^1 mod phi */
d = mpi_alloc( nbits / BITS_PER_MPI_LIMB );
- mpi_inv_mod(d, e, f );
+ mpi_invm(d, e, f );
/* calculate the inverse of p and q (used for chinese remainder theorem)*/
u = mpi_alloc( nbits / BITS_PER_MPI_LIMB );
- mpi_inv_mod(u, p, q );
+ mpi_invm(u, p, q );
if( DBG_CIPHER ) {
log_mpidump(" p= ", p );