*/
if (rem_bytes >= DESC_AEAD_NULL_ENC_LEN) {
ctx->adata.key_inline = true;
- ctx->adata.key = (uintptr_t)ctx->key;
+ ctx->adata.key_virt = ctx->key;
} else {
ctx->adata.key_inline = false;
- ctx->adata.key = ctx->key_dma;
+ ctx->adata.key_dma = ctx->key_dma;
}
/* aead_encrypt shared descriptor */
*/
if (rem_bytes >= DESC_AEAD_NULL_DEC_LEN) {
ctx->adata.key_inline = true;
- ctx->adata.key = (uintptr_t)ctx->key;
+ ctx->adata.key_virt = ctx->key;
} else {
ctx->adata.key_inline = false;
- ctx->adata.key = ctx->key_dma;
+ ctx->adata.key_dma = ctx->key_dma;
}
/* aead_decrypt shared descriptor */
return -EINVAL;
if (inl_mask & 1)
- ctx->adata.key = (uintptr_t)ctx->key;
+ ctx->adata.key_virt = ctx->key;
else
- ctx->adata.key = ctx->key_dma;
+ ctx->adata.key_dma = ctx->key_dma;
if (inl_mask & 2)
- ctx->cdata.key = (uintptr_t)(ctx->key + ctx->adata.keylen_pad);
+ ctx->cdata.key_virt = ctx->key + ctx->adata.keylen_pad;
else
- ctx->cdata.key = ctx->key_dma + ctx->adata.keylen_pad;
+ ctx->cdata.key_dma = ctx->key_dma + ctx->adata.keylen_pad;
ctx->adata.key_inline = !!(inl_mask & 1);
ctx->cdata.key_inline = !!(inl_mask & 2);
return -EINVAL;
if (inl_mask & 1)
- ctx->adata.key = (uintptr_t)ctx->key;
+ ctx->adata.key_virt = ctx->key;
else
- ctx->adata.key = ctx->key_dma;
+ ctx->adata.key_dma = ctx->key_dma;
if (inl_mask & 2)
- ctx->cdata.key = (uintptr_t)(ctx->key + ctx->adata.keylen_pad);
+ ctx->cdata.key_virt = ctx->key + ctx->adata.keylen_pad;
else
- ctx->cdata.key = ctx->key_dma + ctx->adata.keylen_pad;
+ ctx->cdata.key_dma = ctx->key_dma + ctx->adata.keylen_pad;
ctx->adata.key_inline = !!(inl_mask & 1);
ctx->cdata.key_inline = !!(inl_mask & 2);
return -EINVAL;
if (inl_mask & 1)
- ctx->adata.key = (uintptr_t)ctx->key;
+ ctx->adata.key_virt = ctx->key;
else
- ctx->adata.key = ctx->key_dma;
+ ctx->adata.key_dma = ctx->key_dma;
if (inl_mask & 2)
- ctx->cdata.key = (uintptr_t)(ctx->key + ctx->adata.keylen_pad);
+ ctx->cdata.key_virt = ctx->key + ctx->adata.keylen_pad;
else
- ctx->cdata.key = ctx->key_dma + ctx->adata.keylen_pad;
+ ctx->cdata.key_dma = ctx->key_dma + ctx->adata.keylen_pad;
ctx->adata.key_inline = !!(inl_mask & 1);
ctx->cdata.key_inline = !!(inl_mask & 2);
*/
if (rem_bytes >= DESC_GCM_ENC_LEN) {
ctx->cdata.key_inline = true;
- ctx->cdata.key = (uintptr_t)ctx->key;
+ ctx->cdata.key_virt = ctx->key;
} else {
ctx->cdata.key_inline = false;
- ctx->cdata.key = ctx->key_dma;
+ ctx->cdata.key_dma = ctx->key_dma;
}
desc = ctx->sh_desc_enc;
*/
if (rem_bytes >= DESC_GCM_DEC_LEN) {
ctx->cdata.key_inline = true;
- ctx->cdata.key = (uintptr_t)ctx->key;
+ ctx->cdata.key_virt = ctx->key;
} else {
ctx->cdata.key_inline = false;
- ctx->cdata.key = ctx->key_dma;
+ ctx->cdata.key_dma = ctx->key_dma;
}
desc = ctx->sh_desc_dec;
*/
if (rem_bytes >= DESC_RFC4106_ENC_LEN) {
ctx->cdata.key_inline = true;
- ctx->cdata.key = (uintptr_t)ctx->key;
+ ctx->cdata.key_virt = ctx->key;
} else {
ctx->cdata.key_inline = false;
- ctx->cdata.key = ctx->key_dma;
+ ctx->cdata.key_dma = ctx->key_dma;
}
desc = ctx->sh_desc_enc;
*/
if (rem_bytes >= DESC_RFC4106_DEC_LEN) {
ctx->cdata.key_inline = true;
- ctx->cdata.key = (uintptr_t)ctx->key;
+ ctx->cdata.key_virt = ctx->key;
} else {
ctx->cdata.key_inline = false;
- ctx->cdata.key = ctx->key_dma;
+ ctx->cdata.key_dma = ctx->key_dma;
}
desc = ctx->sh_desc_dec;
*/
if (rem_bytes >= DESC_RFC4543_ENC_LEN) {
ctx->cdata.key_inline = true;
- ctx->cdata.key = (uintptr_t)ctx->key;
+ ctx->cdata.key_virt = ctx->key;
} else {
ctx->cdata.key_inline = false;
- ctx->cdata.key = ctx->key_dma;
+ ctx->cdata.key_dma = ctx->key_dma;
}
desc = ctx->sh_desc_enc;
*/
if (rem_bytes >= DESC_RFC4543_DEC_LEN) {
ctx->cdata.key_inline = true;
- ctx->cdata.key = (uintptr_t)ctx->key;
+ ctx->cdata.key_virt = ctx->key;
} else {
ctx->cdata.key_inline = false;
- ctx->cdata.key = ctx->key_dma;
+ ctx->cdata.key_dma = ctx->key_dma;
}
desc = ctx->sh_desc_dec;
return -ENOMEM;
}
ctx->cdata.keylen = keylen;
- ctx->cdata.key = (uintptr_t)ctx->key;
+ ctx->cdata.key_virt = ctx->key;
ctx->cdata.key_inline = true;
/* ablkcipher_encrypt shared descriptor */
return -ENOMEM;
}
ctx->cdata.keylen = keylen;
- ctx->cdata.key = (uintptr_t)ctx->key;
+ ctx->cdata.key_virt = ctx->key;
ctx->cdata.key_inline = true;
/* xts_ablkcipher_encrypt shared descriptor */
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD);
if (adata->key_inline)
- append_key_as_imm(desc, (void *)adata->key, adata->keylen_pad,
+ append_key_as_imm(desc, adata->key_virt, adata->keylen_pad,
adata->keylen, CLASS_2 | KEY_DEST_MDHA_SPLIT |
KEY_ENC);
else
- append_key(desc, adata->key, adata->keylen, CLASS_2 |
+ append_key(desc, adata->key_dma, adata->keylen, CLASS_2 |
KEY_DEST_MDHA_SPLIT | KEY_ENC);
set_jump_tgt_here(desc, key_jump_cmd);
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD);
if (adata->key_inline)
- append_key_as_imm(desc, (void *)adata->key, adata->keylen_pad,
+ append_key_as_imm(desc, adata->key_virt, adata->keylen_pad,
adata->keylen, CLASS_2 |
KEY_DEST_MDHA_SPLIT | KEY_ENC);
else
- append_key(desc, adata->key, adata->keylen, CLASS_2 |
+ append_key(desc, adata->key_dma, adata->keylen, CLASS_2 |
KEY_DEST_MDHA_SPLIT | KEY_ENC);
set_jump_tgt_here(desc, key_jump_cmd);
enckeylen -= CTR_RFC3686_NONCE_SIZE;
if (adata->key_inline)
- append_key_as_imm(desc, (void *)adata->key, adata->keylen_pad,
+ append_key_as_imm(desc, adata->key_virt, adata->keylen_pad,
adata->keylen, CLASS_2 |
KEY_DEST_MDHA_SPLIT | KEY_ENC);
else
- append_key(desc, adata->key, adata->keylen, CLASS_2 |
+ append_key(desc, adata->key_dma, adata->keylen, CLASS_2 |
KEY_DEST_MDHA_SPLIT | KEY_ENC);
if (cdata->key_inline)
- append_key_as_imm(desc, (void *)cdata->key, enckeylen,
+ append_key_as_imm(desc, cdata->key_virt, enckeylen,
enckeylen, CLASS_1 | KEY_DEST_CLASS_REG);
else
- append_key(desc, cdata->key, enckeylen, CLASS_1 |
+ append_key(desc, cdata->key_dma, enckeylen, CLASS_1 |
KEY_DEST_CLASS_REG);
/* Load Counter into CONTEXT1 reg */
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD | JUMP_COND_SELF);
if (cdata->key_inline)
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
else
- append_key(desc, cdata->key, cdata->keylen, CLASS_1 |
+ append_key(desc, cdata->key_dma, cdata->keylen, CLASS_1 |
KEY_DEST_CLASS_REG);
set_jump_tgt_here(desc, key_jump_cmd);
JUMP_TEST_ALL | JUMP_COND_SHRD |
JUMP_COND_SELF);
if (cdata->key_inline)
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
else
- append_key(desc, cdata->key, cdata->keylen, CLASS_1 |
+ append_key(desc, cdata->key_dma, cdata->keylen, CLASS_1 |
KEY_DEST_CLASS_REG);
set_jump_tgt_here(desc, key_jump_cmd);
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD);
if (cdata->key_inline)
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
else
- append_key(desc, cdata->key, cdata->keylen, CLASS_1 |
+ append_key(desc, cdata->key_dma, cdata->keylen, CLASS_1 |
KEY_DEST_CLASS_REG);
set_jump_tgt_here(desc, key_jump_cmd);
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD);
if (cdata->key_inline)
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 |
KEY_DEST_CLASS_REG);
else
- append_key(desc, cdata->key, cdata->keylen, CLASS_1 |
+ append_key(desc, cdata->key_dma, cdata->keylen, CLASS_1 |
KEY_DEST_CLASS_REG);
set_jump_tgt_here(desc, key_jump_cmd);
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD);
if (cdata->key_inline)
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
else
- append_key(desc, cdata->key, cdata->keylen, CLASS_1 |
+ append_key(desc, cdata->key_dma, cdata->keylen, CLASS_1 |
KEY_DEST_CLASS_REG);
set_jump_tgt_here(desc, key_jump_cmd);
key_jump_cmd = append_jump(desc, JUMP_JSL | JUMP_TEST_ALL |
JUMP_COND_SHRD);
if (cdata->key_inline)
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
else
- append_key(desc, cdata->key, cdata->keylen, CLASS_1 |
+ append_key(desc, cdata->key_dma, cdata->keylen, CLASS_1 |
KEY_DEST_CLASS_REG);
set_jump_tgt_here(desc, key_jump_cmd);
JUMP_COND_SHRD);
/* Load class1 key only */
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
/* Load nonce into CONTEXT1 reg */
if (is_rfc3686) {
- u8 *nonce = (u8 *)cdata->key + cdata->keylen;
+ u8 *nonce = cdata->key_virt + cdata->keylen;
append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE,
LDST_CLASS_IND_CCB |
JUMP_COND_SHRD);
/* Load class1 key only */
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
/* Load nonce into CONTEXT1 reg */
if (is_rfc3686) {
- u8 *nonce = (u8 *)cdata->key + cdata->keylen;
+ u8 *nonce = cdata->key_virt + cdata->keylen;
append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE,
LDST_CLASS_IND_CCB |
JUMP_COND_SHRD);
/* Load class1 key only */
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
/* Load Nonce into CONTEXT1 reg */
if (is_rfc3686) {
- u8 *nonce = (u8 *)cdata->key + cdata->keylen;
+ u8 *nonce = cdata->key_virt + cdata->keylen;
append_load_as_imm(desc, nonce, CTR_RFC3686_NONCE_SIZE,
LDST_CLASS_IND_CCB |
JUMP_COND_SHRD);
/* Load class1 keys only */
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
/* Load sector size with index 40 bytes (0x28) */
JUMP_COND_SHRD);
/* Load class1 key only */
- append_key_as_imm(desc, (void *)cdata->key, cdata->keylen,
+ append_key_as_imm(desc, cdata->key_virt, cdata->keylen,
cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG);
/* Load sector size with index 40 bytes (0x28) */