diff options
author | Horia Geanta <horia.geanta@freescale.com> | 2014-07-11 08:46:58 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-07-23 09:31:36 -0400 |
commit | a60384dfff3df41e86431974e5f9807773332d9e (patch) | |
tree | 8b66c6996a651bb32b47428cb7d2a6743d659211 /drivers/crypto | |
parent | de0e35ec2b72be30892f28a939c358af1df4fa2c (diff) |
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 <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/caamalg.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 694df4685920..a80ea853701d 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c | |||
@@ -97,6 +97,13 @@ static inline void append_dec_op1(u32 *desc, u32 type) | |||
97 | { | 97 | { |
98 | u32 *jump_cmd, *uncond_jump_cmd; | 98 | u32 *jump_cmd, *uncond_jump_cmd; |
99 | 99 | ||
100 | /* DK bit is valid only for AES */ | ||
101 | if ((type & OP_ALG_ALGSEL_MASK) != OP_ALG_ALGSEL_AES) { | ||
102 | append_operation(desc, type | OP_ALG_AS_INITFINAL | | ||
103 | OP_ALG_DECRYPT); | ||
104 | return; | ||
105 | } | ||
106 | |||
100 | jump_cmd = append_jump(desc, JUMP_TEST_ALL | JUMP_COND_SHRD); | 107 | jump_cmd = append_jump(desc, JUMP_TEST_ALL | JUMP_COND_SHRD); |
101 | append_operation(desc, type | OP_ALG_AS_INITFINAL | | 108 | append_operation(desc, type | OP_ALG_AS_INITFINAL | |
102 | OP_ALG_DECRYPT); | 109 | OP_ALG_DECRYPT); |