Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8fc391a authored by Marcelo Cerri's avatar Marcelo Cerri Committed by Herbert Xu
Browse files

crypto: nx - add offset to nx_build_sg_lists()



This patch includes one more parameter to nx_build_sg_lists() to skip
the given number of bytes from beginning of each sg list.

This is needed in order to implement the fixes for the AES modes to make
them able to process larger chunks of data.

Reviewed-by: default avatarJoy Latten <jmlatten@linux.vnet.ibm.com>
Signed-off-by: default avatarMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b8b4a416
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static int cbc_aes_nx_crypt(struct blkcipher_desc *desc,
	else
		NX_CPB_FDM(csbcpb) &= ~NX_FDM_ENDE_ENCRYPT;

	rc = nx_build_sg_lists(nx_ctx, desc, dst, src, nbytes,
	rc = nx_build_sg_lists(nx_ctx, desc, dst, src, nbytes, 0,
			       csbcpb->cpb.aes_cbc.iv);
	if (rc)
		goto out;
+2 −2
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ static int ccm_nx_decrypt(struct aead_request *req,
	if (rc)
		goto out;

	rc = nx_build_sg_lists(nx_ctx, desc, req->dst, req->src, nbytes,
	rc = nx_build_sg_lists(nx_ctx, desc, req->dst, req->src, nbytes, 0,
			       csbcpb->cpb.aes_ccm.iv_or_ctr);
	if (rc)
		goto out;
@@ -339,7 +339,7 @@ static int ccm_nx_encrypt(struct aead_request *req,
	if (rc)
		goto out;

	rc = nx_build_sg_lists(nx_ctx, desc, req->dst, req->src, nbytes,
	rc = nx_build_sg_lists(nx_ctx, desc, req->dst, req->src, nbytes, 0,
			       csbcpb->cpb.aes_ccm.iv_or_ctr);
	if (rc)
		goto out;
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ static int ctr_aes_nx_crypt(struct blkcipher_desc *desc,
		goto out;
	}

	rc = nx_build_sg_lists(nx_ctx, desc, dst, src, nbytes,
	rc = nx_build_sg_lists(nx_ctx, desc, dst, src, nbytes, 0,
			       csbcpb->cpb.aes_ctr.iv);
	if (rc)
		goto out;
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static int ecb_aes_nx_crypt(struct blkcipher_desc *desc,
	else
		NX_CPB_FDM(csbcpb) &= ~NX_FDM_ENDE_ENCRYPT;

	rc = nx_build_sg_lists(nx_ctx, desc, dst, src, nbytes, NULL);
	rc = nx_build_sg_lists(nx_ctx, desc, dst, src, nbytes, 0, NULL);
	if (rc)
		goto out;

+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ static int gcm_aes_nx_crypt(struct aead_request *req, int enc)

	csbcpb->cpb.aes_gcm.bit_length_data = nbytes * 8;

	rc = nx_build_sg_lists(nx_ctx, &desc, req->dst, req->src, nbytes,
	rc = nx_build_sg_lists(nx_ctx, &desc, req->dst, req->src, nbytes, 0,
			       csbcpb->cpb.aes_gcm.iv_or_cnt);
	if (rc)
		goto out;
Loading