.. | .. |
---|
12 | 12 | #define _PKC_DESC_H_ |
---|
13 | 13 | #include "compat.h" |
---|
14 | 14 | #include "pdb.h" |
---|
| 15 | +#include <crypto/engine.h> |
---|
15 | 16 | |
---|
16 | 17 | /** |
---|
17 | 18 | * caam_priv_key_form - CAAM RSA private key representation |
---|
.. | .. |
---|
87 | 88 | |
---|
88 | 89 | /** |
---|
89 | 90 | * caam_rsa_ctx - per session context. |
---|
| 91 | + * @enginectx : crypto engine context |
---|
90 | 92 | * @key : RSA key in DMA zone |
---|
91 | 93 | * @dev : device structure |
---|
| 94 | + * @padding_dma : dma address of padding, for adding it to the input |
---|
92 | 95 | */ |
---|
93 | 96 | struct caam_rsa_ctx { |
---|
| 97 | + struct crypto_engine_ctx enginectx; |
---|
94 | 98 | struct caam_rsa_key key; |
---|
95 | 99 | struct device *dev; |
---|
| 100 | + dma_addr_t padding_dma; |
---|
| 101 | + |
---|
96 | 102 | }; |
---|
97 | 103 | |
---|
98 | 104 | /** |
---|
99 | 105 | * 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 |
---|
101 | 111 | */ |
---|
102 | 112 | struct caam_rsa_req_ctx { |
---|
103 | 113 | 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); |
---|
104 | 119 | }; |
---|
105 | 120 | |
---|
106 | 121 | /** |
---|
107 | 122 | * 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 |
---|
110 | 127 | * @sec4_sg_bytes : length of h/w link table |
---|
| 128 | + * @bklog : stored to determine if the request needs backlog |
---|
111 | 129 | * @sec4_sg_dma : dma address of h/w link table |
---|
112 | 130 | * @sec4_sg : pointer to h/w link table |
---|
113 | 131 | * @pdb : specific RSA Protocol Data Block (PDB) |
---|
.. | .. |
---|
116 | 134 | struct rsa_edesc { |
---|
117 | 135 | int src_nents; |
---|
118 | 136 | int dst_nents; |
---|
| 137 | + int mapped_src_nents; |
---|
| 138 | + int mapped_dst_nents; |
---|
119 | 139 | int sec4_sg_bytes; |
---|
| 140 | + bool bklog; |
---|
120 | 141 | dma_addr_t sec4_sg_dma; |
---|
121 | 142 | struct sec4_sg_entry *sec4_sg; |
---|
122 | 143 | union { |
---|