crypto: crypto4xx - Use crypto_ahash_set_reqsize
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 12 Jul 2009 15:08:28 +0000 (23:08 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 14 Jul 2009 04:58:13 +0000 (12:58 +0800)
This patch makes crypto4xx use crypto_ahash_set_reqsize to avoid
accessing crypto_ahash directly.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/amcc/crypto4xx_alg.c
drivers/crypto/amcc/crypto4xx_core.c

index 61b6e1bec8c64a54d123f0d912df087577bdef0c..a33243c17b00d0c3929fdd49693edc0524e06f8c 100644 (file)
@@ -208,7 +208,8 @@ static int crypto4xx_hash_alg_init(struct crypto_tfm *tfm,
                }
        }
 
-       tfm->crt_ahash.reqsize = sizeof(struct crypto4xx_ctx);
+       crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
+                                sizeof(struct crypto4xx_ctx));
        sa = (struct dynamic_sa_ctl *) ctx->sa_in;
        set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV,
                                 SA_NOT_LOAD_HASH, SA_LOAD_IV_FROM_SA,
index 4c0dfb2b872eab55c0da27f9ab386b04274e2b40..cb7be4283aa0867faf0146b3de77aded048bd7f5 100644 (file)
@@ -1001,7 +1001,8 @@ static int crypto4xx_alg_init(struct crypto_tfm *tfm)
        if (alg->cra_type == &crypto_ablkcipher_type)
                tfm->crt_ablkcipher.reqsize = sizeof(struct crypto4xx_ctx);
        else if (alg->cra_type == &crypto_ahash_type)
-               tfm->crt_ahash.reqsize = sizeof(struct crypto4xx_ctx);
+               crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
+                                        sizeof(struct crypto4xx_ctx));
 
        return 0;
 }