mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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: Horia Geanta <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
de0e35ec2b
commit
a60384dfff
1 changed files with 7 additions and 0 deletions
|
|
@ -97,6 +97,13 @@ static inline void append_dec_op1(u32 *desc, u32 type)
|
|||
{
|
||||
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);
|
||||
append_operation(desc, type | OP_ALG_AS_INITFINAL |
|
||||
OP_ALG_DECRYPT);
|
||||
|
|
|
|||
Loading…
Reference in a new issue