diff mbox

crypto: qat - Stop dropping leading zeros from RSA output

Message ID 1467903137-2110-1-git-send-email-salvatore.benedetto@intel.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Salvatore Benedetto July 7, 2016, 2:52 p.m. UTC
There is not need to drop leading zeros from the RSA output
operations results.

Signed-off-by: Salvatore Benedetto <salvatore.benedetto@intel.com>
---
 drivers/crypto/qat/qat_common/qat_asym_algs.c | 20 --------------------
 1 file changed, 20 deletions(-)

Comments

Herbert Xu July 11, 2016, 10:08 a.m. UTC | #1
On Thu, Jul 07, 2016 at 03:52:17PM +0100, Salvatore Benedetto wrote:
> There is not need to drop leading zeros from the RSA output
> operations results.
> 
> Signed-off-by: Salvatore Benedetto <salvatore.benedetto@intel.com>

Patch applied.  Thanks.
diff mbox

Patch

diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b/drivers/crypto/qat/qat_common/qat_asym_algs.c
index 3d56fb8..0d35dca 100644
--- a/drivers/crypto/qat/qat_common/qat_asym_algs.c
+++ b/drivers/crypto/qat/qat_common/qat_asym_algs.c
@@ -571,32 +571,12 @@  static void qat_rsa_cb(struct icp_qat_fw_pke_resp *resp)
 
 	areq->dst_len = req->ctx.rsa->key_sz;
 	if (req->dst_align) {
-		char *ptr = req->dst_align;
-
-		while (!(*ptr) && areq->dst_len) {
-			areq->dst_len--;
-			ptr++;
-		}
-
-		if (areq->dst_len != req->ctx.rsa->key_sz)
-			memmove(req->dst_align, ptr, areq->dst_len);
-
 		scatterwalk_map_and_copy(req->dst_align, areq->dst, 0,
 					 areq->dst_len, 1);
 
 		dma_free_coherent(dev, req->ctx.rsa->key_sz, req->dst_align,
 				  req->out.rsa.enc.c);
 	} else {
-		char *ptr = sg_virt(areq->dst);
-
-		while (!(*ptr) && areq->dst_len) {
-			areq->dst_len--;
-			ptr++;
-		}
-
-		if (sg_virt(areq->dst) != ptr && areq->dst_len)
-			memmove(sg_virt(areq->dst), ptr, areq->dst_len);
-
 		dma_unmap_single(dev, req->out.rsa.enc.c, req->ctx.rsa->key_sz,
 				 DMA_FROM_DEVICE);
 	}