mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
crypto: sun8i-ce - use helpers to get hash block and digest sizes
Use crypto_ahash_blocksize() and crypto_ahash_digestsize() helpers instead of directly accessing 'struct ahash_alg' members. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
67a4ad04e3
commit
003bb37459
1 changed files with 3 additions and 3 deletions
|
@ -342,8 +342,8 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq)
|
|||
algt = container_of(alg, struct sun8i_ce_alg_template, alg.hash.base);
|
||||
ce = algt->ce;
|
||||
|
||||
bs = algt->alg.hash.base.halg.base.cra_blocksize;
|
||||
digestsize = algt->alg.hash.base.halg.digestsize;
|
||||
bs = crypto_ahash_blocksize(tfm);
|
||||
digestsize = crypto_ahash_digestsize(tfm);
|
||||
if (digestsize == SHA224_DIGEST_SIZE)
|
||||
digestsize = SHA256_DIGEST_SIZE;
|
||||
if (digestsize == SHA384_DIGEST_SIZE)
|
||||
|
@ -455,7 +455,7 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq)
|
|||
err_unmap_result:
|
||||
dma_unmap_single(ce->dev, addr_res, digestsize, DMA_FROM_DEVICE);
|
||||
if (!err)
|
||||
memcpy(areq->result, result, algt->alg.hash.base.halg.digestsize);
|
||||
memcpy(areq->result, result, crypto_ahash_digestsize(tfm));
|
||||
|
||||
err_unmap_src:
|
||||
dma_unmap_sg(ce->dev, areq->src, ns, DMA_TO_DEVICE);
|
||||
|
|
Loading…
Add table
Reference in a new issue