aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/elgamal.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-02-09 17:43:42 +0000
committerWerner Koch <[email protected]>1998-02-09 17:43:42 +0000
commitd6fa02add60c1d9ef6c7c576de3beb0a5debfade (patch)
tree4d33ad9fa6f8013b274ecb0dfe36cab7b15b47eb /cipher/elgamal.c
parentremoved aclocal (diff)
downloadgnupg-d6fa02add60c1d9ef6c7c576de3beb0a5debfade.tar.gz
gnupg-d6fa02add60c1d9ef6c7c576de3beb0a5debfade.zip
release 0.2.3
Diffstat (limited to 'cipher/elgamal.c')
-rw-r--r--cipher/elgamal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cipher/elgamal.c b/cipher/elgamal.c
index 9e6805d62..5e6bd0c84 100644
--- a/cipher/elgamal.c
+++ b/cipher/elgamal.c
@@ -113,9 +113,11 @@ gen_k( MPI p )
/****************
* Generate a key pair with a key of size NBITS
* Returns: 2 structures filles with all needed values
+ * and an array with n-1 factors of (p-1)
*/
void
-elg_generate( ELG_public_key *pk, ELG_secret_key *sk, unsigned nbits )
+elg_generate( ELG_public_key *pk, ELG_secret_key *sk,
+ unsigned nbits, MPI **ret_factors )
{
MPI p; /* the prime */
MPI p_min1;
@@ -136,7 +138,7 @@ elg_generate( ELG_public_key *pk, ELG_secret_key *sk, unsigned nbits )
else
qbits = 240;
g = mpi_alloc(1);
- p = generate_elg_prime( nbits, qbits, g );
+ p = generate_elg_prime( nbits, qbits, g, ret_factors );
mpi_sub_ui(p_min1, p, 1);