Commit 6674a4fd authored by Horia Geantă's avatar Horia Geantă Committed by Herbert Xu

crypto: caam - constify key data

Key data is not modified, it is copied in the shared descriptor.
Signed-off-by: default avatarHoria Geantă <horia.geanta@nxp.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d8c7fe9f
...@@ -1075,7 +1075,7 @@ void cnstr_shdsc_ablkcipher_encap(u32 * const desc, struct alginfo *cdata, ...@@ -1075,7 +1075,7 @@ void cnstr_shdsc_ablkcipher_encap(u32 * const desc, struct alginfo *cdata,
/* Load nonce into CONTEXT1 reg */ /* Load nonce into CONTEXT1 reg */
if (is_rfc3686) { if (is_rfc3686) {
u8 *nonce = cdata->key_virt + cdata->keylen; const u8 *nonce = cdata->key_virt + cdata->keylen;
append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE, append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE,
LDST_CLASS_IND_CCB | LDST_CLASS_IND_CCB |
...@@ -1140,7 +1140,7 @@ void cnstr_shdsc_ablkcipher_decap(u32 * const desc, struct alginfo *cdata, ...@@ -1140,7 +1140,7 @@ void cnstr_shdsc_ablkcipher_decap(u32 * const desc, struct alginfo *cdata,
/* Load nonce into CONTEXT1 reg */ /* Load nonce into CONTEXT1 reg */
if (is_rfc3686) { if (is_rfc3686) {
u8 *nonce = cdata->key_virt + cdata->keylen; const u8 *nonce = cdata->key_virt + cdata->keylen;
append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE, append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE,
LDST_CLASS_IND_CCB | LDST_CLASS_IND_CCB |
...@@ -1209,7 +1209,7 @@ void cnstr_shdsc_ablkcipher_givencap(u32 * const desc, struct alginfo *cdata, ...@@ -1209,7 +1209,7 @@ void cnstr_shdsc_ablkcipher_givencap(u32 * const desc, struct alginfo *cdata,
/* Load Nonce into CONTEXT1 reg */ /* Load Nonce into CONTEXT1 reg */
if (is_rfc3686) { if (is_rfc3686) {
u8 *nonce = cdata->key_virt + cdata->keylen; const u8 *nonce = cdata->key_virt + cdata->keylen;
append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE, append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE,
LDST_CLASS_IND_CCB | LDST_CLASS_IND_CCB |
......
...@@ -109,7 +109,7 @@ static inline void init_job_desc_shared(u32 * const desc, dma_addr_t ptr, ...@@ -109,7 +109,7 @@ static inline void init_job_desc_shared(u32 * const desc, dma_addr_t ptr,
append_ptr(desc, ptr); append_ptr(desc, ptr);
} }
static inline void append_data(u32 * const desc, void *data, int len) static inline void append_data(u32 * const desc, const void *data, int len)
{ {
u32 *offset = desc_end(desc); u32 *offset = desc_end(desc);
...@@ -172,7 +172,7 @@ static inline void append_cmd_ptr_extlen(u32 * const desc, dma_addr_t ptr, ...@@ -172,7 +172,7 @@ static inline void append_cmd_ptr_extlen(u32 * const desc, dma_addr_t ptr,
append_cmd(desc, len); append_cmd(desc, len);
} }
static inline void append_cmd_data(u32 * const desc, void *data, int len, static inline void append_cmd_data(u32 * const desc, const void *data, int len,
u32 command) u32 command)
{ {
append_cmd(desc, command | IMMEDIATE | len); append_cmd(desc, command | IMMEDIATE | len);
...@@ -271,7 +271,7 @@ APPEND_SEQ_PTR_INTLEN(in, IN) ...@@ -271,7 +271,7 @@ APPEND_SEQ_PTR_INTLEN(in, IN)
APPEND_SEQ_PTR_INTLEN(out, OUT) APPEND_SEQ_PTR_INTLEN(out, OUT)
#define APPEND_CMD_PTR_TO_IMM(cmd, op) \ #define APPEND_CMD_PTR_TO_IMM(cmd, op) \
static inline void append_##cmd##_as_imm(u32 * const desc, void *data, \ static inline void append_##cmd##_as_imm(u32 * const desc, const void *data, \
unsigned int len, u32 options) \ unsigned int len, u32 options) \
{ \ { \
PRINT_POS; \ PRINT_POS; \
...@@ -312,7 +312,7 @@ APPEND_CMD_PTR_LEN(seq_out_ptr, SEQ_OUT_PTR, u32) ...@@ -312,7 +312,7 @@ APPEND_CMD_PTR_LEN(seq_out_ptr, SEQ_OUT_PTR, u32)
* from length of immediate data provided, e.g., split keys * from length of immediate data provided, e.g., split keys
*/ */
#define APPEND_CMD_PTR_TO_IMM2(cmd, op) \ #define APPEND_CMD_PTR_TO_IMM2(cmd, op) \
static inline void append_##cmd##_as_imm(u32 * const desc, void *data, \ static inline void append_##cmd##_as_imm(u32 * const desc, const void *data, \
unsigned int data_len, \ unsigned int data_len, \
unsigned int len, u32 options) \ unsigned int len, u32 options) \
{ \ { \
...@@ -452,7 +452,7 @@ struct alginfo { ...@@ -452,7 +452,7 @@ struct alginfo {
unsigned int keylen_pad; unsigned int keylen_pad;
union { union {
dma_addr_t key_dma; dma_addr_t key_dma;
void *key_virt; const void *key_virt;
}; };
bool key_inline; bool key_inline;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment