Skip to content

Commit bd76ad4

Browse files
Salvatore Benedettoherbertx
authored andcommitted
crypto: qat - Stop dropping leading zeros from RSA output
There is not need to drop leading zeros from the RSA output operations results. Signed-off-by: Salvatore Benedetto <salvatore.benedetto@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent c983914 commit bd76ad4

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

‎drivers/crypto/qat/qat_common/qat_asym_algs.c‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -571,32 +571,12 @@ static void qat_rsa_cb(struct icp_qat_fw_pke_resp *resp)
571571

572572
areq->dst_len = req->ctx.rsa->key_sz;
573573
if (req->dst_align) {
574-
char *ptr = req->dst_align;
575-
576-
while (!(*ptr) && areq->dst_len) {
577-
areq->dst_len--;
578-
ptr++;
579-
}
580-
581-
if (areq->dst_len != req->ctx.rsa->key_sz)
582-
memmove(req->dst_align, ptr, areq->dst_len);
583-
584574
scatterwalk_map_and_copy(req->dst_align, areq->dst, 0,
585575
areq->dst_len, 1);
586576

587577
dma_free_coherent(dev, req->ctx.rsa->key_sz, req->dst_align,
588578
req->out.rsa.enc.c);
589579
} else {
590-
char *ptr = sg_virt(areq->dst);
591-
592-
while (!(*ptr) && areq->dst_len) {
593-
areq->dst_len--;
594-
ptr++;
595-
}
596-
597-
if (sg_virt(areq->dst) != ptr && areq->dst_len)
598-
memmove(sg_virt(areq->dst), ptr, areq->dst_len);
599-
600580
dma_unmap_single(dev, req->out.rsa.enc.c, req->ctx.rsa->key_sz,
601581
DMA_FROM_DEVICE);
602582
}

0 commit comments

Comments
 (0)