GH322 revisited: remove unused function.
authorRich Salz <rsalz@akamai.com>
Sat, 6 Feb 2016 18:57:21 +0000 (13:57 -0500)
committerRich Salz <rsalz@openssl.org>
Mon, 8 Feb 2016 14:21:17 +0000 (09:21 -0500)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
crypto/dsa/dsa_gen.c
crypto/dsa/dsa_locl.h

index c36aa151a5572b12e80241bd854e66dacf10db4f..15d5116ba20d21cfeddc3a3396eaa0c9ec44c158 100644 (file)
@@ -642,39 +642,3 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N,
     EVP_MD_CTX_free(mctx);
     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;
-
-}
index 9c23c3ef90e2dfc5ebe44cadb492ef5466c9529e..6182495848367b2bb9285f73b7782943d537f2df 100644 (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,
                           int *counter_ret, unsigned long *h_ret,
                           BN_GENCB *cb);
-
-int dsa_paramgen_check_g(DSA *dsa);