Change method_mont_p from (char *) to (BN_MONT_CTX *) and remove several
[openssl.git] / crypto / dsa / dsa_ossl.c
index 2f7fef1..8f7ecea 100644 (file)
@@ -230,7 +230,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
 
        if (dsa->flags & DSA_FLAG_CACHE_MONT_P)
                {
-               if (!BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_p,
+               if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p,
                                                CRYPTO_LOCK_DSA,
                                                dsa->p, ctx))
                        goto err;
@@ -238,7 +238,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
 
        /* Compute r = (g^k mod p) mod q */
        DSA_BN_MOD_EXP(goto err, dsa, r, dsa->g, &k, dsa->p, ctx,
-                       (BN_MONT_CTX *)dsa->method_mont_p);
+                       dsa->method_mont_p);
        if (!BN_mod(r,r,dsa->q,ctx)) goto err;
 
        /* Compute  part of 's = inv(k) (m + xr) mod q' */
@@ -311,8 +311,7 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
 
        if (dsa->flags & DSA_FLAG_CACHE_MONT_P)
                {
-               mont = BN_MONT_CTX_set_locked(
-                                       (BN_MONT_CTX **)&dsa->method_mont_p,
+               mont = BN_MONT_CTX_set_locked(&dsa->method_mont_p,
                                        CRYPTO_LOCK_DSA, dsa->p, ctx);
                if (!mont)
                        goto err;
@@ -348,7 +347,7 @@ static int dsa_init(DSA *dsa)
 static int dsa_finish(DSA *dsa)
 {
        if(dsa->method_mont_p)
-               BN_MONT_CTX_free((BN_MONT_CTX *)dsa->method_mont_p);
+               BN_MONT_CTX_free(dsa->method_mont_p);
        return(1);
 }