summaryrefslogtreecommitdiff
path: root/drivers/crypto/caam/caampkc.h
diff options
context:
space:
mode:
authorIuliana Prodan <iuliana.prodan@nxp.com>2019-05-28 12:52:11 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-06-06 14:38:57 +0800
commit3b2614cb864d4114250f043ce6ff94e152198ae5 (patch)
tree937f713b44e07c5d3ef54e03b3fff0506ac0eb03 /drivers/crypto/caam/caampkc.h
parentc3725f7ccc8cae1fb71e97768f03bfbd846f7827 (diff)
crypto: caam - strip input without changing crypto request
For rsa and pkcs1pad, CAAM expects an input of modulus size. For this we strip the leading zeros in case the size is more than modulus. This commit avoids modifying the crypto request while stripping zeros from input, to comply with the crypto API requirement. This is done by adding a fixup input pointer and length. Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com> Reviewed-by: Horia Geanta <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam/caampkc.h')
-rw-r--r--drivers/crypto/caam/caampkc.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/crypto/caam/caampkc.h b/drivers/crypto/caam/caampkc.h
index 5ac72015eba5..2c488c9a3812 100644
--- a/drivers/crypto/caam/caampkc.h
+++ b/drivers/crypto/caam/caampkc.h
@@ -95,14 +95,19 @@ struct caam_rsa_ctx {
struct caam_rsa_key key;
struct device *dev;
dma_addr_t padding_dma;
+
};
/**
* caam_rsa_req_ctx - per request context.
- * @src: input scatterlist (stripped of leading zeros)
+ * @src : input scatterlist (stripped of leading zeros)
+ * @fixup_src : input scatterlist (that might be stripped of leading zeros)
+ * @fixup_src_len : length of the fixup_src input scatterlist
*/
struct caam_rsa_req_ctx {
struct scatterlist src[2];
+ struct scatterlist *fixup_src;
+ unsigned int fixup_src_len;
};
/**