crypto: marvell/cesa - easier way to get the transform
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 18 Oct 2015 16:23:30 +0000 (17:23 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 20 Oct 2015 14:10:49 +0000 (22:10 +0800)
There's an easier way to get at the hash transform - rather than
using crypto_ahash_tfm(ahash), we can get it directly from
req->base.tfm.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/marvell/hash.c

index 5e0e102ecbfc687e7ce6333d5292e891823a868b..40241fd822c61b01025464b003f42622afd61e4f 100644 (file)
@@ -805,7 +805,7 @@ static int mv_cesa_ahash_export(struct ahash_request *req, void *hash,
        unsigned int digsize = crypto_ahash_digestsize(ahash);
        unsigned int blocksize;
 
-       blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(ahash));
+       blocksize = crypto_ahash_blocksize(ahash);
 
        *len = creq->len;
        memcpy(hash, creq->state, digsize);
@@ -830,7 +830,7 @@ static int mv_cesa_ahash_import(struct ahash_request *req, const void *hash,
        if (ret)
                return ret;
 
-       blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(ahash));
+       blocksize = crypto_ahash_blocksize(ahash);
        if (len >= blocksize)
                mv_cesa_update_op_cfg(&creq->op_tmpl,
                                      CESA_SA_DESC_CFG_MID_FRAG,