From: Nikos Mavrogiannopoulos Date: Thu, 23 Jan 2014 12:53:49 +0000 (+0100) Subject: Split the generation of keypair from the generation of parameters. X-Git-Tag: gnutls_3_3_0pre0~297 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff99986e72c77fb5e1d6652bdd108445a8476b9d;p=thirdparty%2Fgnutls.git Split the generation of keypair from the generation of parameters. --- diff --git a/lib/nettle/int/dsa-fips.h b/lib/nettle/int/dsa-fips.h index 8b52b039f4..3e1d4d15bf 100644 --- a/lib/nettle/int/dsa-fips.h +++ b/lib/nettle/int/dsa-fips.h @@ -51,8 +51,7 @@ st_provable_prime (mpz_t p, void *progress_ctx, nettle_progress_func * progress); int -dsa_generate_dss_keypair(struct dsa_public_key *pub, - struct dsa_private_key *key, +dsa_generate_dss_pqg(struct dsa_public_key *pub, struct dss_params_validation_seeds* cert, unsigned index, void *random_ctx, nettle_random_func *random, @@ -60,7 +59,13 @@ dsa_generate_dss_keypair(struct dsa_public_key *pub, unsigned p_bits /* = L */, unsigned q_bits /* = N */); int -dsa_validate_dss_keypair(struct dsa_public_key *pub, +dsa_generate_dss_keypair(struct dsa_public_key *pub, + struct dsa_private_key *key, + void *random_ctx, nettle_random_func *random, + void *progress_ctx, nettle_progress_func *progress); + +int +dsa_validate_dss_pqg(struct dsa_public_key *pub, struct dss_params_validation_seeds* cert, unsigned index); diff --git a/lib/nettle/int/dsa-keygen-fips186.c b/lib/nettle/int/dsa-keygen-fips186.c index fd5ed80a6e..c7edaae94a 100644 --- a/lib/nettle/int/dsa-keygen-fips186.c +++ b/lib/nettle/int/dsa-keygen-fips186.c @@ -370,8 +370,7 @@ _dsa_generate_dss_xy(struct dsa_public_key *pub, * */ int -dsa_generate_dss_keypair(struct dsa_public_key *pub, - struct dsa_private_key *key, +dsa_generate_dss_pqg(struct dsa_public_key *pub, struct dss_params_validation_seeds *cert, unsigned index, void *random_ctx, nettle_random_func * random, @@ -397,6 +396,16 @@ dsa_generate_dss_keypair(struct dsa_public_key *pub, if (ret == 0) return 0; + return 1; + +} + +int +dsa_generate_dss_keypair(struct dsa_public_key *pub, + struct dsa_private_key *key, + void *random_ctx, nettle_random_func * random, + void *progress_ctx, nettle_progress_func * progress) +{ _dsa_generate_dss_xy(pub, key, random_ctx, random); if (progress) diff --git a/lib/nettle/int/dsa-validate.c b/lib/nettle/int/dsa-validate.c index 15fdf47474..f5068be946 100644 --- a/lib/nettle/int/dsa-validate.c +++ b/lib/nettle/int/dsa-validate.c @@ -48,7 +48,7 @@ * */ int -dsa_validate_dss_keypair(struct dsa_public_key *pub, +dsa_validate_dss_pqg(struct dsa_public_key *pub, struct dss_params_validation_seeds *cert, unsigned index) {