hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/caam/caampkc.h
....@@ -12,6 +12,7 @@
1212 #define _PKC_DESC_H_
1313 #include "compat.h"
1414 #include "pdb.h"
15
+#include <crypto/engine.h>
1516
1617 /**
1718 * caam_priv_key_form - CAAM RSA private key representation
....@@ -87,27 +88,44 @@
8788
8889 /**
8990 * caam_rsa_ctx - per session context.
91
+ * @enginectx : crypto engine context
9092 * @key : RSA key in DMA zone
9193 * @dev : device structure
94
+ * @padding_dma : dma address of padding, for adding it to the input
9295 */
9396 struct caam_rsa_ctx {
97
+ struct crypto_engine_ctx enginectx;
9498 struct caam_rsa_key key;
9599 struct device *dev;
100
+ dma_addr_t padding_dma;
101
+
96102 };
97103
98104 /**
99105 * caam_rsa_req_ctx - per request context.
100
- * @src: input scatterlist (stripped of leading zeros)
106
+ * @src : input scatterlist (stripped of leading zeros)
107
+ * @fixup_src : input scatterlist (that might be stripped of leading zeros)
108
+ * @fixup_src_len : length of the fixup_src input scatterlist
109
+ * @edesc : s/w-extended rsa descriptor
110
+ * @akcipher_op_done : callback used when operation is done
101111 */
102112 struct caam_rsa_req_ctx {
103113 struct scatterlist src[2];
114
+ struct scatterlist *fixup_src;
115
+ unsigned int fixup_src_len;
116
+ struct rsa_edesc *edesc;
117
+ void (*akcipher_op_done)(struct device *jrdev, u32 *desc, u32 err,
118
+ void *context);
104119 };
105120
106121 /**
107122 * rsa_edesc - s/w-extended rsa descriptor
108
- * @src_nents : number of segments in input scatterlist
109
- * @dst_nents : number of segments in output scatterlist
123
+ * @src_nents : number of segments in input s/w scatterlist
124
+ * @dst_nents : number of segments in output s/w scatterlist
125
+ * @mapped_src_nents: number of segments in input h/w link table
126
+ * @mapped_dst_nents: number of segments in output h/w link table
110127 * @sec4_sg_bytes : length of h/w link table
128
+ * @bklog : stored to determine if the request needs backlog
111129 * @sec4_sg_dma : dma address of h/w link table
112130 * @sec4_sg : pointer to h/w link table
113131 * @pdb : specific RSA Protocol Data Block (PDB)
....@@ -116,7 +134,10 @@
116134 struct rsa_edesc {
117135 int src_nents;
118136 int dst_nents;
137
+ int mapped_src_nents;
138
+ int mapped_dst_nents;
119139 int sec4_sg_bytes;
140
+ bool bklog;
120141 dma_addr_t sec4_sg_dma;
121142 struct sec4_sg_entry *sec4_sg;
122143 union {