Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] crypto: marvell: Don't copy IV vectors from the _process op for ciphers
@ 2016-07-28  9:59 Romain Perier
  2016-07-28 10:09 ` Boris Brezillon
  2016-07-29 10:37 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Romain Perier @ 2016-07-28  9:59 UTC (permalink / raw)
  To: Boris Brezillon, Arnaud Ebalard
  Cc: David S. Miller, linux-crypto, Thomas Petazzoni, Jason Cooper,
	Andrew Lunn, Sebastian Hesselbarth, Gregory Clement

The IV output vectors should only be copied from the _complete operation
and not from the _process operation, i.e only from the operation that is
designed to copy the result of the request to the right location. This
copy is already done in the _complete operation, so this commit removes
the duplicated code in the _process op.

Fixes: 3610d6cd5231 ("crypto: marvell - Add a complete...")
Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
---
 drivers/crypto/marvell/cipher.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/crypto/marvell/cipher.c b/drivers/crypto/marvell/cipher.c
index 8391aba..d19dc96 100644
--- a/drivers/crypto/marvell/cipher.c
+++ b/drivers/crypto/marvell/cipher.c
@@ -139,20 +139,11 @@ static int mv_cesa_ablkcipher_process(struct crypto_async_request *req,
 	struct ablkcipher_request *ablkreq = ablkcipher_request_cast(req);
 	struct mv_cesa_ablkcipher_req *creq = ablkcipher_request_ctx(ablkreq);
 	struct mv_cesa_req *basereq = &creq->base;
-	unsigned int ivsize;
-	int ret;
 
 	if (mv_cesa_req_get_type(basereq) == CESA_STD_REQ)
 		return mv_cesa_ablkcipher_std_process(ablkreq, status);
 
-	ret = mv_cesa_dma_process(basereq, status);
-	if (ret)
-		return ret;
-
-	ivsize = crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(ablkreq));
-	memcpy_fromio(ablkreq->info, basereq->chain.last->data, ivsize);
-
-	return 0;
+	return mv_cesa_dma_process(basereq, status);
 }
 
 static void mv_cesa_ablkcipher_step(struct crypto_async_request *req)
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: marvell: Don't copy IV vectors from the _process op for ciphers
  2016-07-28  9:59 [PATCH] crypto: marvell: Don't copy IV vectors from the _process op for ciphers Romain Perier
@ 2016-07-28 10:09 ` Boris Brezillon
  2016-07-29 10:37 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2016-07-28 10:09 UTC (permalink / raw)
  To: Romain Perier
  Cc: Arnaud Ebalard, David S. Miller, linux-crypto, Thomas Petazzoni,
	Jason Cooper, Andrew Lunn, Sebastian Hesselbarth, Gregory Clement

On Thu, 28 Jul 2016 11:59:43 +0200
Romain Perier <romain.perier@free-electrons.com> wrote:

> The IV output vectors should only be copied from the _complete operation
> and not from the _process operation, i.e only from the operation that is
> designed to copy the result of the request to the right location. This
> copy is already done in the _complete operation, so this commit removes
> the duplicated code in the _process op.
> 
> Fixes: 3610d6cd5231 ("crypto: marvell - Add a complete...")
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/crypto/marvell/cipher.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/crypto/marvell/cipher.c b/drivers/crypto/marvell/cipher.c
> index 8391aba..d19dc96 100644
> --- a/drivers/crypto/marvell/cipher.c
> +++ b/drivers/crypto/marvell/cipher.c
> @@ -139,20 +139,11 @@ static int mv_cesa_ablkcipher_process(struct crypto_async_request *req,
>  	struct ablkcipher_request *ablkreq = ablkcipher_request_cast(req);
>  	struct mv_cesa_ablkcipher_req *creq = ablkcipher_request_ctx(ablkreq);
>  	struct mv_cesa_req *basereq = &creq->base;
> -	unsigned int ivsize;
> -	int ret;
>  
>  	if (mv_cesa_req_get_type(basereq) == CESA_STD_REQ)
>  		return mv_cesa_ablkcipher_std_process(ablkreq, status);
>  
> -	ret = mv_cesa_dma_process(basereq, status);
> -	if (ret)
> -		return ret;
> -
> -	ivsize = crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(ablkreq));
> -	memcpy_fromio(ablkreq->info, basereq->chain.last->data, ivsize);
> -
> -	return 0;
> +	return mv_cesa_dma_process(basereq, status);
>  }
>  
>  static void mv_cesa_ablkcipher_step(struct crypto_async_request *req)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: marvell: Don't copy IV vectors from the _process op for ciphers
  2016-07-28  9:59 [PATCH] crypto: marvell: Don't copy IV vectors from the _process op for ciphers Romain Perier
  2016-07-28 10:09 ` Boris Brezillon
@ 2016-07-29 10:37 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2016-07-29 10:37 UTC (permalink / raw)
  To: Romain Perier
  Cc: boris.brezillon, arno, davem, linux-crypto, thomas.petazzoni,
	jason, andrew, sebastian.hesselbarth, gregory.clement

Romain Perier <romain.perier@free-electrons.com> wrote:
> The IV output vectors should only be copied from the _complete operation
> and not from the _process operation, i.e only from the operation that is
> designed to copy the result of the request to the right location. This
> copy is already done in the _complete operation, so this commit removes
> the duplicated code in the _process op.
> 
> Fixes: 3610d6cd5231 ("crypto: marvell - Add a complete...")
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-29 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-28  9:59 [PATCH] crypto: marvell: Don't copy IV vectors from the _process op for ciphers Romain Perier
2016-07-28 10:09 ` Boris Brezillon
2016-07-29 10:37 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox