aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/caam/caampkc.h
diff options
context:
space:
mode:
authorIuliana Prodan <iuliana.prodan@nxp.com>2019-05-28 12:52:10 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-06-06 14:38:56 +0800
commitc3725f7ccc8cae1fb71e97768f03bfbd846f7827 (patch)
tree6ebe0b7648ffa47cc5d266754e9bddfdad848def /drivers/crypto/caam/caampkc.h
parentcrypto: inside-secure - do not rely on the hardware last bit for result descriptors (diff)
downloadlinux-dev-c3725f7ccc8cae1fb71e97768f03bfbd846f7827.tar.xz
linux-dev-c3725f7ccc8cae1fb71e97768f03bfbd846f7827.zip
crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input
The problem is with the input data size sent to CAAM for encrypt/decrypt. Pkcs1pad is failing due to pkcs1 padding done in SW starting with0x01 instead of 0x00 0x01. CAAM expects an input of modulus size. For this we strip the leading zeros in case the size is more than modulus or pad the input with zeros until the modulus size is reached. Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com> Reviewed-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--drivers/crypto/caam/caampkc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caampkc.h b/drivers/crypto/caam/caampkc.h
index 82645bcf8b27..5ac72015eba5 100644
--- a/drivers/crypto/caam/caampkc.h
+++ b/drivers/crypto/caam/caampkc.h
@@ -89,10 +89,12 @@ struct caam_rsa_key {
* caam_rsa_ctx - per session context.
* @key : RSA key in DMA zone
* @dev : device structure
+ * @padding_dma : dma address of padding, for adding it to the input
*/
struct caam_rsa_ctx {
struct caam_rsa_key key;
struct device *dev;
+ dma_addr_t padding_dma;
};
/**