提交 a60384df 编写于 作者: H Horia Geanta 提交者: Herbert Xu

crypto: caam - set DK (Decrypt Key) bit only for AES accelerator

AES currently shares descriptor creation functions with DES and 3DES.
DK bit is set in all cases, however it is valid only for
the AES accelerator.
Signed-off-by: NHoria Geanta <horia.geanta@freescale.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 de0e35ec
...@@ -97,6 +97,13 @@ static inline void append_dec_op1(u32 *desc, u32 type) ...@@ -97,6 +97,13 @@ static inline void append_dec_op1(u32 *desc, u32 type)
{ {
u32 *jump_cmd, *uncond_jump_cmd; u32 *jump_cmd, *uncond_jump_cmd;
/* DK bit is valid only for AES */
if ((type & OP_ALG_ALGSEL_MASK) != OP_ALG_ALGSEL_AES) {
append_operation(desc, type | OP_ALG_AS_INITFINAL |
OP_ALG_DECRYPT);
return;
}
jump_cmd = append_jump(desc, JUMP_TEST_ALL | JUMP_COND_SHRD); jump_cmd = append_jump(desc, JUMP_TEST_ALL | JUMP_COND_SHRD);
append_operation(desc, type | OP_ALG_AS_INITFINAL | append_operation(desc, type | OP_ALG_AS_INITFINAL |
OP_ALG_DECRYPT); OP_ALG_DECRYPT);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册