GH322 revisited: remove unused function.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
This commit is contained in:
Rich Salz 2016-02-06 13:57:21 -05:00 committed by Rich Salz
parent b00387a0a3
commit 895ffe41c2
2 changed files with 0 additions and 38 deletions

View File

@ -642,39 +642,3 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N,
EVP_MD_CTX_free(mctx); EVP_MD_CTX_free(mctx);
return ok; return ok;
} }
int dsa_paramgen_check_g(DSA *dsa)
{
BN_CTX *ctx;
BIGNUM *tmp;
BN_MONT_CTX *mont = NULL;
int rv = -1;
ctx = BN_CTX_new();
if (ctx == NULL)
return -1;
BN_CTX_start(ctx);
if (BN_cmp(dsa->g, BN_value_one()) <= 0)
return 0;
if (BN_cmp(dsa->g, dsa->p) >= 0)
return 0;
tmp = BN_CTX_get(ctx);
if (!tmp)
goto err;
if ((mont = BN_MONT_CTX_new()) == NULL)
goto err;
if (!BN_MONT_CTX_set(mont, dsa->p, ctx))
goto err;
/* Work out g^q mod p */
if (!BN_mod_exp_mont(tmp, dsa->g, dsa->q, dsa->p, ctx, mont))
goto err;
if (!BN_cmp(tmp, BN_value_one()))
rv = 1;
else
rv = 0;
err:
BN_CTX_end(ctx);
BN_MONT_CTX_free(mont);
BN_CTX_free(ctx);
return rv;
}

View File

@ -65,5 +65,3 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N,
size_t seed_len, int idx, unsigned char *seed_out, size_t seed_len, int idx, unsigned char *seed_out,
int *counter_ret, unsigned long *h_ret, int *counter_ret, unsigned long *h_ret,
BN_GENCB *cb); BN_GENCB *cb);
int dsa_paramgen_check_g(DSA *dsa);